//////////////////////MOVIE SONG PLAY FUNCTION /////////////////////////////
function do_play(songid_list)
{
	param1=songid_list;
	param2="song";
  	var newwin = window.open('/php/play.php?songid_list='+param1,'','width=600,height=500,toolbar=no,resizable=no,scrollbars=yes');
}
//////////////////////MOVIE SONG PLAY FUNCTION ENDS /////////////////////////////
//////////////////////MOVIE SONG PLAYLIST FUNCTION ENDS /////////////////////////////
function do_playlist(param1)
{
	//alert(param1);
	user_val=getCookie('ahtees_userid');
    if(user_val=="")
    {
		do_login();   	

    }
	filename_string="/php/add_to_playlist.php?song_ids="+param1;	
	reswindow_new = window.open(filename_string , 'Playlist', 'width=600px,height=300px,left=400px,top=185px,resize=0,scrolling=0,center=1');
}
//////////////////////MOVIE SONG PLAYLIST FUNCTION ENDS /////////////////////////////
function request_songs(movieid,picturename,usernm,usermail)
{
	param1=movieid;
	param2=picturename;
	param3=usernm;
	param4=usermail;
	//param2="song";
  	var newwin = window.open('/php/request_song.php?movieid='+param1 +'&picturename='+param2+'&usernm='+param3+'&usermail='+param4,'','width=600,height=500,toolbar=no,resizable=no,scrollbars=yes');
}
function request_songs_user(movieid,picturename)
{
	param1=movieid;
	param2=picturename;
	//param3=usernm;
	//param4=usermail;
	//param2="song";
  	var newwin = window.open('/php/request_song_user.php?movieid='+param1 +'&picturename='+param2,'','width=600,height=500,toolbar=no,resizable=no,scrollbars=yes');
}
function send_song_request(movieid,usermail,picturename)
{
	//alert(usermail);
	if(usermail=="0")
	{
		reswindow_new = dhtmlwindow.open('resources1', 'iframe', '/php/request_song_form.php?movieid='+movieid +'&picturename='+picturename, 'Movie Song Request', 'width=480px,height=465px,left=400px,top=185px,resize=0,scrolling=0,center=1');
	}
	else
	{
		Aj = new Ajax.Request('/php/send_song_request_mail.php' ,   
		{     
		method:'post',     
		parameters:'movieid='+movieid+'&usermail='+usermail+'&picturename='+picturename,
		onSuccess: function(transport)
                {       					
					
					if(transport.responseText=="1")
					{
						alert("Your request has been sent");
					}
					else
					{
						alert("There seems some problem to send your request. Please try later."+transport.responseText)
					}
					//$('div_youtube').innerHTML = transport.responseText ;
                },     
	   onFailure: function()
	                    { 
	                     //msg.innerHTML = "Problem in finding the specified file"; 
	                    }
	    });		
	}
  	//var newwin = dhtmlwindow.open('/php/request_song.php?movieid='+param1 +'&picturename='+param2+'&usernm='+param3+'&usermail='+param4,'','width=600,height=500,toolbar=no,resizable=no,scrollbars=yes');
}