var globVal=0;	
function fun(s)
{
	globVal=0;
	//alert(s);
	for (var i=1;i<=s;i++)
	{		
		document.postrating["img"+i].src="images/star_full.gif";
		/*if(s==1)
			document.getElementById("status").innerHTML ="Poor";
		else if(s==2)
			document.getElementById("status").innerHTML = "Not Bad";
		else if(s==3)
			document.getElementById("status").innerHTML = "Good";
		else if(s==4)
			document.getElementById("status").innerHTML = "Great";
		else if(s==5)
			document.getElementById("status").innerHTML = "Awesome";*/					
	}	
}
/*function fun1(s)
{
	if(globVal==0)
	{
		for (var i=1;i<=5;i++)
		{
			document.biding["img"+i].src="images/star_empty.gif";
			document.getElementById("status").innerHTML = "";
		}	
	}
}*/
function fun1(rate)
{
	if(rate <= 0) 
	{
		document.getElementById("star_one").src = "images/star_empty.gif";
		document.getElementById("star_two").src = "images/star_empty.gif";
		document.getElementById("star_three").src = "images/star_empty.gif";
		document.getElementById("star_four").src = "images/star_empty.gif";
		document.getElementById("star_five").src = "images/star_empty.gif";
		document.getElementById("status").innerHTML = "&nbsp;";
	}
	else if(rate > 0 && rate <= 1) 
	{
		alert(ashok);
		document.getElementById("star_one").src = "images/star_full.gif";
		document.getElementById("star_two").src = "images/star_empty.gif";
		document.getElementById("star_three").src = "images/star_empty.gif";
		document.getElementById("star_four").src = "images/star_empty.gif";
		document.getElementById("star_five").src = "images/star_empty.gif";
		document.getElementById("status").innerHTML = "&nbsp;";
	}
	else if(rate > 1 && rate <= 2) 
	{
		document.getElementById("star_one").src = "images/star_full.gif";
		document.getElementById("star_two").src = "images/star_full.gif";
		document.getElementById("star_three").src = "images/star_empty.gif";
		document.getElementById("star_four").src = "images/star_empty.gif";
		document.getElementById("star_five").src = "images/star_empty.gif";
		document.getElementById("status").innerHTML = "&nbsp;";
	}
	else if(rate > 2 && rate <= 3) 
	{
		document.getElementById("star_one").src = "images/star_full.gif";
		document.getElementById("star_two").src = "images/star_full.gif";
		document.getElementById("star_three").src = "images/star_full.gif";
		document.getElementById("star_four").src = "images/star_empty.gif";
		document.getElementById("star_five").src = "images/star_empty.gif";
		document.getElementById("status").innerHTML = "&nbsp;";
	}
	else if(rate > 3 && rate <= 4) 
	{
		document.getElementById("star_one").src = "images/star_full.gif";
		document.getElementById("star_two").src = "images/star_full.gif";
		document.getElementById("star_three").src = "images/star_full.gif";
		document.getElementById("star_four").src = "images/star_full.gif";
		document.getElementById("star_five").src = "images/star_empty.gif";
		document.getElementById("status").innerHTML = "&nbsp;";
	}
	else if(rate > 4 && rate <= 5) 
	{
		document.getElementById("star_one").src = "images/star_full.gif";
		document.getElementById("star_two").src = "images/star_full.gif";
		document.getElementById("star_three").src = "images/star_full.gif";
		document.getElementById("star_four").src = "images/star_full.gif";
		document.getElementById("star_five").src = "images/star_full.gif";
		document.getElementById("status").innerHTML = "&nbsp;";
	}
}

function fun2(s,id,catid)
{
	//alert(catid);
	globVal=1;
	for (var i=1;i<=s;i++)
	{
		document.postrating["img"+i].src="images/star_full.gif";
	}	

	var obj = new sendRating(s,id,catid);
}

function sendRating(val,id,catid)
{
	//alert(catid);
	url ='?do=rating&postingid='+id+'&val='+val+'&cat='+catid;
	//alert(url);
	ajax(url, 'starUser1');

}
