 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+"&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(":#:");
		document.getElementById('blockDiv').style.display  = "block";
 		document.getElementById('palylistSong').style.display  = "block";
   		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'){
			
		}
	}
function fnMessage(id){
	//alert(document.getElementById('lang').value)
 	 
	if(document.getElementById("msg"+id))
		document.getElementById("msg"+id).innerHTML="You cannot rate your own song";
		
 
	if(document.getElementById("msg_log"+id)){
		document.getElementById("msg_log"+id).innerHTML="Login 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="";
}
