// JavaScript Document

/*********************************************************************************************/
/*　各ページ共通
/*********************************************************************************************/

$(document).ready(function(){

	//ヘッダー
	$("div#header ul li a img").each(function() {
			var off = this.src;
			var dot = this.src.lastIndexOf('.');
			var on  = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			$(this).hover(
				function() { this.src = on; },
				function() { this.src = off; });
			$(window).unload(
				function(){ this.src = off; });			
    });
	
	//メインナビゲーション
	$("div#main_nav ul li a img").each(function() {
			var off = this.src;
			var dot = this.src.lastIndexOf('.');
			var on  = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			$(this).hover(
				function() { this.src = on; },
				function() { this.src = off; });
			$(window).unload(
				function(){ this.src = off; });			
    });
	
	//右メニュー
	$("div#secondary a img").each(function() {
			var off = this.src;
			var dot = this.src.lastIndexOf('.');
			var on  = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			$(this).hover(
				function() { this.src = on; },
				function() { this.src = off; });
			$(window).unload(
				function(){ this.src = off; });			
    });

	//トップページへ
	$("div#totop a img").each(function() {
			var off = this.src;
			var dot = this.src.lastIndexOf('.');
			var on  = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			$(this).hover(
				function() { this.src = on; },
				function() { this.src = off; });
			$(window).unload(
				function(){ this.src = off; });			
    });

});



/*********************************************************************************************/
/*　トップページ
/*********************************************************************************************/

$("body#index").ready(function(){

	$("div#btn_suggestions a img").each(function() {
			var off = this.src;
			var dot = this.src.lastIndexOf('.');
			var on  = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			$(this).hover(
				function() { this.src = on; },
				function() { this.src = off; });
			$(window).unload(
				function(){ this.src = off; });			
    });
	
	$("div#btn_suggestions a img").each(function() {
			var off = this.src;
			var dot = this.src.lastIndexOf('.');
			var on  = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			$(this).hover(
				function() { this.src = on; },
				function() { this.src = off; });
			$(window).unload(
				function(){ this.src = off; });			
    });
	
	$("p.detail_btn a img").each(function() {
			var off = this.src;
			var dot = this.src.lastIndexOf('.');
			var on  = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			$(this).hover(
				function() { this.src = on; },
				function() { this.src = off; });
			$(window).unload(
				function(){ this.src = off; });			
    });
	
});



/*********************************************************************************************/
/*　社員インタビュー
/*********************************************************************************************/

$("body#interview").ready(function(){

	$("ul.staff_list a img").each(function() {
			var off = this.src;
			var dot = this.src.lastIndexOf('.');
			var on  = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			$(this).hover(
				function() { this.src = on; },
				function() { this.src = off; });
			$(window).unload(
				function(){ this.src = off; });			
    });
});



/*********************************************************************************************/
/*　お問い合わせ
/*********************************************************************************************/

$("body#contact").ready(function(){

	//メインナビゲーション
	$("div#link_contact a img").each(function() {
			var off = this.src;
			var dot = this.src.lastIndexOf('.');
			var on  = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			$(this).hover(
				function() { this.src = on; },
				function() { this.src = off; });
			$(window).unload(
				function(){ this.src = off; });			
    });
});



