function ieHover()
{var nav=document.getElementById("button");if(nav){nav.onmouseover=function()
{this.className+=" hover";}
nav.onmouseout=function()
{this.className=this.className.replace(" hover","");}}}
function resize(){if(document.documentElement.clientWidth<1000)
{document.body.style.width="1000px";}
else document.body.style.width="auto";}
if(window.attachEvent&&!window.opera){window.attachEvent("onload",ieHover);}
if(window.attachEvent&&!window.opera){window.attachEvent("onresize",resize);window.attachEvent("onload",resize);}
var mainUrl="http://cdn.dhingana.com";var yellowStar=new Image();var whiteStar=new Image();yellowStar.src=mainUrl+"/images/dragon/star_green.jpg";whiteStar.src=mainUrl+"/images/dragon/star_grey.jpg";function changeRateImage(imageId,toggleFlag,imagePosition,rateText,rowCount,currentRating,ratingType)
{var ratedImage=new Image();if(ratingType==0)
{ratedImage.src=mainUrl+"/images/dragon/star.jpg";}
else
{ratedImage.src=mainUrl+"/images/dragon/star_green.jpg";}
if(toggleFlag==0)
{for(var i=1;i<=5;i++)
{if(i<=currentRating)
document.getElementById("rate"+rowCount+i).src=ratedImage.src;else
document.getElementById("rate"+rowCount+i).src=whiteStar.src;}}
else if(toggleFlag==1)
{for(var i=1;i<=5;i++)
{document.getElementById("rate"+rowCount+i).src=whiteStar.src;}
for(var i=1;i<=imagePosition;i++)
{if(toggleFlag==1){document.getElementById("rate"+rowCount+i).src=ratedImage.src;}}}}
function getRatingImage(imagePosition,songRating){if(imagePosition<=songRating)
return mainUrl+"images/star_on.gif";else
return mainUrl+"images/star_off.gif";}
function rateThisSong(songid,id,rateValue,count)
{sendSongVote(songid,id,rateValue,count);}
function highlight_stars(id,note,do_highlight)
{for(var i=1;i<=note;i++)
{if(do_highlight)
Element.addClassName($('vote_'+id+'_'+i),'ratehover');else
Element.removeClassName($('vote_'+id+'_'+i),'ratehover');}}
function playSelected(dhinganaDomainURL,songcount,playerTitle,isPopOutPlayer,params)
{var sids="";var count=0;for(i=0;i<songcount;i++){var currentsong=document.getElementById('checksong_'+i);if(currentsong.checked==true)
{if(count==0){sids=currentsong.value;count=1;}
else
sids=sids+","+currentsong.value;}}
if(count==1)
{var theFile='http://'+location.hostname+"/play/"+playerTitle+"/"+encode64(sids);if(isPopOutPlayer==0)
{alert("Opeing url in same window..");theFile=theFile+'/pop/0';window.location=theFile;return false;}
else
{theFile=theFile+'/pop/1';playerWindow=window.open(theFile,'DhinganaPlayer',params);playerWindow.focus();return false;}}
else
{alert("Please select one or more songs");}}
function addSelectedSongsToSmartlist(songcount,album_ids,song_names){var sids="";var aids="";var snames="";var count=0;var albumIds=album_ids.split(",");var songNames=song_names.split(",");for(i=0;i<songcount;i++){var currentsong=document.getElementById('checksong_'+i);if(currentsong.checked==true)
{if(count==0){sids=currentsong.value;aids=albumIds[i];snames=songNames[i];count=1;}
else{sids=sids+","+currentsong.value;aids=aids+","+albumIds[i];snames=snames+","+songNames[i];}}}
if(count==1)
{return'sval='+encode64(sids)+'&aval='+encode64(aids)+'&snames='+encode64(snames);}
else
{alert("Please select one or more songs");}}
function selectAllCheckboxes(selectFlag,songcount){for(i=0;i<songcount;i++){var currentsong=document.getElementById('checksong_'+i);if(selectFlag==1&&currentsong.checked==false){currentsong.checked=true;}
else if(selectFlag==0)
{if(currentsong.checked==true){currentsong.checked=false;}else{currentsong.checked=true;}}}}
function clearAllCheckboxes(songcount){for(i=0;i<songcount;i++){var currentsong=document.getElementById('checksong_'+i);if(currentsong.checked==true){currentsong.checked=false;}}}
function playParentWindow(url)
{if(window.opener){alert("Parent detected..opening in parent:"+window.opener.name);window.opener.location.replace('http://'+location.hostname+url);window.opener.focus();}else{alert("parent dead..opening a new window..");var newParentWindow=window.open('http://'+location.hostname+url,"DhinganaParent");newParentWindow.focus();}}
function dhinganaPlayer(theFile,params,isPopOutPlayer)
{if(isPopOutPlayer!=1)
{playerWindow=window.open(theFile,'DhinganaPlayer',params);playerWindow.focus();return;}
window.open(theFile,'DhinganaPlayer',params);}
function dhinganaPlayerPopOut(theFile,params,isPopOutPlayer)
{if(typeof(isPopOutPlayer)=="undefined")
{isPopOutPlayer=-1;}
if(document.getElementById('player_link'))
document.getElementById('player_link').innerHTML='';if(document.getElementById('embedPlayer'))
document.getElementById('embedPlayer').innerHTML='';if(document.getElementById('popout_messsage'))
document.getElementById('popout_messsage').style.display='block';dhinganaPlayer(theFile,params,isPopOutPlayer);}
function dhinganaPlayerPopIn(theFile)
{if(window.opener){window.opener.location.replace('http://'+location.hostname+theFile);window.close();}else{var newParentWindow=window.open('http://'+location.hostname+theFile,"DhinganaParent");window.close();newParentWindow.focus();}}
function encode64(inp)
{var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"0123456789+/=";var out="";var chr1,chr2,chr3="";var enc1,enc2,enc3,enc4="";var i=0;do{chr1=inp.charCodeAt(i++);chr2=inp.charCodeAt(i++);chr3=inp.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}
out=out+keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+
keyStr.charAt(enc4);chr1=chr2=chr3="";enc1=enc2=enc3=enc4="";}while(i<inp.length);return out;}
function decode64(inp)
{var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"0123456789+/=";var out="";var chr1,chr2,chr3="";var enc1,enc2,enc3,enc4="";var i=0;var base64test=/[^A-Za-z0-9\+\/\=]/g;if(base64test.exec(inp)){alert("There were invalid base64 characters in the input text.\n"+"Valid base64 characters are A-Z, a-z, 0-9, ?+?, ?/?, and ?=?\n"+"Expect errors in decoding.");}
inp=inp.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(inp.charAt(i++));enc2=keyStr.indexOf(inp.charAt(i++));enc3=keyStr.indexOf(inp.charAt(i++));enc4=keyStr.indexOf(inp.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;out=out+String.fromCharCode(chr1);if(enc3!=64){out=out+String.fromCharCode(chr2);}
if(enc4!=64){out=out+String.fromCharCode(chr3);}
chr1=chr2=chr3="";enc1=enc2=enc3=enc4="";}while(i<inp.length);return out;}
var currentSL="";function submitTag(form){var numaric=form.tag.value;for(var j=0;j<numaric.length;j++)
{var alphaa=numaric.charAt(j);if(alphaa!=" "&&alphaa!=',')
{var hh=alphaa.charCodeAt(0);if((hh>47&&hh<59)||(hh>64&&hh<91)||(hh>96&&hh<123))
{}
else{alert("Please enter tags that only contain alphabets, numbers and spaces. Separate multiple tags by commas")
return false;}}}
return true;}
function createTagSpace(tagId,sId,aId,category,thisForm)
{var whichBrowser=navigator.appName.substring(0,1);if(whichBrowser=="M")
{var displayMessage="Add Tags: <input type=hidden name=song_id value="+sId+"><input type=hidden name=album_id value="+aId+"><input type=hidden name=category value="+category+"><input type=\"text\" name=\"tag\" size=35>&nbsp;<input type=\"submit\" value=\"add\" onClick=\"return submitTag(this.form)\">&nbsp;<a class=tagging href=\"javascript:;\" onClick=\"clearTagSpace('"+tagId+"')\">cancel</a><br>[Please use tagging to categorize this song as per genre or mood (e.g: romantic, sad) or as per singers and actors (e.g: Sonu Nigam, Shah Rukh Khan). Separate multiple tags by commas]";document.getElementById(tagId).innerHTML=displayMessage;}
else
{var displayMessage="<form name=tagForm action=\"\" method=\"post\" onsubmit=\"return submitTag(this.form)\">Add Tags: <input type=hidden name=song_id value="+sId+"><input type=hidden name=album_id value="+aId+"><input type=hidden name=category value="+category+"><input type=\"text\" name=\"tag\" size=35>&nbsp;<input type=\"submit\" value=\"add\" onClick=\"return submitTag(this.form)\">&nbsp;<a class=tagging href=\"javascript:;\" onClick=\"clearTagSpace('"+tagId+"')\">cancel</a><br>[Please use tagging to categorize this song as per genre or mood (e.g: romantic, sad) or as per singers and actors (e.g: Sonu Nigam, Shah Rukh Khan). Separate multiple tags by commas]</form>";document.getElementById(tagId).innerHTML=displayMessage;}}
function clearTagSpace(tagId,sId){document.getElementById(tagId).innerHTML="";}
function dhinganaSmartListPlayer(theFile,smartlistname,isActivePlaylist)
{if(isActivePlaylist==0)
{if(theFile=="")
{alert("SmartList:"+smartlistname+" should contain one or more songs to play it");}
else
{thePlayerLink=player_smartlist_url+"player/dhinganaPlayer.php?queryWhere=id&queryValue="+encode64(theFile);dhinganaPlayer(thePlayerLink);}}
else
{playSmartlist();}}
function alphanumeric(alphane)
{var numaric=alphane;for(var j=0;j<numaric.length;j++)
{var alphaa=numaric.charAt(j);if(alphaa!=" ")
{var hh=alphaa.charCodeAt(0);if((hh>47&&hh<59)||(hh>64&&hh<91)||(hh>96&&hh<123))
{}
else{return false;}}}
return true;}
function currentPoll(theFile)
{window.open(theFile,'DhinganaPoll','width=188,height=230,statusbar=no,titlebar=no');}
function clearMessageBoard(){document.getElementById("messageBoard").innerHTML="";}
function displayMessageBoard(displaymessage){document.getElementById("messageBoard").innerHTML=displaymessage;}
function displayMessageBoardWithForm(displaymessage){var newMessage="<form name=messageboardform action=\"\" method=\"post\"><table border=0 cellpadding=1 cellspacing=0><tr><td bgcolor=#DFDFDF><table border=0 cellpadding=2 cellspacing=0 bgcolor=#FFFFFF class=normalfont>"+displaymessage+"</table></td></tr><table></form>";displayMessageBoard(newMessage);}
function displayMessageBoardWithCreateForm(displaymessage){var newMessage="<form name=messageboardform action=\"javascript:createNewSmartList();\" method=\"post\"><table border=0 cellpadding=1 cellspacing=0><tr><td bgcolor=#DFDFDF><table border=0 cellpadding=2 cellspacing=0 bgcolor=#FFFFFF class=normalfont>"+displaymessage+"</table></td></tr><table></form>";displayMessageBoard(newMessage);}
function displayMessageBoardWithRenameForm(displaymessage){var newMessage="<form name=messageboardform action=\"javascript:editThisSmartList();\" method=\"post\"><table border=0 cellpadding=1 cellspacing=0><tr><td bgcolor=#DFDFDF><table border=0 cellpadding=2 cellspacing=0 bgcolor=#FFFFFF class=normalfont>"+displaymessage+"</table></td></tr><table></form>";displayMessageBoard(newMessage);}
function displayMessageBoardWithTable(displaymessage){var newMessage="<table border=0 cellpadding=1 cellspacing=0><tr><td bgcolor=#DFDFDF><table border=0 cellpadding=2 cellspacing=0 bgcolor=#FFFFFF>"+displaymessage+"</table></td></tr><table>";displayMessageBoard(newMessage);}
function checkBeforeSignout(smartlistname){if(currentSL!="")
checkSaveStatus(currentSL);else
checkSaveStatus(smartlistname);submitForm("get","register.php","signout",1);}
function checkBeforeChange(smartlistname){showWorkingHard("Changing SmartList");checkSaveStatus(smartlistname);var selectedSmartList=changeSmartListForm.changeSmartlist.value;updateSmartListWindow(selectedSmartList);if(currentPage=="/smartlistsettings.php"){updateSmartListSettings("SmartList <b>'"+selectedSmartList+"'</b> has been <b>activated</b>","Could not activate the smartlist:"+selectedSmartList);}
showWorkingHard("");showSmartListHelp();}
function updateSmartListSettings(successmsg,errormsg)
{var theSmartListSettings=document.getElementById('smartlistsTable');if(theSmartListSettings)
{if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:document.getElementById("messageBoard").innerHTML="<table border=0 cellpadding=1 cellspacing=0><tr><td bgcolor=#DFDFDF><table cellpadding=2 cellspacing=2 bgcolor=#FFFFCC><tr><td class=normalfont>"
+"<font color=RED>Please wait...</font>"
+"</td></tr></table></td></tr></table>";;break
case 4:document.getElementById("messageBoard").innerHTML="<table border=0 cellpadding=1 cellspacing=0><tr><td bgcolor=#DFDFDF><table cellpadding=2 cellspacing=2 bgcolor=#FFFFCC><tr><td class=normalfont>"
+successmsg
+"</td></tr></table></td></tr></table>";return oXMLHTTP.responseText;break}};var sURL="getSmartListSettings.php";oXMLHTTP.open("GET",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4){var xmlResponse=oXMLHTTP.responseXML;var smartlistsArray=xmlResponse.getElementsByTagName('smartlist');var smartlistLen=smartlistsArray.length;var activeSmartListName=(xmlResponse.getElementsByTagName('activeSmartList'))[0].firstChild.data;var InnerHTML="<table border=0 width=100% cellpadding=2 cellspacing=0 bgcolor=#FFFFFF class=normalfont>"+"<tr height=24><td colspan=2 bgcolor=#D7FFAE align=center><b>My SmartLists</b></td><td align=center bgcolor=#FFFF99 colspan=6><b>Options</b></td></tr>";InnerHTML=InnerHTML+"<tr><td colspan=6>&nbsp;</td><tr>";for(i=0;i<smartlistLen;i++)
{var currentsmartlistname=smartlistsArray[i].firstChild.data;var currentsongids=smartlistsArray[i].getAttribute('sids');var isActiveSmartList=smartlistsArray[i].getAttribute('isActive');InnerHTML=InnerHTML+"<tr id=\"smartlist"+i+"\" onmouseover=\"document.getElementById('smartlist"+i
+"').bgColor='#BBE9FF'\" onmouseout=\"document.getElementById('smartlist"+i
+"').bgColor='#FFFFFF'\"><td width=10>&nbsp;</td><td id=\"editsmartlist"+i+"\">"
+currentsmartlistname+"</td><td align=center width=80 id=\"playBox"+i+"\"><a href=\"javascript:;\" onClick=\"dhinganaSmartListPlayer('"+
currentsongids+"','"+currentsmartlistname+"','"+isActiveSmartList+"');\">play</a></td><td align=center width=30 id=\"dedicateBox"+i+"\"><a href=\"dedication.php?value="+encode64(currentsongids)+"&val1="+encode64(currentsmartlistname)+"&val2=1\" onClick=\"return checkIfSmartlistEmpty("+currentsongids.length+",'"+currentsmartlistname+"')\">mGreeting</a></td><td align=center width=80 id=\"renamebox"+i+"\"><a href=\"javascript:;\" onClick=\"editSmartlistName('editsmartlist"+i+"','"+currentsmartlistname+"')\">rename</a></td>";if(isActiveSmartList==0)
{InnerHTML=InnerHTML+"<td width=80 align=center id='activate"+i
+"'><a href=\"javascript:;\" onClick=\"javascript:makeDefaultSpace('"+currentsmartlistname+"','"
+activeSmartListName+"')\">make active</a></td><td width=100 align=center  id='delete"
+i+"'><a id=\"deletebox"+i+"\" href=\"javascript:;\" onClick=\"deleteSmartlistName('smartlist"
+i+"','"+currentsmartlistname+"')\">delete</a></td>";}
else
{InnerHTML=InnerHTML+"<td width=80 align=center id='activate"+i
+"'><b>Active</b></td><td width=100 id='delete"+i+"'>&nbsp;</td>";}
InnerHTML=InnerHTML+"<td width=10>&nbsp;</td></tr>";}
InnerHTML=InnerHTML+"<tr><td colspan=2>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td colspan=2>&nbsp;</td></tr></table>";theSmartListSettings.innerHTML=InnerHTML;document.getElementById("messageBoard").innerHTML="<table border=0 cellpadding=1 cellspacing=0><tr><td bgcolor=#DFDFDF><table cellpadding=2 cellspacing=2 bgcolor=#FFFFCC><tr><td class=normalfont>"
+successmsg
+"</td></tr></table></td></tr></table>";}}
catch(e){document.getElementById("messageBoard").innerHTML="<table border=0 cellpadding=1 cellspacing=0><tr><td bgcolor=#DFDFDF><table cellpadding=2 cellspacing=2 bgcolor=#FFFFCC><tr><td class=normalfont>"
+"<font color=RED>"+errormsg+"</font>"
+"</td></tr></table></td></tr></table>";;}}}
function updateSmartListWindow(selectedSmartList)
{var oXMLHTTP;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:if(currentPage!="/smartlistsettings.php")
document.getElementById("smartlistBoard").innerHTML="<font color=RED><b>Please wait...</b></font>";break
case 4:document.getElementById("smartlistBoard").innerHTML="";return oXMLHTTP.responseText;break}};currentSL=selectedSmartList;var sURL="activateSmartList.php?changeSmartlist="+selectedSmartList;oXMLHTTP.open("GET",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4){var xmlResponse=oXMLHTTP.responseXML;var cvalsArray=xmlResponse.getElementsByTagName('cval');var cidsArray=xmlResponse.getElementsByTagName('cid');var aidsArray=xmlResponse.getElementsByTagName('albumid');var atypesArray=xmlResponse.getElementsByTagName('albumtype');var cvalsLen=cvalsArray.length;if(currentPage!="/smartlistsettings.php")
document.getElementById("smartlistBoard").innerHTML="<font color=blue><b>'"+selectedSmartList+"' activated</b></font>";var footerWindow=document.getElementById("smartListWindowFooter");var footerInner="<a href=\"javascript:;\" onClick=\"playSmartlist()\">Play</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";cvals=new Array();cids=new Array();aids=new Array();atype=new Array();dropId=0;var theBox=document.getElementById('dropZone');theBox.innerHTML="";var dedicatesongids="";for(i=0;i<cvalsLen;i++)
{var dropName=cvalsArray[i].firstChild.data;var sid=cidsArray[i].firstChild.data;var albumid=aidsArray[i].firstChild.data;var albumtype=atypesArray[i].firstChild.data;cvals.push(dropName);cids.push(sid);aids.push(albumid);atype.push(albumtype);if(i==0)
{dedicatesongids=dedicatesongids+sid;}
else
{dedicatesongids=dedicatesongids+","+sid;}
theBox.appendChild(addSmartListDivElement(albumid,albumtype,sid,dropName));}
footerInner=footerInner+"<a href=\"dedication.php?value="+encode64(dedicatesongids)+"&val1="+encode64(selectedSmartList)+"&val2=1\" onClick=\"return checkIfSmartlistEmpty("+dedicatesongids.length+",'"+selectedSmartList+"')\"><IMG src=\"images/dedication.png\" BORDER=\"0\"\></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp"+"<a href=\"javascript:;\" onClick=\"savesmartlist(1)\">Save</a>"+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:;\" onClick=\"deleteAllSongs('"+selectedSmartList+"')\">Delete All</a>";footerWindow.innerHTML=footerInner;songsaved=1;var getIdElement1=document.getElementById('showAllSmartlists1');var getIdElement2=document.getElementById('showAllSmartlists2');getIdElement1.innerHTML='<b>'+selectedSmartList+'</b>';getIdElement2.innerHTML='<a href=\"javascript:;\" onClick=\"javascript:showAllSmartlists(\'showAllSmartlists\',\''+selectedSmartList+'\')">change</a>';}}
catch(e){alert("An exception occurred in the script. Error name: "+e.name+". Error message: "+e.message);document.getElementById("smartlistBoard").innerHTML="<font color=RED><b>Could not activate the smartlist</b></font>";}}
function addSmartListDivElement(albumid,albumtype,sid,dropName){var theDiv=document.createElement('div');theDiv.setAttribute('id','div'+dropId);if(dropName.length>=20)
dropName=dropName.substr(0,20)+"...";var albumURL="albums.php?value="+albumid+"&category="+albumtype+"&lookfor="+encode64(sid);var theFile=player_smartlist_url+"player/dhinganaPlayer.php?queryWhere=id&queryValue="+encode64(sid);theDiv.innerHTML="<table class=normalfont id=t"+dropId+" border=0 width=100% cellpadding=2 cellspacing=0><tr><td width=100%><a class=news href=\"javascript:;\" onClick=\"dhinganaPlayer('"+theFile+"')\"  id=a"+dropId+">"+dropName+"</a></td><td align=right valign=top><a class=news href=\""+albumURL+"\" id=album"+dropId+">[a]</a>&nbsp;<a class=news href=\"javascript:;\" onClick=\"getContent("+dropId+", "+sid+")\" id='"+dropId+"'>[x]</a></td></tr></table>";dropId++;return theDiv;}
function checkSaveStatus(smartlistname){if(songsaved==0)
{var returnvalue=confirm("Do you want to save the SmartList '"+smartlistname+"' before continuing?");if(returnvalue)
{savesmartlist(1);}}}
function selectSmartlist(currentSmartlist){alert(currentSmartlist);}
function showAllSmartlists(getId,getSmartlistname){var getIdElement1=document.getElementById(getId+1);var getIdElement2=document.getElementById(getId+2);getIdElement1.innerHTML=getData("getSmartlistNames.php?currentsmartlist="+getSmartlistname);getIdElement2.innerHTML="";}
function cancelAllSmartlists(getId,getSmartlistName){var getIdElement1=document.getElementById(getId+1);var getIdElement2=document.getElementById(getId+2);getIdElement1.innerHTML="<b>"+getSmartlistName+"</b>";getIdElement2.innerHTML="<a href=\"javascript:showAllSmartlists('"+getId+"','"+getSmartlistname+"')\" >change</a>";}
function submitForm(methodType,actionURL,inputName,inputValue){var theform=document.createElement("form");var theinput=document.createElement("input");theform.setAttribute("name","defaultsmartlistform");theform.setAttribute("method",methodType);theform.setAttribute("action",actionURL);theinput.setAttribute("name",inputName);theinput.setAttribute("type","hidden");theinput.setAttribute("value",inputValue);theform.appendChild(theinput);document.getElementById("trashBoard").appendChild(theform);theform.submit();}
function deleteAllSongs(smartlistname){if(cids.length>0)
{showWorkingHard("Deleting all songs");var returnvalue=confirm("Are you sure you want to delete all songs from '"+smartlistname+"'?");if(returnvalue)
{document.getElementById("dropZone").innerHTML="";cids=new Array();cvals=new Array();aids=new Array();atype=new Array();savesmartlist(0);document.getElementById("smartlistBoard").innerHTML="<font color=red>All songs <b>deleted</b> successfully</font>";}
showWorkingHard("");showSmartListHelp();}
else{alert("'"+smartlistname+"' contains 0 songs at this time");document.getElementById("smartlistBoard").innerHTML="&nbsp;";}}
function restoreThisDedication(did,count,folder)
{var oXMLHTTP;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
var sURL="";sURL="restoreDedication.php?did="+did+"&folder="+folder;try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:break
case 4:return oXMLHTTP.responseText;break}};oXMLHTTP.open("POST",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4)
{var elemId=document.getElementById("dids"+count);elemId.parentNode.removeChild(elemId);if(oXMLHTTP.responseText==0)
{var emptyElemId=document.getElementById("didsEmpty");emptyElemId.style.display="block";}}}
catch(e){alert("Could not restore the dedication.");}}
function trashThisDedication(did,count,folder)
{var oXMLHTTP;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:break
case 4:return oXMLHTTP.responseText;break}};var sURL="trashDedication.php?did="+did+"&folder="+folder;oXMLHTTP.open("GET",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4)
{var elemId=document.getElementById("dids"+count);elemId.parentNode.removeChild(elemId);if(oXMLHTTP.responseText==0)
{var emptyElemId=document.getElementById("didsEmpty");emptyElemId.style.display="block";}}}
catch(e){alert("Could not trash the dedication.");}}
function deleteThisDedication(did,count,folder)
{var oXMLHTTP;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
var sURL="";sURL="deleteDedication.php?did="+did+"&folder="+folder;try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:break
case 4:return oXMLHTTP.responseText;break}};oXMLHTTP.open("POST",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4)
{var elemId=document.getElementById("dids"+count);elemId.parentNode.removeChild(elemId);if(oXMLHTTP.responseText==0)
{var emptyElemId=document.getElementById("didsEmpty");emptyElemId.style.display="block";}}}
catch(e){alert("Could not delete the dedication.");return false;}}
function getContent(spanId,sid){showWorkingHard("Deleting Song");var el=document.getElementById(spanId)
el.parentNode.removeChild(el);var e3=document.getElementById("a"+spanId)
e3.parentNode.removeChild(e3);var e4=document.getElementById("album"+spanId)
e4.parentNode.removeChild(e4);var e5=document.getElementById("t"+spanId)
e5.parentNode.removeChild(e5);var e6=document.getElementById("div"+spanId)
e6.parentNode.removeChild(e6);var rid=-1;for(var i=0;i<cids.length;i++){if(cids[i]==sid)
rid=i;}
var deletedSong=cvals[rid];cids.splice(rid,1);cvals.splice(rid,1);aids.splice(rid,1);atype.splice(rid,1);savesmartlist(0);document.getElementById("smartlistBoard").innerHTML="<font color=red>Song '<b>"+deletedSong+"</b>' deleted</font>";showWorkingHard("");showSmartListHelp();}
function getSongNames(getName,getId){names[songcount++]=getName;songs[getId]=getName;}
function addToSession(dropName,sid,addDiv){var addflag=-1;if(cids.length>=60){alert("Dhingana SmartList can only contain upto 60 songs");return-2;}
for(var findkey in cids)
{if(cids[findkey]==sid){alert("'"+dropName+"' is already present in the SmartList");addflag=1;}}
if(addflag==-1){cvals.push(dropName);cids.push(sid);aids.push(currentalbumid);atype.push(currentalbumtype);if(addDiv)
{var theBox=document.getElementById('dropZone');theBox.appendChild(addSmartListDivElement(currentalbumid,currentalbumtype,sid,dropName));}
return 0;}
return-1;}
function processSingleSong(dropName,sid,addDiv)
{showWorkingHard("Adding Song to SmartList");addToSession(dropName,sid,addDiv);savesmartlist(0);showSmartListBoardTotalSongs();showWorkingHard("");showSmartListHelp();}
function showSmartListHelp(){if(cids.length==0)
{document.getElementById("smartListHelpTable").innerHTML="<table border=0 cellpadding=0 cellspacing=0><tr><td height=2 colspan=3></td></tr></table>";}
else
document.getElementById("smartListHelpTable").innerHTML="<table border=0 cellpadding=0 cellspacing=0><tr><td height=2 colspan=3></td></tr></table>";}
function showWorkingHard(showMessage){if(showMessage!="")
document.getElementById('workingHardId').innerHTML="<img src=\"scripts/ajaxtabs/loading.gif\" alt=\"Wait!! \"/>&nbsp;"+showMessage+"...";else
document.getElementById('workingHardId').innerHTML="&nbsp;";}
function showSmartListBoardTotalSongs(){document.getElementById("smartlistBoard").innerHTML="<b><font color=blue>Total Songs: "+cids.length+"</b></font>";}
function processSelectedSongs(addAllFlag)
{showWorkingHard("Adding Songs to SmartList");var elenums=document.playselectionform.elements;var sids="";var count=0;var addflag=-1;var currentSongId;var currentSongName;for(i=0;i<elenums.length;i++)
{if(addAllFlag==1||(addAllFlag==0&&elenums[i].checked==true))
{currentSongId=elenums[i].name;currentSongName=songs[currentSongId];var returnValue=addToSession(currentSongName,currentSongId,1);count=1;elenums[i].checked=false;if(returnValue==0)
addflag=0;else if(returnValue==-2)
{break;}}}
if(count==1)
{savesmartlist(0);}
else
{if(addAllFlag==0)
alert("Please select one or more songs");}
showSmartListBoardTotalSongs();showWorkingHard("");showSmartListHelp();}
function playSmartlist(){var sids="";var count=0;if(cids.length==0)
alert("SmartList should contain one or more songs");else{for(var i=0;i<cids.length;i++){if(count==0){sids=cids[i];count=1;}
else
sids=sids+","+cids[i];}
var theFile=player_smartlist_url+"player/dhinganaPlayer.php?queryWhere=id&queryValue="+encode64(sids);dhinganaPlayer(theFile);}}
function saveDedicationForUser(did)
{var oXMLHTTP;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:document.getElementById("SaveDBoard").innerHTML="<table><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td class=normalfont>Please Wait...</td><td>&nbsp;</td></tr></table>";document.getElementById("SaveDBoard").style.display='block';break
case 4:document.getElementById("SaveDBoard").innerHTML="<table><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td class=normalfont>"+oXMLHTTP.responseText+"</td><td>&nbsp;</td></tr></table>";document.getElementById("SaveDBoard").style.display='block';return oXMLHTTP.responseText;break}};var sURL="saveDedication.php?val="+did;oXMLHTTP.open("POST",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4){document.getElementById("SaveDBoard").innerHTML="<table><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td class=normalfont>"+oXMLHTTP.responseText+"</td><td>&nbsp;</td></tr></table>";document.getElementById("SaveDBoard").style.display='block';return oXMLHTTP.responseText;}}
catch(e){document.getElementById("SaveDBoard").innerHTML="<table><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td class=normalfont>Could not Save the Dedication..Try Again later please...</td><td>&nbsp;</td></tr></table>";document.getElementById("SaveDBoard").style.display='block';}}
function saveDedication(did,isLoggedIn)
{alert("did = "+did+"isLoggedIn = "+isLoggedIn);if(isLoggedIn==1)
{saveDedicationForUser(did);}
else
{}}
function getSongName(sid)
{var oXMLHTTP;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:break
case 4:return oXMLHTTP.responseText;break}};var sURL="getSongName.php?val="+sid;oXMLHTTP.open("POST",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4){return oXMLHTTP.responseText;}}
catch(e){alert("something wierd");}}
function addSongsToSmartList(sids)
{for(var i=0;i<sids.length;i++)
{var songname=getSongName(sids[i]);var returnValue=addToSession(songname,sids[i],1);if(returnValue==0)
addflag=0;else if(returnValue==-2)
{break;}}
savesmartlist(0);}
function savesmartlist(store){var oXMLHTTP;var returnValue=false;songsaved=store;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
var pvals="";var pids="";var paids="";var patype="";var count=0;for(var i=0;i<cids.length;i++){if(count==0){pids=cids[i];pvals=cvals[i];paids=aids[i];patype=atype[i];count=1;}
else{pids=pids+","+cids[i];pvals=pvals+","+cvals[i];paids=paids+","+aids[i];patype=patype+","+atype[i];}}
var sURL="";sURL="smartlist.php";var sPostParameters="names="+escape(pvals)+"&values="+escape(pids)+"&avalues="+escape(paids)+"&types="+escape(patype)+"&store="+store;try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:if(document.getElementById("smartlistBoard")!=null)
document.getElementById("smartlistBoard").innerHTML="<b>Please Wait</b>";break
case 4:if(oXMLHTTP.responseText=="saved")
{if(store==1)
{if(document.getElementById("smartlistBoard")!=null)
document.getElementById("smartlistBoard").innerHTML="<font color=BLUE><b>SmartList saved</b></font>";}
else{if(document.getElementById("smartlistBoard")!=null)
document.getElementById("smartlistBoard").innerHTML="";}
returnValue=true;}
else
{if(document.getElementById("smartlistBoard")!=null)
document.getElementById("smartlistBoard").innerHTML="<font color=RED><b>Could not save SmartList</b></font>";}
break}};oXMLHTTP.open('POST',sURL,false);oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send(sPostParameters);if(oXMLHTTP.readyState==4&&oXMLHTTP.responseText!="saved")
{if(document.getElementById("smartlistBoard")!=null)
document.getElementById("smartlistBoard").innerHTML="<font color=RED><b>Could not save SmartList</b></font>";}
else if(oXMLHTTP.readyState==4&&oXMLHTTP.responseText=="saved")
{if(store==1){if(document.getElementById("smartlistBoard")!=null)
document.getElementById("smartlistBoard").innerHTML="<font color=BLUE><b>SmartList saved</b></font>";}
else{if(document.getElementById("smartlistBoard")!=null)
document.getElementById("smartlistBoard").innerHTML="";}
returnValue=true;}}
catch(e){alert("An exception occurred in the script. Error name: "+e.name+". Error message: "+e.message);alert("Could not save your SmartList.")
return false;}
return returnValue;}
function getRatingImage(imagePosition,songRating){if(imagePosition<=songRating)
return"images/star_on.gif";else
return"images/star_off.gif";}
function sendSongVote(val,id,vote,count){var oXMLHTTP;var returnValue=false;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:document.getElementById("rateText"+count).innerHTML="<font color=RED>Please wait...</font>";break
case 4:document.getElementById("rateText"+count).innerHTML="Thank you!";return oXMLHTTP.responseText;break}};var sURL="sendvote.php?val="+val+"&id="+id+"&vote="+vote;oXMLHTTP.open("GET",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4){var xmlResponse=oXMLHTTP.responseXML;var songVotesArray=xmlResponse.getElementsByTagName('songVote');var albumVotesArray=xmlResponse.getElementsByTagName('albumVote');var songRating=songVotesArray[0].firstChild.data;var albumrating=albumVotesArray[0].firstChild.data;imgRate1=document.getElementById('rate1'+count);imgRate2=document.getElementById('rate2'+count);imgRate3=document.getElementById('rate3'+count);imgRate4=document.getElementById('rate4'+count);imgRate5=document.getElementById('rate5'+count);imgRate1.src=getRatingImage(1,songRating);imgRate2.src=getRatingImage(2,songRating);imgRate3.src=getRatingImage(3,songRating);imgRate4.src=getRatingImage(4,songRating);imgRate5.src=getRatingImage(5,songRating);songVotings[count]=songRating;if(albumrating>0)
document.getElementById('albumRatingId').innerHTML="<b><font color=white>Rating: "+albumrating+"/5&nbsp;&nbsp;&nbsp;&nbsp;</font></b>";else
document.getElementById('albumRatingId').innerHTML="<b><font color=white>Not Rated&nbsp;&nbsp;&nbsp;&nbsp;</font></b>";document.getElementById("rateText"+count).innerHTML="Thank you!";return oXMLHTTP.responseText;}}
catch(e){document.getElementById("rateText"+count).innerHTML="Could not send your vote, try later.";}}
function updateAlbumView(val){var oXMLHTTP;var returnValue=false;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:break
case 4:return oXMLHTTP.responseText;break}};var sURL="updatealbumviews.php?val="+val;oXMLHTTP.open("POST",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4){return oXMLHTTP.responseText;}}
catch(e){}}
function getImageSlideShow(specialbg,category){var oXMLHTTP;var returnValue=false;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:document.getElementById("slideshow").innerHTML="please wait...";break
case 4:document.getElementById("slideshow").innerHTML=oXMLHTTP.responseText;break}};var sURL="thumbnailslideshow.php?specialbg="+specialbg+"&category="+category;oXMLHTTP.open("POST",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4){document.getElementById("slideshow").innerHTML=oXMLHTTP.responseText;}}
catch(e){}}
function getData(sURL){var oXMLHTTP;var returnValue=false;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:document.getElementById("smartlistBoard").innerHTML="<font color=RED>Loading...</font>";break
case 4:document.getElementById("smartlistBoard").innerHTML="";return oXMLHTTP.responseText;break}};oXMLHTTP.open("POST",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4){document.getElementById("smartlistBoard").innerHTML="";return oXMLHTTP.responseText;}}
catch(e){alert("Could not retrieve SmartLists.")}}
function sendData(sURL){var oXMLHTTP;var returnValue=false;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:break
case 4:break}};oXMLHTTP.open("POST",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4){}}
catch(e){alert("Error while sending tracking data.."+sURL)}}
function validatesignin(form){var userid=form.userid.value
var password=form.password.value
if(userid==""&&password==""){document.getElementById("status").innerHTML="<font color=red>Both Email and Password fields must be entered</font>";return false;}
if(userid==""){document.getElementById("status").innerHTML="<font color=red>Email field must be entered</font>";return false;}
if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(userid)){}
else{document.getElementById("status").innerHTML="<font color=red>Please enter a valid email address</font>";return false}
if(password==""){document.getElementById("status").innerHTML="<font color=red>Password field must be entered</font>";return false;}
return true;}
function validateuserid(form){var oXMLHTTP;var returnValue=false;if(window.XMLHttpRequest){oXMLHTTP=new XMLHttpRequest()}
else{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP")}
var userid=form.userid.value
var sURL="checkuser.php?userid="+userid
try{oXMLHTTP.onreadystatechange=function()
{switch(oXMLHTTP.readyState)
{case 2,3:document.getElementById("status1").innerHTML="<font color=\"RED\">Loading...</font>";break
case 4:if(oXMLHTTP.responseText=="exists")
{document.getElementById("status1").innerHTML="<br><font color=\"RED\">"+userid+" is already taken</font><br><br>";}
else
{document.getElementById("status1").innerHTML="";returnValue=true;}
break}};oXMLHTTP.open("POST",sURL,false)
oXMLHTTP.setRequestHeader('Content-Type','application/x-www-form-urlencoded');oXMLHTTP.send("")
if(oXMLHTTP.readyState==4&&oXMLHTTP.responseText=="exists")
{document.getElementById("status1").innerHTML="<br><font color=\"RED\">"+userid+" is already taken</font><br><br>";}
else if(oXMLHTTP.readyState==4&&oXMLHTTP.responseText!="exists")
{document.getElementById("status1").innerHTML="";returnValue=true;}}
catch(e){alert("Could not validate your Email at this time.")}
return returnValue;}
function isValidPasswd(pw,passwordtext)
{if(pw.length==0){alert(passwordtext+" must be specified");return false;}else if(pw.length>20){alert(passwordtext+" must be no greater than 20 characters.");return false;}else if(pw.length<3){alert(passwordtext+" must be atleast 3 characters long.");return false;}
else{return true;}}
function alphanumeric(alphane)
{var numaric=alphane;for(var j=0;j<numaric.length;j++)
{var alphaa=numaric.charAt(j);var hh=alphaa.charCodeAt(0);if((hh>47&&hh<59)||(hh>64&&hh<91)||(hh>96&&hh<123))
{}
else{return false;}}
return true;}
function alphanumericAnswer(alphane)
{var numaric=alphane;for(var j=0;j<numaric.length;j++)
{var alphaa=numaric.charAt(j);if(alphaa!=" ")
{var hh=alphaa.charCodeAt(0);if((hh>47&&hh<59)||(hh>64&&hh<91)||(hh>96&&hh<123))
{}
else{return false;}}}
return true;}
function validateUserIdFiled(form)
{var userid=form.userid.value
if(userid=="")
{alert("Email address must be specified")
return false}
if(checkEmail(userid)==false)
return false
return true}
function validateAnswerField(form)
{var answer=form.answer.value
if(answer=="")
{alert("Answer must be specified")
return false}
if(alphanumericAnswer(answer)==false)
{alert("Answer can only contain alphabets, spaces and/or numbers");return false}
if(answer.length>50)
{alert("Answer cannot be longer than 50 characters")
return false}}
function checkEmail(emailadr){return checkEmailErrMsg(emailadr,'Please provide a valid email address');}
function checkEmailErrMsg(emailadr,errorMessage){if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailadr)){return(true)}
alert(errorMessage);return(false)}
function validateRegistrationForm(form)
{var userid=form.userid.value
if(form.name!="settingsForm")
{var password=form.password.value
var confirmpassword=form.confirmpassword.value}
var firstname=form.firstname.value
var lastname=form.lastname.value
if(userid=="")
{alert("Email address must be specified")
return false}
if(userid.toLowerCase().indexOf('dhingana')>=0||userid.toLowerCase().indexOf('dhingaana')>=0||userid.toLowerCase().indexOf('dhinganaa')>=0){alert("Email cannot contain the words 'dhingana' or 'dhingaana' or 'dhinganaa'")
return false}
if(checkEmail(userid)==false)
return false
if(form.name!="settingsForm"&&isValidPasswd(password,"Password")==false)
{return false}
if(form.name!="settingsForm"&&password!=confirmpassword)
{alert("Password and Confirm Password fields must match");return false}
if(firstname=="")
{alert("First Name must be specified")
return false}
if(alphanumeric(firstname)==false)
{alert("First Name can only contain alphabets and/or numbers");return false}
if(firstname.length>20)
{alert("First Name cannot be longer than 20 characters")
return false}
if(lastname=="")
{alert("Last Name must be specified")
return false}
if(alphanumeric(lastname)==false)
{alert("Last Name can only contain alphabets and/or numbers");return false}
if(lastname.length>20)
{alert("Last Name cannot be longer than 20 characters")
return false}
if(validateAnswerField(form)==false)
{return false}
if(form.name!="settingsForm"&&validateuserid(form)==false)
{return false}
return true}
function validatePasswordForm(form)
{var oldpassword=form.oldpassword.value
var newpassword=form.newpassword.value
var newpassword1=form.newpassword1.value
if(isValidPasswd(oldpassword,"Old Password")==false)
{return false}
if(isValidPasswd(newpassword,"New Password")==false)
{return false}
if(newpassword==oldpassword)
{alert("New Password and Old Password should not be same")
return false}
if(newpassword!=newpassword1)
{alert("New Password and Verify Password fields do not match")
return false}
return true}
function validateForgotPasswordForm(form)
{if(validateUserIdFiled(form)==false)
{return false}
if(validateAnswerField(form)==false)
{return false}
return true}
function validateFeedbackForm(form)
{var vsubject=form.subject.value
var vmessage=form.message.value
var vname=form.name.value
var vemail=form.from.value
if(vname=="")
{alert("Name must be specified")
return false}
if(alphanumericAnswer(vname)==false)
{alert("Name can only contain alphabets, spaces and/or numbers");return false}
if(vname.length>30)
{alert("Name cannot be longer than 30 characters")
return false}
if(vemail=="")
{alert("Email address must be specified")
return false}
if(vemail!="")
{if(checkEmail(vemail)==false)
return false}
if(vsubject=="")
{alert("Subject must be specified")
return false}
if(vsubject.length>100)
{alert("Subject cannot be longer than 100 characters")}
if(vmessage=="")
{alert("Message must be specified")
return false}
if(vmessage.length>2000)
{alert("Message cannot be longer than 1000 characters")}
return true}
function validateDedicationForm(form)
{var vsubject=form.subject.value;var vmessage=form.message.value;var vname=form.name.value;var vemail=form.to.value;var vfromemail=form.from.value;var vfromname=form.name_from.value;if(vfromname=="")
{alert("Your Name must be specified")
return false}
if(alphanumericAnswer(vfromname)==false)
{alert("Your Name can only contain alphabets, spaces and/or numbers");return false}
if(vfromname.length>30)
{alert("Your Name cannot be longer than 30 characters")
return false}
if(vfromemail=="")
{alert("Your Email id must be specified")
return false}
if(vfromemail!="")
{if(checkEmailErrMsg(vfromemail,"Please provide a valid Your email id")==false)
return false}
if(vname=="")
{alert("Receiver's Name must be specified")
return false}
if(alphanumericAnswer(vname)==false)
{alert("Receiver's Name can only contain alphabets, spaces and/or numbers");return false}
if(vname.length>30)
{alert("Receiver's Name cannot be longer than 30 characters")
return false}
if(vemail=="")
{alert("Receiver's Email id must be specified")
return false}
if(vemail!="")
{if(checkEmailErrMsg(vemail,"Please provide a valid Receiver's email id")==false)
return false}
if(vsubject=="")
{alert("Title must be specified")
return false}
if(vsubject.length>100)
{alert("Title cannot be longer than 100 characters")}
if(vmessage=="")
{alert("Message must be specified")
return false}
if(vmessage.length>2000)
{alert("Message cannot be longer than 1000 characters")}
return true}
function validateTellAFriendForm(form)
{var vmessage=form.message.value;var vemail=form.to.value;var vfromemail=form.from.value;var vfromname=form.name_from.value;if(vfromname=="")
{alert("Your Name must be specified")
return false}
if(alphanumericAnswer(vfromname)==false)
{alert("Your Name can only contain alphabets, spaces and/or numbers");return false}
if(vfromname.length>30)
{alert("Your Name cannot be longer than 30 characters")
return false}
if(vfromemail=="")
{alert("Your Email id must be specified")
return false}
if(vfromemail!="")
{if(checkEmailErrMsg(vfromemail,"Please provide a valid Your email id")==false)
return false}
if(vemail=="")
{alert("Receiver's Email id must be specified")
return false}
re=/\s*,\s*/;var vemailsList=vemail.split(re);if(vemailsList.length==0)
{alert("Receiver's Email id must be specified");return false}
var emailIndex;for(emailIndex=0;emailIndex<vemailsList.length;emailIndex++)
{if(checkEmailErrMsg(vemailsList[emailIndex],"\'"+vemailsList[emailIndex]+"\' not a valid email address")==false)
return false}
if(vmessage=="")
{alert("Message must be specified")
return false}
if(vmessage.length>2000)
{alert("Message cannot be longer than 1000 characters");return false;}
form.htmlizedMessage.value=htmlize(vmessage);return true;}
function enableSubjTyp(form)
{form.subject.disabled=false;return true}
var songlinkmessage;function htmlize(str)
{str=str.replace(/\&/g,"&amp;");str=str.replace(/\</g,"&lt;");str=str.replace(/\>/g,"&gt;");str=str.replace(/\"/g,"&quot;");str=str.replace(/\n/g,"<br/>\n");return str;}
function showDedicationPreview(form)
{if(!validateDedicationForm(form))
return false;document.getElementById('dedicationPreviewSubject').innerHTML="<div id=\"bluecontent1\">&nbsp;&nbsp;&nbsp;<b>"+form.subject.value+"</b></div>";Rico.Corner.round('bluecontent1');var previewMessage=form.message.value;previewMessage=htmlize(previewMessage);document.getElementById('dedicationPreviewMessage').innerHTML="<div id=\"greencontent1\"><table><tr><td>&nbsp;</td><td class=normalfont>"+previewMessage+"</td><td>&nbsp;</td></tr></table></div>";Rico.Corner.round('greencontent1');document.getElementById('dedicationInputs').style.display="none";document.getElementById('dedicationPreview').style.display="block";return true;}
function showDedicationForm()
{document.getElementById('dedicationPreview').style.display="none";document.getElementById('dedicationInputs').style.display="block";return true;}
typeArray=new Array("Friendship","Birthday Anyone","Birthday Her","Birthday His","Thank You","General","Get Well Soon","Congratulations","I Love You","I Miss You","Thinking of You","I am Sorry","Humorous","Wedding","Other");messageArray=new Array("Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk besides me and be my friend.","Birthdays are nature's way of telling us to eat more cake. Wish you, a very Happy Birthday!","A ring is round, it turns forever and that's how long we'll be together! Wish you, a Happy Birthday my sweetheart!","You are the sun in my day, the wind in my sky, the waves in my ocean, and the beat in my heart. Wish you, a Happy Birthday my Love!","Thank you for being the one who calms all my inner fears","I thought my cool self would send your cool self a big, HELLO!","Friends are like medicine; they make you feel better when you're down. Here's a dose of friendship to speed up your recovery!","You reached for the stars and made it! A big congrats for reaching your goal","This song that I send to you was chosen with great care, and nestled within its word is my whisper, I Love You...","Within you I lose myself...Without you I find myself…wanting to be lost again.","I confess... I spend a lot of time just thinking about you!","I can't believe I forgot to ask something so incredibly important...will you please forgive me?","Roses are red, violets are blue, sugar is sweet, and so are you. But the roses are wilting, the violets are dead, the sugar bowl's empty and so is your head.","My Greatest wish for the two of you is that through the years your love for each other will so deepen and grow, that years from now you will look back on this day, your wedding day, as the day you loved each other the least. Hearty Congratulations on your marriage","Message Other");function onChangeSubject()
{if(dedicationForm.subjectType.value!=(typeArray.length-1))
{dedicationForm.message.value=messageArray[dedicationForm.subjectType.value];dedicationForm.subject.value=typeArray[dedicationForm.subjectType.value];}
else
{dedicationForm.message.value="";dedicationForm.subject.value="";}
return false;}
function setAgainValues(dedicateAgainTitle,dedicateAgainMessage,dedicateAgainCategory)
{if(dedicateAgainTitle!="")
{dedicationForm.message.value=dedicateAgainMessage;dedicationForm.subject.value=dedicateAgainTitle;dedicationForm.subjectType.selectedIndex=dedicateAgainCategory;}}
function populateSubjectData(currentCategory)
{for(i=0;i<typeArray.length;i++)
{if(currentCategory==i){document.writeln("<option value=\""+i+"\" selected>"+typeArray[i]);}else{document.writeln("<option value=\""+i+"\">"+typeArray[i]);}}}
typeArray=new Array("Friendship","Birthday Anyone","Birthday Her","Birthday His","Thank You","General","Get Well Soon","Congratulations","I Love You","I Miss You","Thinking of You","I am Sorry","Humorous","Wedding","Other");messageArray=new Array("Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk besides me and be my friend.","Birthdays are nature's way of telling us to eat more cake. Wish you, a very Happy Birthday!","A ring is round, it turns forever and that's how long we'll be together! Wish you, a Happy Birthday my sweetheart!","You are the sun in my day, the wind in my sky, the waves in my ocean, and the beat in my heart. Wish you, a Happy Birthday my Love!","Thank you for being the one who calms all my inner fears","I thought my cool self would send your cool self a big, HELLO!","Friends are like medicine; they make you feel better when you're down. Here's a dose of friendship to speed up your recovery!","You reached for the stars and made it! A big congrats for reaching your goal","This song that I send to you was chosen with great care, and nestled within its word is my whisper, I Love You...","Within you I lose myself...Without you I find myself…wanting to be lost again.","I confess... I spend a lot of time just thinking about you!","I can't believe I forgot to ask something so incredibly important...will you please forgive me?","Roses are red, violets are blue, sugar is sweet, and so are you. But the roses are wilting, the violets are dead, the sugar bowl's empty and so is your head.","My Greatest wish for the two of you is that through the years your love for each other will so deepen and grow, that years from now you will look back on this day, your wedding day, as the day you loved each other the least. Hearty Congratulations on your marriage","Message Other");function onChangeSubject()
{var category=document.getElementById("subjectType").value;if(category!=(typeArray.length-1))
{document.getElementById("message").value=messageArray[category];document.getElementById("subject").value=typeArray[category];}
else
{document.getElementById("subject").value="";}
return false;}
function setAgainValues(dedicateAgainTitle,dedicateAgainMessage,dedicateAgainCategory)
{if(dedicateAgainTitle!="")
{dedicationForm.message.value=dedicateAgainMessage;dedicationForm.subject.value=dedicateAgainTitle;dedicationForm.subjectType.selectedIndex=dedicateAgainCategory;}}
function populateSubjectData(currentCategory)
{for(i=0;i<typeArray.length;i++)
{if(currentCategory==i){document.writeln("<option value=\""+i+"\" selected>"+typeArray[i]);}else{document.writeln("<option value=\""+i+"\">"+typeArray[i]);}}}
function changeCategory(category){searchTerm=category;var searchText=document.getElementById("searchText").value;var basicUrl="/search?searchtype="+searchTerm+"&q="+searchText+"&commit=Search";document.getElementById("searchForm").action=basicUrl;document.getElementById("searchtype").value=category;switch(category)
{case"album":document.getElementById("album").className="active";document.getElementById("song").className="";document.getElementById("mgreeting").className="";document.getElementById("video").className="";document.getElementById("photo").className="";document.getElementById("news").className="";document.getElementById("user").className="";document.getElementById("smartlist").className="";document.getElementById("tag").className="";break;case"song":document.getElementById("album").className="";document.getElementById("song").className="active";document.getElementById("mgreeting").className="";document.getElementById("video").className="";document.getElementById("photo").className="";document.getElementById("news").className="";document.getElementById("user").className="";document.getElementById("smartlist").className="";document.getElementById("tag").className="";break;case"mgreeting":document.getElementById("album").className="";document.getElementById("song").className="";document.getElementById("mgreeting").className="active";document.getElementById("video").className="";document.getElementById("photo").className="";document.getElementById("news").className="";document.getElementById("user").className="";document.getElementById("smartlist").className="";document.getElementById("tag").className="";break;case"user":document.getElementById("album").className="";document.getElementById("song").className="";document.getElementById("mgreeting").className="";document.getElementById("video").className="";document.getElementById("photo").className="";document.getElementById("news").className="";document.getElementById("user").className="active";document.getElementById("smartlist").className="";document.getElementById("tag").className="";break;case"singer":document.getElementById("album").className="";document.getElementById("song").className="";document.getElementById("mgreeting").className="";document.getElementById("user").className="";document.getElementById("singer").className="active";document.getElementById("smartlist").className="";document.getElementById("tag").className="";break;case"smartlist":document.getElementById("album").className="";document.getElementById("song").className="";document.getElementById("mgreeting").className="";document.getElementById("video").className="";document.getElementById("photo").className="";document.getElementById("news").className="";document.getElementById("user").className="";document.getElementById("smartlist").className="active";document.getElementById("tag").className="";break;case"video":document.getElementById("album").className="";document.getElementById("song").className="";document.getElementById("mgreeting").className="";document.getElementById("video").className="active";document.getElementById("photo").className="";document.getElementById("news").className="";document.getElementById("user").className="";document.getElementById("smartlist").className="";document.getElementById("tag").className="";break;case"photo":document.getElementById("album").className="";document.getElementById("song").className="";document.getElementById("mgreeting").className="";document.getElementById("video").className="";document.getElementById("photo").className="active";document.getElementById("news").className="";document.getElementById("user").className="";document.getElementById("smartlist").className="";document.getElementById("tag").className="";break;case"news":document.getElementById("album").className="";document.getElementById("song").className="";document.getElementById("mgreeting").className="";document.getElementById("video").className="";document.getElementById("photo").className="";document.getElementById("news").className="active";document.getElementById("user").className="";document.getElementById("smartlist").className="";document.getElementById("tag").className="";break;case"tag":document.getElementById("album").className="";document.getElementById("song").className="";document.getElementById("mgreeting").className="";document.getElementById("video").className="";document.getElementById("photo").className="";document.getElementById("news").className="";document.getElementById("user").className="";document.getElementById("smartlist").className="";document.getElementById("tag").className="active";break;default:}}