var xmlHttp;
function rating1(id,img)
{
//alert(str);
//var count=0;
xmlHttp = GetXmlHttpObject();
if (xmlHttp == null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url = "/rating.php";
url = url+"?id="+id;
url = url+"&val="+img;

xmlHttp.onreadystatechange = stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{	
	if (xmlHttp.readyState == 4 )
	{	
		var str = xmlHttp.responseText;
		//alert(str)

		if(str == "Already Rated!") {
		document.getElementById("msgdisply").innerHTML = str		
		} else if(str.charAt(str.length-1)==0) { 
		document.getElementById("txtHin1").innerHTML = "<b>("+str.substring(0,str.length-2)+")</b>";
		} else { 
		document.getElementById("txtHin").innerHTML = "<b>("+str.substring(0,str.length-2)+")</b>";
		}
	}
}




function download(wallid)
{
	
	
//alert(wallid);
xmlHttp = GetXmlHttpObject();
if (xmlHttp == null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url3 = "/rating.php";
url3 = url3+"?wallid="+wallid;

xmlHttp.onreadystatechange = stateChanged3
xmlHttp.open("GET",url3,true)
xmlHttp.send(null)
}

function stateChanged3() 
{	
	if (xmlHttp.readyState == 4 )
	{	
		var str3 = xmlHttp.responseText;
		document.getElementById("download").innerHTML = "<b>Downloads :("+str3+")</b>";
	}
}



function comment1(inp,str)
{	
var count=0;

var str = document.rating.comment.value;
		var str1= str.search(/href/);
		var str2= str.search(/<a/);
		var str3= str.search(/www/);
		
		if (document.rating.comment.value =='') 
			{
				alert("Please Enter Your Comments...");	
				document.rating.comment.focus();
				return false; 
			}
		else if (str.length >200) 
			{
				alert("Please enter upto 200 characters only...");	
				document.rating.comment.focus();
				return false; 
			}	
			
		else if (str1 >=0 || str2 >=0 || str3 >=0) 
			{
				alert("Please avoid any type of LINKs...");
				document.rating.comment.focus();
				return false; 
			}			

//alert(inp);
//alert(str);
xmlHttp = GetXmlHttpObject()
if (xmlHttp == null)
{
alert ("Browser does not support HTTP Request")
return;
} 
var url2 = "/rating.php?comid="+inp+"&comvalue="+str;
/*alert(inp);
alert(inp2);*/

xmlHttp.onreadystatechange = stateChanged2
xmlHttp.open("GET",url2,true)
xmlHttp.send(null)
}


function stateChanged2() 
{  
if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
{	
document.getElementById("txtHint2").innerHTML = xmlHttp.responseText;

//document.getElementById("txtHint0").innerHTML = xmlHttp.responseText;
//alert(document.getElementById("txtHint0").innerHTML);
//alert(xmlHttp.responseText);
document.getElementById("pixcomment").value="Enter your Comments here..."; 
}
}


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;
}