function writitg(text,id){
for(i=1;i<=5;i++){
	tagid="rImage"+i;
	if(i % 2 == 1){
		document.getElementById(tagid).src="images/empty_star1.gif";
	}
	else{
		document.getElementById(tagid).src="images/empty_star1.gif";
	}
}
cnt=text;
for(i=1;i<=cnt;i++){
	tagid="rImage"+i;
	modi = i%2;
	if(modi == 0){
		document.getElementById(tagid).src="images/fill_star1.gif";
	}
	else{
		document.getElementById(tagid).src="images/fill_star1.gif";
	}
}
	disptext = text + " Star";
	if (document.getElementById)
	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = disptext;
	}
	else if (document.all)
	{
		x = document.all[id];
		x.innerHTML = disptext;
	}
	else if (document.layers)
	{
		x = document.layers[id];
		text2 = '<P CLASS="ntdBL">' + disptext + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
}

function clearrating1(){
	for(i=1;i<=5;i++){
		tagid="rImage"+i;
		if(i % 2 == 1){
			document.getElementById(tagid).src="images/empty_star1.gif";
		}
		else{
			document.getElementById(tagid).src="images/empty_star1.gif";
		}
	}
	disptext = "";
	id="test"
	if (document.getElementById)
	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = disptext;
	}
	else if (document.all)
	{
		x = document.all[id];
		x.innerHTML = disptext;
	}
	else if (document.layers)
	{
		
		x = document.layers[id];
		text2 = '<P CLASS="ntdBL">' + disptext + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
}

function drawrating(x,y){
	prnt = "<ul>";
	for(i=1;i<=x;i++){
		prnt += "<li style=\"margin-left:5px;\"><img src=\"/images/fill_star1.gif\" space=0 vspace=0 border=0></li>";
	}
	if(y > 0){
		prnt += "<li style=\"margin-left:5px;\"><img src=\"/images/video_halfstar.jpg\" hspace=0 vspace=0 border=0></li>";
	}
	else{
		y = 0;
	}
	prnt +=	"<li style=\"margin-left:25px;margin-top:5px;\" class=ntdBL>" + x + "." + y +" Stars</li>";
	document.getElementById("DynUsrRating").innerHTML = prnt;
	prnt += "</ul>";
}

function test(a,b,c,d,e,f)
{

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="insertcomment.php";
url=url+"?co="+a;
url=url+"&na="+b;
url=url+"&em="+c;
url=url+"&cn="+d;
url=url+"&id="+e;
url=url+"&flag="+f;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("POST",url,true);
xmlHttp.send(null);
}
function stateChanged(){ 
 
	if (xmlHttp.readyState==4){
	 
	document.getElementById("commentdiv").innerHTML=xmlHttp.responseText;
	document.registration.reset();
		}
}

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;
}	




