/*

lastupdate:2011/02/01

*/
var add = {
	winkRollover:function(){
		$('a.wink img').mouseover(function(){
			$(this).css({
				opacity:0.2
			});
			$(this).fadeTo('slow',1);
		});
	},
	
	currentOpen:function(){
		$('#navi ul ul').hide();
		$('#navi .current').parents().show();
		$('#navi .current').parent().children().show();
	},
	
	defText:function(){
		var txtField = $("#headerR input");
		var defTxt = 'サイト内検索';
		var valTxt = txtField.val();
		var txtColor = '#44545E';
		
		if(!valTxt){
			txtField.val(defTxt).css("color",txtColor);
		}
		
		txtField.focus(function(){
			if(this.value == defTxt){
				$(this).val("").css("color","#333");
			}
		});
		
		txtField.blur(function(){
			if(this.value == ""){
				$(this).val(defTxt).css("color",txtColor);
			}else{
				$(this).css("color","#333");
			}
		});
	},
	
	opaRollover:function(){
		$('div#bannerArea a img').hover(function(){
			$(this).css('opacity', 0.7);
		},function(){
			$(this).css('opacity', 1);
		}
		);
	},
	
	tabClick:function(){
		$('#tab li a').click(function(){
			$('#tab li a').removeClass('active');
			$(this).addClass('active');
		});
	},
	
	mapHover:function(){
		var $tab = $('.routeTab a');
		var $routeNav = $('.routeNav');
		var defHref = $routeNav.next().find('img').attr('src');
		
		$tab.click(function(){
			defHref = $($(this).attr('href')+' .routeMap img').attr('src');
		});
		
		$routeNav.find('a').click(function(){
			return false;
		});
		
		$routeNav.find('a').hover(
			function(){
				$(this).closest('.routeNav').next().find('img').attr('src',$(this).attr('href'));
			},
			function(){
				$(this).closest('.routeNav').next().find('img').attr('src',defHref);
			}
		);
	}
	
	
}

$(function(){
	//add.winkRollover();
	add.currentOpen();
	add.defText();
	add.opaRollover();
	add.tabClick();
	add.mapHover();
	$('#tab li:eq(0) a').click();
	
});


window.onload = function(){
	//$('').flatHeights();
}



