function alterplayer(playlisturl,spellchked){var so=new SWFObject("../library/mediaplayer.swf","Altertunes","100%","100%","8","#FFFFFF");so.addParam("quality","high");so.addParam("scale","exactfit");so.addParam("salign","LT");so.addParam("menu","false");so.addParam("wmode","opaque");so.addParam("allowScriptAccess","always");so.addVariable("height","355");so.addVariable("width","265");so.addVariable("volume","100");so.addVariable("enableclip","false");so.addVariable("makemobile","false");so.addVariable("mystyle","whitecolors");so.addVariable("makeresizable","true");so.addVariable("playlist",playlisturl);so.addVariable("enablecallback","true");so.addVariable("callbackadd","http://altertunes.com/ruhnew.php");so.write("mediaplayer");}
function callback(artistname){var xmlhttp=false;var url="http://altertunes.com/populateplaylist.php?artistname="+artistname;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttp=null;}}
if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){xmlhttp=new XMLHttpRequest();}
if(!xmlhttp){alert('Giving up, Cannot create an XMLHTTP instance');return false;}
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState!=4){document.getElementById('loadingmessage').style.display='inline';}
if((xmlhttp.readyState==4)&&(xmlhttp.status==200)){if(xmlhttp.responseText!="Not Found"){var response=xmlhttp.responseText;while(response.indexOf(";")!=-1){var spellchked=response.substring(0,response.indexOf(";"));response=response.substring(response.indexOf(";")+1,response.length);}
if(spellchked!="OK"){document.getElementById('spelling').style.display='inline';document.getElementById('spellingmessage').innerHTML='<font color=#000000>Did you mean :</font><b> '+spellchked+'.</b>';setTimeout("document.getElementById('spelling').style.display='none';",8000);}
document.getElementById('loadingmessage').style.display='none';alterplayer(response,spellchked);}
else{document.getElementById('loadingmessage').style.display='none';document.getElementById('notfound').style.display='inline';setTimeout("document.getElementById('notfound').style.display='none';",8000);}}}
xmlhttp.open('GET',url,true);xmlhttp.send(null);}
function glt(){var localdate=new Date();var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var month=monthname[localdate.getMonth()];var date=localdate.getDate();var fullyear=localdate.getFullYear();if(localdate.getHours()>12){var hour=localdate.getHours()-12;var zone="PM";}
else{var hour=localdate.getHours();var zone="AM";}
var min=localdate.getMinutes();if(min<10){min="0"+min;}
var userlocaltime=month+" "+date+", "+fullyear+" "+hour+":"+min+" "+zone;ul="http://altertunes.com/glt.php?glt="+userlocaltime;var xmlhttpglt=false;try{xmlhttpglt=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttpglt=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttpglt=null;}}
if(!xmlhttpglt&&typeof XMLHttpRequest!="undefined"){xmlhttpglt=new XMLHttpRequest();}
if(!xmlhttpglt){alert('Giving up, Cannot create an XMLHTTP instance');return false;}
xmlhttpglt.onreadystatechange=function(){if(xmlhttpglt.readyState!=4){}
if((xmlhttpglt.readyState==4)&&(xmlhttpglt.status==200)){}}
xmlhttpglt.open('GET',ul,true);xmlhttpglt.send(null);}
function ppBI(pi){var xmlhttpx=false;var url="http://altertunes.com/populateplaylist.php?ppBI="+pi;try{xmlhttpx=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttpx=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttpx=null;}}
if(!xmlhttpx&&typeof XMLHttpRequest!="undefined"){xmlhttpx=new XMLHttpRequest();}
if(!xmlhttpx){alert('Giving up, Cannot create an XMLHTTP instance');return false;}
xmlhttpx.onreadystatechange=function(){if(xmlhttpx.readyState!=4){document.getElementById('loadingmessage').style.display='inline';}
if((xmlhttpx.readyState==4)&&(xmlhttpx.status==200)){document.getElementById('loadingmessage').style.display='none';alterplayer(xmlhttpx.responseText,"undef");}}
xmlhttpx.open('GET',url,true);xmlhttpx.send(null);}
function populatemyplaylist(st,sl,dis,dia,sc){var xmlhttp=false;var url="http://altertunes.com/populateplaylist.php?ppss=t&st="+st+"&sl="+sl+"&dis="+dis+"&dia="+dia+"&sc="+sc;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttp=null;}}
if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){xmlhttp=new XMLHttpRequest();}
if(!xmlhttp){alert('Giving up, Cannot create an XMLHTTP instance');return false;}
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState!=4){document.getElementById('loadingmessage').style.display='inline';}
if((xmlhttp.readyState==4)&&(xmlhttp.status==200)){document.getElementById('loadingmessage').style.display='none';alterplayer(xmlhttp.responseText,"undef");}}
xmlhttp.open('GET',url,true);xmlhttp.send(null);}
function populatefullplaylist(xmlplaylist){var xmlhttp=false;var url="http://altertunes.com/populateplaylist.php?full=t&xmlcontent="+xmlplaylist;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttp=null;}}
if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){xmlhttp=new XMLHttpRequest();}
if(!xmlhttp){alert('Giving up, Cannot create an XMLHTTP instance');return false;}
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState!=4){document.getElementById('loadingmessage').style.display='inline';}
if((xmlhttp.readyState==4)&&(xmlhttp.status==200)){document.getElementById('loadingmessage').style.display='none';alterplayer(xmlhttp.responseText,"undef");}}
xmlhttp.open('GET',url,true);xmlhttp.send(null);}
function addtoplaylist(userplaylistname){var xmlhttpp=null;url="http://altertunes.com/manageuserplaylists.php?addtoplaylist="+userplaylistname;try{xmlhttpp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttpp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttpp=null;}}
if(!xmlhttpp&&typeof XMLHttpRequest!="undefined"){xmlhttpp=new XMLHttpRequest();}
if(!xmlhttpp){alert('Giving up, Cannot create an XMLHTTP instance');return false;}
xmlhttpp.onreadystatechange=function(){if(xmlhttpp.readyState!=4){}
if((xmlhttpp.readyState==4)&&(xmlhttpp.status==200)){setTimeout("document.getElementById('songadded').style.display='none';",5000);}}
xmlhttpp.open('GET',url,true);xmlhttpp.send(null);}
function resettabclasses(){document.getElementById('ProfileTab').className='welcomePageTab';document.getElementById('MessagesTab').className='welcomePageTab';document.getElementById('FriendsTab').className='welcomePageTab';document.getElementById('profilediv').style.display="none";document.getElementById('messagesdiv').style.display="none";document.getElementById('friendsdiv').style.display="none";}
function getprofilefeed(){document.getElementById('profilediv').style.display="inline";}
function getmessagesfeed(nv,un){var xmlhttpxyz=false;var url="http://altertunes.com/getmessagesfeed.php?profilemessage=Y&nv="+nv+"&un="+un;try{xmlhttpxyz=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttpxyz=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttpxyz=null;}}
if(!xmlhttpxyz&&typeof XMLHttpRequest!="undefined"){xmlhttpxyz=new XMLHttpRequest();}
if(!xmlhttpxyz){return false;}
xmlhttpxyz.onreadystatechange=function(){if(xmlhttpxyz.readyState!=4){document.getElementById('loadingmessage').style.display='inline';}
if((xmlhttpxyz.readyState==4)&&(xmlhttpxyz.status==200)){document.getElementById('loadingmessage').style.display='none';document.getElementById('messagesdiv').style.display="inline";document.getElementById('messagesdiv').innerHTML=xmlhttpxyz.responseText;}}
xmlhttpxyz.open('GET',url,true);xmlhttpxyz.send(null);}
function getfriendsfeed(nv,un){var xmlhttpxy=false;var url="http://altertunes.com/getfriendsfeed.php?profilefriend=Y&nv="+nv+"&un="+un;try{xmlhttpxy=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttpxy=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttpxy=null;}}
if(!xmlhttpxy&&typeof XMLHttpRequest!="undefined"){xmlhttpxy=new XMLHttpRequest();}
if(!xmlhttpxy){return false;}
xmlhttpxy.onreadystatechange=function(){if(xmlhttpxy.readyState!=4){document.getElementById('loadingmessage').style.display='inline';}
if((xmlhttpxy.readyState==4)&&(xmlhttpxy.status==200)){document.getElementById('loadingmessage').style.display='none';document.getElementById('friendsdiv').style.display="inline";document.getElementById('friendsdiv').innerHTML=xmlhttpxy.responseText;}}
xmlhttpxy.open('GET',url,true);xmlhttpxy.send(null);}
/*function callback(){var xmlhttp=false;var artistname=document.getElementById('artistname').value;var url="http://altertunes.com/populateplaylist.php?artistname="+artistname;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttp=null;}}
if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){xmlhttp=new XMLHttpRequest();}
if(!xmlhttp){alert('Giving up, Cannot create an XMLHTTP instance');return false;}
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState!=4){document.getElementById('loadingmessage').style.display='inline';}
if((xmlhttp.readyState==4)&&(xmlhttp.status==200)){if(xmlhttp.responseText!="Not Found"){var response=xmlhttp.responseText;if(response.indexOf("MultipleArtists")==-1){while(response.indexOf(";")!=-1){var spellchked=response.substring(0,response.indexOf(";"));response=response.substring(response.indexOf(";")+1,response.length);}
if(spellchked!="OK"){document.getElementById('spelling').style.display='inline';document.getElementById('spellingmessage').innerHTML='<font color=#000000>Did you mean :</font><b> '+spellchked+'</b>';setTimeout("document.getElementById('spelling').style.display='none';",8000);}
if(spellchked!="OK"){universalartist=spellchked;}else{universalartist=document.getElementById('artistname').value;}
document.getElementById('loadingmessage').style.display='none';alterplayer(response,spellchked);}
else{document.getElementById('loadingmessage').style.display='none';var t=response.substring(0,response.indexOf(";"));response=response.substring(response.indexOf(";")+1,response.length);while(response.indexOf(";")!=-1){var t=response.substring(0,response.indexOf(";"));response=response.substring(response.indexOf(";")+1,response.length);var multipleartistconfirmation=confirm("Multiple artists exists matching your query. Did you mean: "+t);if(multipleartistconfirmation==true){document.getElementById('artistname').value=t;callback();response="";}
else{}}}}
else{document.getElementById('loadingmessage').style.display='none';document.getElementById('notfound').style.display='inline';setTimeout("document.getElementById('notfound').style.display='none';",8000);}}}
xmlhttp.open('GET',url,true);xmlhttp.send(null);}*/
function populatesinglesong(dis,dia){var xmlhttpxyzi=false;var url="http://altertunes.com/populateplaylist.php?populatesinglesong=Y&dis="+dis+"&dia="+dia;try{xmlhttpxyzi=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttpxyzi=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttpxyzi=null;}}
if(!xmlhttpxyzi&&typeof XMLHttpRequest!="undefined"){xmlhttpxyzi=new XMLHttpRequest();}
if(!xmlhttpxyzi){alert('Giving up, Cannot create an XMLHTTP instance');return false;}
xmlhttpxyzi.onreadystatechange=function(){if(xmlhttpxyzi.readyState!=4){document.getElementById('loadingmessage').style.display='inline';}
if((xmlhttpxyzi.readyState==4)&&(xmlhttpxyzi.status==200)){document.getElementById('loadingmessage').style.display='none';alterplayer(xmlhttpxyzi.responseText,"undef");}}
xmlhttpxyzi.open('GET',url,true);xmlhttpxyzi.send(null);}
var orgmssgid;var mssgreplytextboxid;var mssgreplyid;var sender;function replytoprofilemessage(senderusername,messageid){orgmssgid=messageid;mssgreplytextboxid=messageid+"_replytextbox";mssgreplyid=messageid+"_reply";sender=senderusername;document.getElementById(messageid).style.display="none";document.getElementById(mssgreplytextboxid).innerHTML="<textarea rows=1 cols=50 id='"+mssgreplyid+"'></textarea><br/>";document.getElementById(mssgreplytextboxid).innerHTML+="<a href='javascript:void(0)' onclick='submitreply(mssgreplyid,orgmssgid,mssgreplytextboxid,sender);'><font size=-1 color=#000000 style='margin-left:5px'>Submit</font></a><a href='javascript:void(0)' onclick='restoremessage(orgmssgid,mssgreplytextboxid);'><font size=-1 color=#000000 style='margin-left:5px'>Cancel</font></a>";document.getElementById(mssgreplytextboxid).style.display="inline";}
function replytomessage(senderusername,messageid){orgmssgid=messageid;mssgreplytextboxid=messageid+"_replytextbox";mssgreplyid=messageid+"_reply";sender=senderusername;document.getElementById(messageid).style.display="none";document.getElementById(mssgreplytextboxid).innerHTML="<textarea rows=1 cols=50 id='"+mssgreplyid+"'></textarea>";document.getElementById(mssgreplytextboxid).innerHTML+="<a href='javascript:void(0)' onclick='submitreply(mssgreplyid,orgmssgid,mssgreplytextboxid,sender);'><font size=-2 color=#000000 style='margin-left:5px'>Submit</font></a><a href='javascript:void(0)' onclick='restoremessage(orgmssgid,mssgreplytextboxid);'><font size=-2 color=#000000 style='margin-left:5px'>Cancel</font></a>";document.getElementById(mssgreplytextboxid).style.display="inline";}
function restoremessage(mssgid,mssgboxid){document.getElementById(mssgid).style.display="block";document.getElementById(mssgboxid).style.display="none";}
function submitreply(mssgreply,orgmssg,mssgreplytextbox,senderun){var mssg=document.getElementById(mssgreply).value;var xmlhttpxx=false;var url="http://altertunes.com/getmessagesfeed.php?saveprofilemessage=Y&newmessage="+mssg+"&receiverun="+orgmssg;try{xmlhttpxx=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttpxx=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttpxx=null;}}
if(!xmlhttpxx&&typeof XMLHttpRequest!="undefined"){xmlhttpxx=new XMLHttpRequest();}
if(!xmlhttpxx){alert('Giving up, Cannot create an XMLHTTP instance');return false;}
xmlhttpxx.onreadystatechange=function(){if(xmlhttpxx.readyState!=4){document.getElementById('sendingmessage').style.display='inline';}
if((xmlhttpxx.readyState==4)&&(xmlhttpxx.status==200)){if(xmlhttpxx.responseText=="Success"){document.getElementById('sendingmessage').style.display='none';document.getElementById('messagesentsuccessfully').style.display='inline';setTimeout("document.getElementById('messagesentsuccessfully').style.display = 'none'",3000);document.getElementById("mssgcntr").innerHTML=parseInt(document.getElementById("mssgcntr").innerHTML)+1;document.getElementById("mssgcntr2").innerHTML=parseInt(document.getElementById("mssgcntr2").innerHTML)+1;restoremessage(orgmssg,mssgreplytextbox);getmessagesfeed(0,orgmssg);}}}
xmlhttpxx.open('GET',url,true);xmlhttpxx.send(null);}
function addasfriend(username,nv,profileun){var seekconf=confirm("Add "+username+" as friend ?");if(seekconf==true){var xmlhttpp=null;url="http://altertunes.com/addasfriend.php?friendname="+username;try{xmlhttpp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttpp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(oc){xmlhttpp=null;}}
if(!xmlhttpp&&typeof XMLHttpRequest!="undefined"){xmlhttpp=new XMLHttpRequest();}
if(!xmlhttpp){alert('Giving up, Cannot create an XMLHTTP instance');return false;}
xmlhttpp.onreadystatechange=function(){if(xmlhttpp.readyState!=4){}
if((xmlhttpp.readyState==4)&&(xmlhttpp.status==200)){if(xmlhttpp.responseText=="Added"){document.getElementById('addasfriend').style.display='inline';document.getElementById('addmssg').innerHTML=username+' has been added successfully to your friends list.';setTimeout("document.getElementById('addasfriend').style.display='none';",5000);if(profileun!=0){if(document.getElementById('MessagesTab').className=='welcomePageSelectedTab'){getmessagesfeed(nv,profileun);}
else if(document.getElementById('FriendsTab').className=='welcomePageSelectedTab'){getfriendsfeed(nv,profileun);}}}
else if(xmlhttpp.responseText=="Already Exists"){alert(username+" already exists in your friend list.");}}}
xmlhttpp.open('GET',url,true);xmlhttpp.send(null);}
else{}}