﻿jo.load(function(){
	try{
		jo(".Tag_NavList_LI").hover(function(){
			jo(".Tag_NavList_LI").css({"background":"none","color":"#666","cursor":"pointer"}).find("a").css({"color":"#666"});										 
			jo(this).css({"background-color":"#C9140B","cursor":"pointer"}).find("a").css({"color":"#fff"});		   
		},function(){
			jo(this).css({"background":"none","color":"#666","cursor":"pointer"}).find("a").css({"color":"#666"});	
			ShowNav();
		});	
		ShowNav();
		//try{
			jo("#smallPics").find("img").each(function(){
				jo(this).mouseover(function(){
					jo("#MainPic").attr("src",this.src);											
				});										   
			});
		//}catch(ex){}
		jo("#keyword").val("请输入关键字").Switch("请输入关键字");
	}catch(ex){}
	jo(".product_l").hover(function(){
		jo(this).css("background","#dddddd");													
	},function(){
		jo(this).css("background","none");		
	});
//	if(document.getElementById("sidebarlist")){
//		jo("#sidebarlist").first().addClass("sideBody");
//		var sideBar = document.getElementById("sidebarlist");
//		var divTop = document.createElement("li");
//		var divBottom = document.createElement("li");
//		divTop.innerHTML="";
//		divBottom.innerHTML="";
//		jo(divTop).addClass("sideTop");
//		jo(divBottom).addClass("sideBottom");
//		jo("#sidebarlist").first().beforeFirst(divTop);
//		jo("#sidebarlist").first().afterEnd(divBottom);
//	}
});

function togle(id){
	jo(id).togle();
	var id1=id.replace("-","").replace("#","");
	//alert(document.getElementById(id1).style.display);
	if(jo(id).css("display")=="none"){
		jo(id.replace("-","")).html("+");
	}else{
		jo(id.replace("-","")).html("- ");
	}
}
function ShowNav(){
	var hasFindhistory=false;
	var cookies = jo.cookie.GET("CurrentNav");
	if(!cookies){cookies="jo.nav0";}
	jo("#Tag_NavList").find(".Tag_NavList_LI").each(function(i){
		jo(this).attr("id","jo.nav" + i );
		if(cookies==this.id){
			jo(this).css({"background-color":"#C9140B","cursor":"pointer"}).find("a").css({"color":"#fff"});	
			hasFindhistory=true;
		}
		jo(this).click(function(){
			jo.cookie.SET("CurrentNav",this.id,1);	
			window.location = jo(this).find("a").attr("href");	
		});										
	});	
}
var isopen=false;
function openDialog(){
	var dialog = document.createElement("div");
	document.body.appendChild(dialog);
	dialog.id="QYDialog";
	dialog.style.cssText="width:552px; height:412px;position:absolute; top:50%; left:50%; margin-left:-276px;margin-top:" + (-206+window.document.body.scrollTop) + "px; background:url(/template/m1/images/dialog_bg.jpg) -1px 0;background-color:#DDDDDD;z-index:999;";
	var innerHTML = "<div style=\"text-align:right;height:58px; line-height:60px;background:url(/template/m1/images/dialog_logo.jpg) no-repeat -1px -1px\">";
	innerHTML += "<img src=\"/template/m1/images/dialog_close.jpg\" alt=\"关闭快速导航\" style=\"margin:13px 10px 0 0;cursor:pointer\" onclick=\"closeDialog();\" /></div>";
	innerHTML += "<div id=\"dialog_iframe\" style=\"background-color:#F4F4F4;height:343px; width:542px;text-align:left; margin:0px;padding:0px; border-top:5px #C9140B solid;\">";
	//innerHTML += "<iframe id=\"dialog_iframe\" frameborder=\"0\" width=\"542\" height=\"332\" style=\"width:542px;height:332px;\" src=\"p_class.asp?rnd=" + Math.random() + "\"></iframe></div>";
	innerHTML += "</div>";
	dialog.innerHTML=innerHTML;
	ajax({url:"p_class.asp",succeed:function(msg){document.getElementById("dialog_iframe").innerHTML=msg;}});
	Cover.init().show();
	isopen = true;
}

function closeDialog(){
	document.body.removeChild(document.getElementById("QYDialog"));	
	Cover.hide();
	isopen = false;
}
