var timehandle;
function showPrompt_div(obj,srcPic)
{
	pic=srcPic;
	ob=obj;
	x=ob.getBoundingClientRect().right-20;
	y=document.body.scrollTop+event.clientY;
	timehandle=setTimeout('playPrompt_div(pic,x,y)',800); 
}
function playPrompt_div(srcPic, x,y)
{
	document.all.prompt_div.style.pixelLeft=x;
	document.all.prompt_div.style.pixelTop=y;
	document.getElementById('lgPic').innerHTML="<img src='"+srcPic+"'>";
	document.all.prompt_div.style.display='block';
	clearTimeout(timehandle);
}
function hidePrompt_div()
{
	clearTimeout(timehandle);
	document.all.prompt_div.style.display='none';
}
function checkKey()
{
	obj=document.getElementById("search_keyword");
	trimspace(obj);
	if(obj.value=="")
	{
		alert("搜索词不能为空!");
		return false;
	}
	return true;
}
function trimspace(obj)
{
	String.prototype.Trim = function()
	{
		return this.replace(/(^\s*)|(\s*$)/g, "");
	}			
	obj.value = obj.value.Trim();
}
function addCart(pid)
{
	var v=product.AddToCart(pid);
	alert(pid+"：加入购物车成功,共有"+v.value+"个商品。要修改数量，请到购物车。");
}
/*
function showMenu( id)
{
 obj=document.getElementById(id);
 if(obj.style.display=='none')
 {
  obj.style.display='block';
 }
 else
 {
   obj.style.display='none';
 } 
}*/
function showMenu(MenuID)
{
	obj=document.getElementById(MenuID);
	if(obj.style.display=="none") 
	{ 
	  obj.style.display="";
	  
	} 
	else 
	{ 
	  obj.style.display="none";
	}
}
