// JavaScript Document
$(document).ready(function(){
	
	$("img[src*='_off.']").rollOver();
	$("button").rollOver("img");
	$("a.pn[href^='#']").smScroll({speed:800, easing:"easeOutCubic"});
	$(".ar").alphaRo({from:1, to:0.8, group:false});
	$("a[rel='jump'], area[rel='jump']").anotherWin({width:650});
	$("#mainInner").subMenuStoker("#sideBar");
	$(".pop").anotherWin({width:700,height:600,name:"sub",scrollbars:"yes",resizable:"no",menubar:"no"});
	$(".setBox").setHeight(".itemBox");
	$(".productSet").setHeight(".productBox");
	$("input.ex").exClick(".contact form");
	$("textarea.ex").exClick(".contact form");

});
$(document).ready( function() {
	var nav = $("#localNavi .inner li img");
	var topNav = $(".pageTop img");
/*
	var hash = location.hash.replace("#a", "")
	if(0<=hash){
		nav.eq(hash).attr("src", nav.eq(hash).attr("src").replace("_off.", "_on."));
	}
	*/
	
	if( nav.length > 0 ) {
		nav.click(function(){
			nav.each(function(){
				$(this).attr("src", $(this).attr("src").replace("_on.", "_off."));
			}).rollOver();
			$(this).attr("src", $(this).attr("src").replace("_off.", "_on.")).unbind("mouseenter").unbind("mouseleave")
		});
		topNav.click(function(){
			nav.each(function(){
				$(this).attr("src", $(this).attr("src").replace("_on.", "_off."));
			}).rollOver();
				nav.eq(0).attr("src", nav.eq(0).attr("src").replace("_off.", "_on.")).unbind("mouseenter").unbind("mouseleave")
		});

		var hash = location.hash;
		if( $("#localNavi .inner li a[href='"+hash+"']").length > 0  ) {
			$("#localNavi .inner li a[href='"+hash+"']").filter("[href='"+hash+"']").find("img").trigger("click");
		} else {
				nav.eq(0).attr("src", nav.eq(0).attr("src").replace("_off.", "_on.")).unbind("mouseenter").unbind("mouseleave");
		}
	}
} );
	
$(document).ready( function() {
	$(".productBox").each( function() {
		$(this).hover( function() {
			$(this).addClass("rov");
		}, function() {
			$(this).removeClass("rov");
		} );
		$(this).click( function() {
			//window.location.href = $(this).find("a").attr("href");
			$(this).find("a").trigger("click");
		} );
	} ).css("cursor", "pointer").find("a").css("text-decoration", "none").click( function(evt) {
		evt.stopPropagation();
	} );
} );

