function showSKind(k,s)
{
	document.getElementById("skv"+k).style.display=s;
}
function drawKind()
{
	var arr=K.kind_soft[0];
	var str="";
	for(var i=0;i<arr.length;i++)
	{
		str+="<div class='flv0' id='"+arr[i][0]+"' onmouseover=\"showSKind("+arr[i][0]+",'')\" onmouseout=\"showSKind("+arr[i][0]+",'none')\"><div class='flv1'>"+
				arr[i][1]+"</div><div id='skv"+arr[i][0]+"' class='flv5' style='display:none'><div class='flv2'><div class='flv3'></div>"+
				"<div class='flv4'><div class='flv6'>";
		var arr0=K.kind_soft[arr[i][0]];
		if(arr0)
		{
			for(var j=0;j<arr0.length;j++)
			{
				str+="<a href='/product/list?k="+arr0[j][0]+"'>"+arr0[j][1]+"</a>"+arr0[j][2];
			}
		}
		str+="</div></div></div></div></div>";
	}
	document.write(str);
}
function addFav(v)
{
	if(Cookie.get("uid"))
	{
		runJS("/info/fav_add.aspx?f=1&i="+v+"&rnd="+Date.parse(new Date()));
	}
	else
	{
		location.href="/user/login.shtml";
	}
}
function favFinish(v)
{
	switch(v)
	{
		case 0:
			setPop("操作提示","请您先登录！<a href='/login.html'>点此登录</a>");
			break;
		case 1:
			setPop("操作提示","该商品已收藏！<a href='/user/fav'>查看收藏夹</a>");
			break;
		case 2:
			setPop("操作提示","商品信息收藏成功！<a href='/user/fav'>查看收藏夹</a>");
			break;
	}
}
function setPop(s1,s2)
{
	document.getElementById("pop_title").innerHTML=s1;
	document.getElementById("dfrm").innerHTML=s2;
	document.getElementById("miao").innerHTML=5;
	F.pop();
	tid=setTimeout(screenPop,1000)
}
function screenPop()
{
	var s=document.getElementById("miao").innerHTML;
	if(s==0)
	{
		F.unpop();
		clearTimeout(tid);
	}
	else
	{
		document.getElementById("miao").innerHTML=--s;
		tid=setTimeout(screenPop,1000)
	}
}
function cancel(){F.unpop();}
function toCompare(v)
{
	var idstr=Cookie.get("comp"); 
	if(idstr!=null && idstr!="")
	{
		var arr=idstr.split(",");
		var flag=true;
		for(var i=0;i<arr.length;i++)
		{
			if(arr[i]==v) 
			{
				flag=false;
				break;
			}
		}
		if(flag)
		{
			arr[arr.length]=v;
		}
		idstr=arr.toString();
	}
	else
		idstr=v;
	Cookie.set("comp",idstr);
	runJS("/info/product_compsel.aspx?rnd="+Date.parse(new Date()));
}
function setCompare(arr)
{
	var str="";
	if(arr.length==0)
	{
		str="您当前未选择要比较的产品！";
	}
	else
	{
		str="<div id='compp'>";
		for(var i=0;i<arr.length;i++)
		{
			str+="<div class='comps'><div class='comps0'><a href='"+arr[i][1]+"' target='_blank'>"+arr[i][2]+
					"</a></div><div class='comps1'><img src='/img/close3.gif' onclick=\"delCompare("+arr[i][0]+")\" /></div></div>";
		}
		str+="</div><div id='compb'><input type='button' id='compb0' value='' onclick='goCompare()' /></div>";
	}
	document.getElementById("compm").innerHTML=str;
	var o=document.getElementById("compv")
	o.style.top=(document.documentElement.scrollTop+275)+"px";
	o.style.display="";
}
function goCompare()
{
	var idstr=Cookie.get("comp");
	window.open("/product/compare?i="+idstr);
}
function delCompare(v)
{
	var idstr=Cookie.get("comp");
	idstr=idstr.replace(","+v+",",",").replace(","+v,"").replace(v+",","").replace(v,"");
	Cookie.set("comp",idstr);
	runJS("/info/product_compsel.aspx?rnd="+Date.parse(new Date()));
}
function closeCompare()
{
	document.getElementById("compv").style.display="none";
}
function SetScrollComp()
{
	var o=document.getElementById("compv");
	if(o.style.display=="none") return;
	o.style.top=(document.documentElement.scrollTop+275)+"px";
	setTimeout("SetScrollComp()",50); 
}
window.onscroll=function(){SetScrollComp()}
function showZS(v)
{
	for(var i=0;i<2;i++)
	{
		document.getElementById("mrt"+i).className="mrt1";
		document.getElementById("zsv"+i).style.display="none";
	}
	document.getElementById("mrt"+v).className="mrt0";
	document.getElementById("zsv"+v).style.display="";
}

function chkLogin()
{
	if(Cookie.get("uid"))
	{
		document.getElementById("email").value=Cookie.cn("unick");
		document.getElementById("pwd").value="";
		document.getElementById("email").disabled=true;
		document.getElementById("pwd").disabled=true;
	}
}
function Act_Before(o,c,p)
{
	switch(o.id)
	{
		case "zrjInsert":
			break;
		case "fkInsert":
			if(document.getElementById("safecode").value==""){alert("请填写验证码！");return false;}
			if(document.getElementById("safecode").value.length!=5){alert("验证码填写错误！");return false;}
			if(document.getElementById("note_memo").value.length<5){alert("请填写反馈内容！");return false;}
			break;
		case "login":
			if(document.getElementById("email").value==""){alert("请填写登录邮箱！");return false;}
			if(document.getElementById("pwd").value==""){alert("请填写密码！");return false;}
			break;
	}
	return true;
}
function Act_After(o,c,p)
{	switch(o.id)
	{
		case "zrjInsert":
			if(p.success)
			{
				alert("提交成功，稍后会后服务人员与您联系！");
				document.getElementById("softorder_name").value="";
				document.getElementById("softorder_writer").value="";
				document.getElementById("softorder_tel").value="";
				document.getElementById("softorder_email").value="";
				document.getElementById("softorder_corp").value="";
				document.getElementById("softorder_note").value="";
			}
			break;
		case "fkInsert":
			if(p.success)
			{
				alert("提交成功！");
				location.href="/comment?f=3&i="+id;
			}
			else
			{
				reCode(document.getElementById("validpic"));
			}
			break;
		case "login":
			if(p.success)
			{
				document.getElementById("email").value=Cookie.cn("unick");
				document.getElementById("pwd").value="";
				document.getElementById("email").disabled=true;
				document.getElementById("pwd").disabled=true;
			}
			break;
	}
}
function reCode(o){o.src='/tool/getcode1.aspx?rnd='+Date.parse(new Date());}

