function showComment()
{

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  document.getElementById("comment").innerHTML="Your browser does not support AJAX!";
	  return;
	  } 


	var url="/services/getfile_data.php?url=http://review.topdownloads.net/include.php?c5t="+c5t+"%26c5t_ssi_redirect="+itemUrl;
	//var url="../services/getfile_data.php?url=http://review.topdownloads.net/include.php?c5t_ssi_redirect=<?php print $tmp;?>";
	getHTTPData(url);

} 
function getHTTPData(url){
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader ("Pragma","no-cache");
	xmlHttp.setRequestHeader( "Cache-control","no-cache");
	xmlHttp.send(null);

}
function postHTTPData(url,data){
	
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open('POST', url, true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", data.length);
	xmlHttp.send(data);



}

function showPages(commentForm){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  document.getElementById("comment").innerHTML="Your browser does not support AJAX!";
	  return;
	  } 

	
	var url='/services/getfile_data.php?url=http://review.topdownloads.net/include.php?c5t='+ commentForm.c5t.value +'%26page='+commentForm.page.value + '%26c5t_ssi_redirect='+itemUrl;
	getHTTPData(url);
	var myPage = location.href.replace( /(.*)#.*/, "$1"); 
	location.href = myPage +'#c5t_form'; 


	return false;


}
function postComment(commentForm){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  document.getElementById("comment").innerHTML="Your browser does not support AJAX!";
	  return;
	  } 
	  var poststr = "page=" + encodeURI(commentForm.page.value) + "&name=" + encodeURI(commentForm.name.value) 
					+ "&email=" + encodeURI(commentForm.email.value) + "&title=" + encodeURI(commentForm.title.value)
					+ "&seskey=" + encodeURI(commentForm.seskey.value) + "&phrase=" + encodeURI(commentForm.phrase.value)
					+ "&save=" + encodeURI(commentForm.save.value) + "&comment=" + encodeURI(commentForm.comment.value) ;

	var url = '/services/postfile_data.php?url=/include.php?c5t='+ commentForm.c5t.value;
	postHTTPData(url,poststr);
	var myPage = location.href.replace( /(.*)#.*/, "$1"); 
	location.href = myPage +'#c5t_form'; 
	return false;
}

function stateChanged() 
{ 
	
	  var pData='<br><br><center><table border="1" width="200" height="20" bordercolor="#000000" style="border-collapse: collapse" cellpadding="0" cellspacing="0"><tr><td> <div style= "background-color:#00FF00; width:';
	  var pData1= 'px; height:19">&nbsp;</div></td></tr></table><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Loading Comment...</p></center>';	
  
	  if (xmlHttp.readyState == 0)
	  {
		document.getElementById("comment").innerHTML = pData + '50' + pData1 ;

	  }
	  else if(xmlHttp.readyState == 1)
	  {
		document.getElementById("comment").innerHTML = pData + '100' + pData1;
	  }
	  else if(xmlHttp.readyState == 2)
	  {
		document.getElementById("comment").innerHTML = pData + '150' + pData1;
	  }
	  else if(xmlHttp.readyState == 3)
	  {
		document.getElementById("comment").innerHTML = pData + '200' + pData1;
	  }
	  else if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	  { 
		  document.getElementById("comment").innerHTML=xmlHttp.responseText 
	  } 
	
	
	
	

}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


