$(document).ready(function(){
	
 
	
	
	 $.listen('click','a.playlist',function(event) 
	 { 
		 var param = $(this).attr("rel");
		 //alert(param);
		 var object = $(this).parent();
		 var newlistName = $(this).parent().find("#listName").val();
          if(!newlistName) newlistName = "Undefined";
		 $.ajax({
	        type: "POST",
	        url: "/modules/mp3/ajax.php", 
	        data:"param="+param+"&newlistName="+newlistName.replace("&", " and "),
	        beforeSend: function()
	         { 
			  object.html("<b>processing..</b>");
             },   
	         success: function(msg)
	         {  
            	 object.html(msg); 
	         }    
	                   
	      }); 
	 });
	 
		
	 $.listen('click','a.addSong',function(event) 
	 { 
		 var param = $(this).attr("rel");
		 //alert(param);
		 var object = $(this).parent();
		 var newlistName = $(this).parent().find("#listName").val();
          if(!newlistName) newlistName = "Undefined";
		 $.ajax({
	        type: "POST",
	        url: "/modules/mp3/ajax.php?c=addSong", 
	        data:"listID="+param+"&mp3ID="+$("#mp3IDa").val(),
	        beforeSend: function()
	         { 
			  object.html("<b>processing..</b>");
             },   
	         success: function(msg)
	         {  
            	 object.html(msg); 
	         }    
	                   
	      }); 
	 });
	 
 
	 

	
});
