// JavaScript Document

$(document).ready(function(){
	$(".rollover img").fadeTo(100,1);
	$(".rollover img").hover(function(){
			$(this).fadeTo(100,0.7);
		},
		function(){
			$(this).fadeTo(100,1);
		});
	
	//メインナビゲーション
	$("ul#global_nav a img").each(function() {
			var off = this.src;
			var dot = this.src.lastIndexOf('.');
			var on  = this.src.substr(0, dot) + '_over-trans' + this.src.substr(dot, 4);
			$(this).hover(
				function() { this.src = on; },
				function() { this.src = off; });
			$(window).unload(
				function(){ this.src = off; });			
    });
	
	//各ページナビゲーション
	$("div#page_nav 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#page_nav_side 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; });			
    });
	
	//各種ボタン
	$(".btn_rollover 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; });			
    });
	
	//totop
	$("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#oata_user").ready(function(){
	//totop
	$("p.link_entry 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; });			
    });
});


$(window).unload(
	function(){ $(".rollover img").fadeTo(100,1); });			

