		function opennews(newid,classid)
	{
		window.open("newsinfo.asp?id="+newid+"&cid="+classid,"","height=420,width=750,left=190,top=10,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
	}

	function openleaveword(id) 
	{ 
		window.open("leaveword.asp?product_id="+id,"","height=280,width=430,left=190,top=100,resizable=yes,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
	} 


	function openbasket(id) 
	{ 
		if (id==-1)
			window.open("basket.asp?action=basket","","height=420,width=750,left=190,top=10,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
		else
			window.open("basket.asp?action=buy&product_id="+id,"","height=420,width=750,left=190,top=10,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
	} 
function ShowWindow(title, what)
{
	var thumb = document.getElementById("thumb");
	if(thumb)
	{
		thumb.style.left = document.body.clientWidth/2 - 200;
		thumb.style.top = document.body.clientHeight/2 - 150;
		thumb.style.visibility = "visible";
		thumb.innerHTML='<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="400"><tr><td width="400" height="45" background="i/smallwindow_top.png"><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="100%"><tr><td width="400" height="10" colspan="3"></td></tr><tr><td width="110" height="25"></td><td width="170" height="25" align="center"><p class="title">'+title+'</p></td><td width="120" height="25"></td></tr><tr><td width="400" height="10" colspan="3"></td></tr></table></td></tr><tr><td width="400" background="i/smallwindow_body.png"><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><tr><td width="100%"><p class="news">' + what + '</p></td></tr><tr><td width="100%" align="center"><a href="#"><img border="0" src="i/b_ok.gif" onclick="javascript:HideWindow()"></a></td></tr></table></td></tr><tr><td width="40" height="20" background="i/smallwindow_bottom.png"></td></tr></table>';
	}
}

function restoreimg() {
/*这里要改
多少项就改成多少
for(var i=0;i<10;i++) {


*/

	for(var i=0;i<6;i++) {
		document.all('Image' + i).src = redArray[i];
	}
}


var flag=false;
function DrawImage(ImgD, num){
	var image=new Image();	
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width/image.height>= 1){
			if(image.width>num){ 
				ImgD.width=num;
				ImgD.height=(image.height*num)/image.width;
			}
			else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}
		else{
			if(image.height>num){ 
				ImgD.height=num;
				ImgD.width=(image.width*num)/image.height; 
			}
			else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}
	}
} 
function showsub(btnid,tabid,tabnumber)//点击按钮ID，舌签区ID，舌签数量
{
	for (i = 0;i<tabnumber;i++)
	{
		document.getElementById("tab"+tabid+"_btn"+i).className = "tabbtn01";
		document.getElementById("tab"+tabid+"_subdiv"+i).style.display = "none";
	}
	document.getElementById("tab"+tabid+"_btn"+btnid).className = "tabbtn02";
	document.getElementById("tab"+tabid+"_subdiv"+btnid).style.display = "";
}
function showsub1(btnid,tabid,tabnumber)//点击按钮ID，舌签区ID，舌签数量
{
	for (i = 0;i<tabnumber;i++)
	{
		document.getElementById("tab0"+tabid+"_btn"+i).className = "tabbtn01";
		document.getElementById("tab0"+tabid+"_subdiv"+i).style.display = "none";
	}
	document.getElementById("tab0"+tabid+"_btn"+btnid).className = "tabbtn02";
	document.getElementById("tab0"+tabid+"_subdiv"+btnid).style.display = "";
}
function showhot(btnid,tabid,tabnumber)//点击按钮ID，舌签区ID，舌签数量
{
	for (i = 0;i<tabnumber;i++)
	{
		document.getElementById("hot"+tabid+"_btn"+i).className = "hot01";
		document.getElementById("hot"+tabid+"_subdiv"+i).style.display = "none";
	}
	document.getElementById("hot"+tabid+"_btn"+btnid).className = "hot02";
	document.getElementById("hot"+tabid+"_subdiv"+btnid).style.display = "";
}
function showhot1(btnid,tabid,tabnumber)//点击按钮ID，舌签区ID，舌签数量
{
	for (i = 0;i<tabnumber;i++)
	{
		document.getElementById("hot0"+tabid+"_btn"+i).className = "hot03";
		document.getElementById("hot0"+tabid+"_subdiv"+i).style.display = "none";
	}
	document.getElementById("hot0"+tabid+"_btn"+btnid).className = "hot04";
	document.getElementById("hot0"+tabid+"_subdiv"+btnid).style.display = "";
}
function showdetail(bid,tid,tnumber)//点击按钮ID，舌签区ID，舌签数量
{
	for (i = 0;i<tnumber;i++)
	{
		document.getElementById("t"+tid+"_b"+i).className = "tbtn01";
		document.getElementById("t"+tid+"_sdiv"+i).style.display = "none";
	}
	document.getElementById("t"+tid+"_b"+bid).className = "tbtn02";
	document.getElementById("t"+tid+"_sdiv"+bid).style.display = "";
}
