 function starOver(ratingVal,imgSrc){
 		if(ratingVal==1)
		 document.getElementById('star1'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
		else if(ratingVal==2){
			document.getElementById('star1'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
		    document.getElementById('star2'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
		}
		else if(ratingVal==3){
			document.getElementById('star1'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
		    document.getElementById('star2'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
			document.getElementById('star3'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
		}
		else if(ratingVal==4){
			document.getElementById('star1'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
		    document.getElementById('star2'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
			document.getElementById('star3'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
			document.getElementById('star4'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
		}
		else if(ratingVal==5){
			document.getElementById('star1'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
		    document.getElementById('star2'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
			document.getElementById('star3'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
			document.getElementById('star4'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
			document.getElementById('star5'+imgSrc).src="Common/Images/Publicimages/5stars.gif";
		}
	 }
	 function starOut(ratingVal,imgSrc){
		 if(ratingVal==1)
		 document.getElementById('star1'+imgSrc).src="Common/Images/Publicimages/stars.gif";
		 else if(ratingVal==2){
			document.getElementById('star1'+imgSrc).src="Common/Images/Publicimages/stars.gif";
		    document.getElementById('star2'+imgSrc).src="Common/Images/Publicimages/stars.gif";
		}
		else if(ratingVal==3){
			document.getElementById('star1'+imgSrc).src="Common/Images/Publicimages/stars.gif";
		    document.getElementById('star2'+imgSrc).src="Common/Images/Publicimages/stars.gif";
			document.getElementById('star3'+imgSrc).src="Common/Images/Publicimages/stars.gif";
		}
		else if(ratingVal==4){
			document.getElementById('star1'+imgSrc).src="Common/Images/Publicimages/stars.gif";
		    document.getElementById('star2'+imgSrc).src="Common/Images/Publicimages/stars.gif";
			document.getElementById('star3'+imgSrc).src="Common/Images/Publicimages/stars.gif";
			document.getElementById('star4'+imgSrc).src="Common/Images/Publicimages/stars.gif";
		}
		else if(ratingVal==5){
			document.getElementById('star1'+imgSrc).src="Common/Images/Publicimages/stars.gif";
		    document.getElementById('star2'+imgSrc).src="Common/Images/Publicimages/stars.gif";
			document.getElementById('star3'+imgSrc).src="Common/Images/Publicimages/stars.gif";
			document.getElementById('star4'+imgSrc).src="Common/Images/Publicimages/stars.gif";
			document.getElementById('star5'+imgSrc).src="Common/Images/Publicimages/stars.gif";
		}
	 }

	function starVal(ratingVal,id)
	{   
		var id = id;
		var user_id = document.getElementById("user_id").value;
		var actionType = document.getElementById("actionType").value;
		var lang = document.getElementById("lang").value;
 		var ratingVal=ratingVal;
 		var url = 'rate.php';
		var rand   = Math.random(9999);
		var pars   = "id="+id+"&ratingVal="+ratingVal+"&user_id="+user_id+"&action="+actionType+"&lang="+lang+"&rand="+rand;
		
   		var myAjax = new Ajax.Request( url, {method: 'post', parameters: pars, onComplete: showResponseAddRequestRecipe} );
	}
	function showResponseAddRequestRecipe(originalRequest){
 		var newData = originalRequest.responseText;
		//alert(newData);
   		var val  = newData.split(":#:");			
    		if(val[0]=='1'){
 			document.getElementById("rate"+val[1]).innerHTML="<img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'>";
			document.getElementById("rate"+val[1]).style.cursor="default";
		}else if(val[0]=='2'){
			document.getElementById("rate"+val[1]).innerHTML="<img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'><img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'>";
            document.getElementById("rate"+val[1]).style.cursor="default";  	
		}else if(val[0]=='3'){
			document.getElementById("rate"+val[1]).innerHTML="<img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'><img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'><img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'>";
			document.getElementById("rate"+val[1]).style.cursor="default";
		}else if(val[0]=='4'){
			document.getElementById("rate"+val[1]).innerHTML="<img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'><img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'><img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'><img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'>";
			document.getElementById("rate"+val[1]).style.cursor="default";
		}else if(val[0]=='5'){
			document.getElementById("rate"+val[1]).innerHTML="<img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'><img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'><img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'><img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'><img src='Common/Images/Publicimages/5stars.gif' border='0' style='cursor:default'>";
            document.getElementById("rate"+val[1]).style.cursor="default";
		}else if(val[0]=='0'){
			if(val[2]=='R'){
 				document.getElementById("rate"+val[1]).innerHTML="Your Recipe cannot be rated";
			}else if(val[2]=='V'){
				document.getElementById("rate"+val[1]).innerHTML="Your Video cannot be rated";
			}else{
				document.getElementById("rate"+val[1]).innerHTML="Your Competition Recipe cannot be rated";
			}
		}
	}
function fnMessage(id){
	//alert(document.getElementById('lang').value)
	if(document.getElementById('lang')){
	if(document.getElementById('lang').value == "ar"){
	document.getElementById("msg"+id).innerHTML="&#1575;&#1604;&#1583;&#1582;&#1608;&#1604;&#32;&#1604;&#1604;&#1578;&#1602;&#1610;&#1610;&#1605;&#10;";
	}else{
		if(document.getElementById("msg"+id))
			document.getElementById("msg"+id).innerHTML="Click view to rate";
			
		}
		if(document.getElementById("msg_log"+id)){
			document.getElementById("msg_log"+id).innerHTML="Login view to rate";
		}
	}
	if(document.getElementById('msg_space')){
		document.getElementById('msg_space').style.display="none";
		
	}
	if(document.getElementById('msg_space_log')){
		document.getElementById('msg_space_log').style.display="none";
	}
}
function fnMessageOut(id){
	if(document.getElementById("msg"+id))
		document.getElementById("msg"+id).innerHTML="";
	if(document.getElementById("msg_log"+id))
		document.getElementById("msg_log"+id).innerHTML="";
}