﻿function showList(divName)
{
	var detailElement = document.getElementById("productContent");	
	var sellRateElement = document.getElementById("productRelate");	
	var recordElement = document.getElementById("productCommend");	
	var othersElement = document.getElementById("productOther");	
	//var paymentElement = document.getElementById("productPayment");	
	var detailShow = document.getElementById("detail_show");	
	var sellRateShow = document.getElementById("sellRate_show");	
	var recordShow = document.getElementById("record_show");	
	var othersShow = document.getElementById("others_show");	
	
	var sellRateTitle = document.getElementById("productRelateTitle");	
	var recordTitle = document.getElementById("productCommendTitle");	
	var othersTitle = document.getElementById("productOtherTitle");	
	
	if(divName == "detail")
	{
		detailElement.style.display="";
		sellRateElement.style.display="none";
		recordElement.style.display="none";
		othersElement.style.display="none";
		
		detailShow.className = "li_here";
		sellRateShow.className = "";
		recordShow.className = "";
		othersShow.className = "";
		
		sellRateTitle.style.display = "none";
		recordTitle.style.display = "none";
		othersTitle.style.display = "none";
	}
	else if(divName == "sellRate")
	{
		detailElement.style.display="none";
		sellRateElement.style.display="";
		recordElement.style.display="none";
		othersElement.style.display="none";
		
		detailShow.className = "";
		sellRateShow.className = "li_here";
		recordShow.className = "";
		othersShow.className = "";
		
		sellRateTitle.style.display = "none";
		recordTitle.style.display = "none";
		othersTitle.style.display = "none";
	}
	else if(divName == "record")
	{
		detailElement.style.display="none";
		sellRateElement.style.display="none";
		recordElement.style.display="";
		othersElement.style.display="none";
		
		detailShow.className = "";
		sellRateShow.className = "";
		recordShow.className = "li_here";
		othersShow.className = "";
		
		sellRateTitle.style.display = "none";
		recordTitle.style.display = "none";
		othersTitle.style.display = "none";
	}
	else if(divName == "others")
	{
		detailElement.style.display="none";
		sellRateElement.style.display="none";
		recordElement.style.display="none";
		othersElement.style.display="";
		
		detailShow.classNameName = "";
		sellRateShow.className = "";
		recordShow.className = "";
		othersShow.className = "li_here";
		
		sellRateTitle.style.display = "none";
		recordTitle.style.display = "none";
		othersTitle.style.display = "none";
	}
	else
	{
		detailElement.style.display="";
		sellRateElement.style.display="";
		recordElement.style.display="";
		othersElement.style.display="";
		
		detailShow.className = "li_here";
		sellRateShow.className = "";
		recordShow.className = "";
		othersShow.className = "";
		
		sellRateTitle.style.display = "";
		recordTitle.style.display = "";
		othersTitle.style.display = "";
	}
}

function AddClothesToCart()
{
	window.location="http://www.xiegoo.com/xg_user_carts_deal.aspx?action=add&count=1&size="+encodeURI(document.productDetailForm.cm.value)+"&color="+encodeURI(document.productDetailForm.ys.value)+"&pro_id="+proId;
}
	
function CheckData()
{
	if(document.priceBackForm.price.value == "")
	{
		alert("建议价格必须填写！");
		document.priceBackForm.price.focus();
		return false;
	}
	if(document.priceBackForm.content.value == "")
	{
		alert("建议原因必须填写！");
		document.priceBackForm.content.focus();
		return false;
	}
	return true;
}
function AddComment()
{
	if(commentForm.content.value == "")
	{
		alert("评论内容必须填写!");
		commentForm.content.focus;
		return;
	}
	
	if(commentForm.checkCode.value != numKey)
	{
		alert("验证码错误,请重新输入!");
		return;
	}	
	alert("恭喜您,您的评论已顺利提交,评论回复后您就可以在该页最下方看到.谢谢!");
	window.location = "/xg_clothes_comment_deal.aspx?pro_id="+proId+"&cp_id="+cpId+"&content="+encodeURI(document.commentForm.content.value);
}