// JavaScript Document

function lsSetShowTypeCookie(event){
	jQuery.cookie("qsShowType", event.data.value, { expires: 90, path: '/' });
		
	var path = window.location.pathname;
	var mode = path.match(/item.*\//);
	if(path.match(/[0-9-]*.html/)){
		var paramstr = path.match(/[0-9-]*.html/);
		paramstr = paramstr.toString().replace(".html", "");
		var params = paramstr.split("-");
		if(params.length>=5){
			params[4] = 0;
		}
		window.location.href="/"+mode+params.join("-")+".html"+window.location.search;
	}else{
		window.location.reload();
	}
	return false;
}

jQuery(document).ready(function(){
	
	/*
	if(window.location.pathname == "/"
	   	|| window.location.pathname == "/index.html"){
		jQuery("#Navi-tub #tub01 a").addClass("act");
	}else if(window.location.pathname == "/index_1.html"){
		jQuery("#Navi-tub #tub02 a").addClass("act");
	}else if(window.location.pathname == "/index_2.html"){
		jQuery("#Navi-tub #tub03 a").addClass("act");
	}
	*/
	
	
	/*
	var selectedType = (jQuery.cookie("fhShowType"))?jQuery.cookie("fhShowType"):0;
	
	if(window.location.pathname == "/"
	   	|| window.location.pathname == "/index.html"
		|| window.location.pathname == "/index_1.html"
		|| window.location.pathname == "/index_2.html"){
		jQuery("#Navi-tub #tub0" + (parseInt(selectedType)+1) + " a").css({ backgroundPosition : "0 -58px" });
	}else{
		jQuery("#Navi-tub #tub0" + (parseInt(selectedType)+1) + " a").css({ backgroundPosition : "0 0" });
	}
	*/
	
	if(typeof qsUserIsLogined != "undefined" && qsUserIsLogined == true){
		jQuery("#loginBt").html('<a href="/member/index.html?do=bye">ログアウト</a>');
		jQuery("#loginBt a").css({ background:"url(../commonImg/logoutTopBt.jpg) no-repeat"});
		jQuery("#loginBt a").hover(function(){$(this).css({backgroundPosition:"0 -33px"})},function(){$(this).css({backgroundPosition:"0 0px"})
})
		jQuery("#newMemberBt").html('<a href="/mypage/index.html">マイページへ</a>');
		jQuery("#newMemberBt a").css({ background:"url(../commonImg/myPageBt.jpg) no-repeat"});
		jQuery("#newMemberBt a").hover(function(){$(this).css({backgroundPosition:"0 -33px"})},function(){$(this).css({backgroundPosition:"0 0px"})
})
	}
});

