<!--
// Written by Dexter Zafra at www.ex-designz.net
//Handle Check Username Availability Using Ajax
 
function ShowRankcommentvote(){	

	if (xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200){	
		//alert(xmlHttp.status);
			ResetRankcommentvote(xmlHttp.responseText);
			}		
	}
}

function ResetRankcommentvote(rankText){
	var rankScore = rankText;
	//alert(rankScore);
	if (rankScore!="0"){
		mystr=rankScore.split("[content]"); 
	var commentID = mystr[0];
	var commentcontent = window.document.getElementById("comment_Content_"+commentID);
	commentcontent.innerHTML =mystr[1];	
	var commentdate = window.document.getElementById("comment_date_"+commentID);
	commentdate.innerHTML =mystr[2];
	//alert(mystr[1]);
	}
	
} 
function ShowRankallcomment(){	

	if (xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200){	
		//alert(xmlHttp.status);
			ResetRankallcomment(xmlHttp.responseText);
			}		
	}
}

function ResetRankallcomment(rankText){
	var rankScore = rankText;
	
	if (rankScore!="0"){
		mystr=rankScore.split("[content]"); 
		a=0
		
	for(i=0;i<parseInt(mystr.length/3);i++){
		
	var commentID = mystr[a];
	var commentcontent = window.document.getElementById("comment_Content_"+commentID);
	commentcontent.innerHTML =mystr[a+1];	
	var commentdate = window.document.getElementById("comment_date_"+commentID);
	commentdate.innerHTML =mystr[a+2];	
	a=a+3
	
	}
	//alert(mystr[0]);
	}
	
} 
function ShowRankmorecomment(){	

	if (xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200){	
		//alert(xmlHttp.status);
			ResetRankmorecomment(xmlHttp.responseText);
			}		
	}
}

function ResetRankmorecomment(rankText){
	var rankScore = rankText;
	//alert(rankScore)
	if (rankScore!="0"){
	var morecomment = window.document.getElementById("more_comment");
	morecomment.innerHTML =rankScore;	
	}	
	
} 
function ShowRankordercomment(){	

	if (xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200){			
			ResetRankordercomment(xmlHttp.responseText);
			}		
	}
}

function ResetRankordercomment(rankText){
	var rankScore = rankText;
	//alert(rankScore)
	if (rankScore!="0"){
	var New_Comment = window.document.getElementById("NewComment");
	New_Comment.innerHTML ="";
	var list_comment = window.document.getElementById("listcomment");
	list_comment.innerHTML =rankScore;	
	}	
	
} 
function votecomment(id,type)
{
	var commentlike = window.document.getElementById("commentlike_"+id);	
	var totallikes = window.document.getElementById("totallike_"+id).value;
	if (type==0){
	totallikes=parseInt(totallikes)+1;
	}else{
	totallikes=parseInt(totallikes)-1;}
	if (totallikes>=-3)
	{window.document.getElementById("css_comment_"+id).className="article_comment_cell_good";}
	else
	{window.document.getElementById("css_comment_"+id).className="article_comment_cell_bad  lightgray";}
	//alert('###########');
	if (totallikes==0){
	commentlike.innerHTML ="<div class=\"article_comment_like_info\"></div><br style=\"clear:both\" />";
	}else{
	commentlike.innerHTML ="<div class=\"article_comment_like_info\">"+totallikes+" likes</div><br style=\"clear:both\" />";
	}
var url = "/includes/votecomment.asp?id="+id+"&type="+type;
	xmlHttp =createRequestObject();
	xmlHttp.open("GET", url, true);	
	xmlHttp.onreadystatechange = ShowRankcommentvote;				
	xmlHttp.send(null);	
}
function showcontent(id){
	
		var url = "/includes/showcomment.asp?id="+id;
		xmlHttp =createRequestObject();
		xmlHttp.open("GET", url, true);	
		xmlHttp.onreadystatechange = ShowRankcommentvote;				
		xmlHttp.send(null);	
}
function showallcontent(id,stu){
		openmore(id,stu)
		 window.setTimeout("expendcontent("+id+","+stu+");", 300); 		
}
function expendcontent(id,stu){
		var totallikes = window.document.getElementById("order_comment").value;	
		var url = "/includes/showallcomment.asp?id="+id+"&type="+stu+"&value="+totallikes;
		xmlHttp =createRequestObject();
		xmlHttp.open("GET", url, true);	
		xmlHttp.onreadystatechange = ShowRankallcomment;				
		xmlHttp.send(null);		
}
function openmore(id,stu)
{
	var totallikes = window.document.getElementById("order_comment").value;		
		var url = "/includes/showmorecomment.asp?id="+id+"&type="+stu+"&value="+totallikes;		
		xmlHttp =createRequestObject();
		xmlHttp.open("GET", url, true);	
		xmlHttp.onreadystatechange = ShowRankmorecomment;				
		xmlHttp.send(null);		
}
function ordercomment(id,stu)
{		
		var totallikes = window.document.getElementById("order_comment").value;		
		var url = "/includes/showordercomment.asp?id="+id+"&type="+stu+"&value="+totallikes;
		xmlHttp =createRequestObject();
		xmlHttp.open("GET", url, true);	
		xmlHttp.onreadystatechange = ShowRankordercomment;				
		xmlHttp.send(null);		
}