
          preload_full = new Image();
	  preload_full.src = "./images/icons/video_rating_full.gif";
	  preload_partial = new Image();
	  preload_partial.src = "./images/icons/video_rating_part.gif";
	  preload_empty = new Image();
	  preload_empty.src = "./images/icons/video_rating_none.gif";
	  
	var songid_display=new Array();
	var i=0;
        function openwindow_onesong(songid)
        {
          window.open("play.php?music_id="+songid,"mywindow","menubar=0,resizable=0,width=700,height=400");
	}
	function openwindow_playlist(user_id)
	{
	  window.open("play.php?task=featured&user_id="+user_id,"mywindow","menubar=0,resizable=0,width=700,height=400");
	}
	
	
	function playlistadd(rating) {
		    
	    var request = new Request.JSON({
	      'url' : 'browse_music.php',
	      'method' : 'post',
	      'secure' : false,
	      'data' : {
	        'task'  : 'rate_do',
	        'rating' : rating
	      },
	      'onComplete' : function(responseObject, responseText)
	      {
	        playlistadd_result(responseObject);
	      }
	    });
	    request.send();
	  }
        function playlistadd_result(rating) {
	    $('txtHint').innerHTML = rating.playlistadd_total;
	     $('edit').style.display="block";
	    $('blink_background').style.color='#C6DEFF';
	    setTimeout("setblinkFont()",500)

       	 }
        function setblinkFont(){
            $('blink_background').style.color='';
            }
        function ratethesong(songid){
           
           if($('ratethesong_'+songid).style.display=="block")
	      $('ratethesong_'+songid).style.display="none";
	   else{
              $('ratethesong_'+songid).style.display="block";
              songid_display[i++]=songid;
              }
           
           for(i=0;i<songid_display.length;i++){
             if(songid!=songid_display[i]){
             $('ratethesong_'+songid_display[i]).style.display="none";
             
             }
          }
           
          }
          function playlistdelete(songid){
           var request = new Request.JSON({
	   	      'url' : 'browse_music.php',
	   	      'method' : 'post',
	   	      'secure' : false,
	   	      'data' : {
	   	        'task'  : 'delete_song',
	   	        'del_songid' : songid
	   	      },
	   	      'onComplete' : function(responseObject, responseText)
	   	      {
	   	        playlistdelete_result(responseObject);
	   	      }
	   	    });
	   	    request.send();
	  }
          function playlistdelete_result(result){
             
             if($('deletethesong_'+result.delsong_id).style.display=="block"){
	    $('deletethesong_'+result.delsong_id).style.display="none";
	     $('txtHint').innerHTML = result.playlist_total;
	      if(result.playlist_total==0){
	       $('nosongs').style.display="block";
	       }
	     	 $('blink_background').style.color='#C6DEFF';
	         setTimeout("setblinkFont()",500)
	         }
	      if(result.playlist_total=='0')
	      $('edit').style.display="none";
          }
          