function AddCats(Site,ProductID,lb)
{
    var tnum = document.getElementById("buynum").value;
    var prodid = document.getElementById("prodid").innerHTML;
    var isgz = document.getElementById("isgz").innerHTML;
    var tempid =  document.getElementById("tempid").innerHTML;
    
   
    if(prodid!="")
    {
       ProductID = prodid;
    }
    else
    {
        if(isgz=="1")
		{
		  alert("请选择商品颜色");
		  return false;
		}
		if(isgz=="2")
		{
		  alert("请选择商品尺码");
		  return false;
		}
		if(isgz=="3")
		{
		  if(tempid == "")
		  {
			alert("请选择商品尺码");
			return false;
		  }
		  else
		  {
		    alert("请选择商品颜色");
		  return false;
		  }
		}
      
    }
	var Url="/Shopping/AddtoShoppingCat.aspx?Site="+Site+"&ProductID="+ProductID+"&lb="+lb+"&tgnum="+tnum;
	setCookieaaa("ShoppingRUrl",top.location.href,1);
	top.location.href=Url;

}

function GoToInfo(Site,ProductID,lb)
{

   	var Url="/Product/ProductInfo_"+Site+"_"+ProductID+".html";
	top.location.href=Url;
}


function setCookieaaa(cookieName,cookieValue,DayValue)
{
	var expire = "";
	var day_value=1;
	if(DayValue!=null)
	{
		day_value=DayValue;
	}
    expire = new Date((new Date()).getTime() + day_value * 86400000);
    expire = "; expires=" + expire.toGMTString();
	document.cookie = cookieName + "=" + escape(cookieValue) +";path=/"+ expire;
}



function AddFavorite(Site,ProductID)
{
	setCookieaaa("ShoppingRUrl",top.location.href,1);
    location.href="/Shopping/AddtoFavorite.aspx?Site="+Site+"&ProductID="+ProductID;
}

