var Product_ParentCommentId = -1;
function Product_NewComment(parentid){
	Product_ParentCommentId = parentid;
	document.getElementById("Product_txtCommentTitle").value = "Re: " + Product_Title;
	document.getElementById("Product_txtComment").value = "";
	document.getElementById("Product_NewComment").style.display = "block";
	try{document.getElementById("Product_txtComment").focus();}catch(ex){}
}
function Product_CancelNewComment(){
	document.getElementById("Product_NewComment").style.display = "none";
	document.getElementById("Product_txtCommentTitle").value = "Re: " + Product_Title;
	document.getElementById("Product_txtComment").value = "";
}
function Product_ShowAjaxLoader(bShow){
	if(bShow){
		document.getElementById("ajaxicon").style.display = "block";
	}else{
		document.getElementById("ajaxicon").style.display = "none";
	}
}
function Product_SaveComment(){
	Product_ShowAjaxLoader(true);
	
	var url = "/ecommerce/product/atom/product_cmd.aspx?objectid="+Product_ObjectId+"&productid=" + Product_Id;
	url += "&cmd=341";
	url += "&commentid=-1";
	url += "&parentid=" + Product_ParentCommentId;
	url += "&title=" + document.getElementById("Product_txtCommentTitle").value;
	url += "&comment=" + document.getElementById("Product_txtComment").value;
	url += "&rating=" + document.frmProduct.Product_Rating.value;
	
	Ajax_GetXmlPage(url, Product_SaveComment_Response);
}
function Product_SaveComment_Response(){
	if (!Ajax_XmlHttp_IsReady()){return;}
	//Product_ShowAjaxLoader(false);
	window.location.reload();
}


var CurrentRating = -1;
function ProductSetRating(rating){}//CurrentRating = rating;}
function ProductRating(rating){
	var img;
	for(var i = rating; i > 0; i--){
		img = document.getElementById("ProductRatingStar"+i);
		img.src = "/icon/16/app/shadow/star_yellow.png";
	}
	CurrentRating = rating;
	document.frmProduct.Product_Rating.value = CurrentRating;
}
function ProductRatingOut(rating){
	var img;
	for(var i = rating; i <= 5; i++){
		if(i > CurrentRating){
			img = document.getElementById("ProductRatingStar"+i);
			img.src = "/icon/16/app/shadow/star_grey.png";
		}
	}
}
