String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")
};
String.prototype.ltrim=function(){return this.replace(/^\s+/,"")
};
String.prototype.rtrim=function(){return this.replace(/\s+$/,"")
};
var hostname=top.location.host;
var scheme=("https:"==document.location.protocol)?"https://":"http://";
function showSearchChoices(){if(document.getElementById("searchTypes").style.visibility=="hidden"||document.getElementById("searchTypes").style.visibility==""){document.getElementById("searchTypes").style.visibility="visible";
document.getElementById("magnifyingGlass").src=scheme+hostname+"/images/s2.png"
}if(document.getElementById("searchType").value==""){document.getElementById("searchArrow").src=scheme+hostname+"/images/d2.png"
}else{document.getElementById("searchArrow").src=scheme+hostname+"/images/r2.png"
}}function freeze(C,A,B){C.style.backgroundColor="#2CAF2B";
document.getElementById(A).style.backgroundColor="#FFFFFF";
document.getElementById("searchType").value=B;
document.getElementById("searchArrow").src=scheme+hostname+"/images/r2.png";
document.getElementById("keywords").focus()
}function settleSearch(){if(document.getElementById("keywords").value==""){document.getElementById("searchArrow").src=scheme+hostname+"/images/r1.png";
document.getElementById("magnifyingGlass").src=scheme+hostname+"/images/s1.png";
document.getElementById("searchTypes").style.visibility="hidden"
}}function submitSearch(){if(document.getElementById("searchType").value=="google"||document.getElementById("searchType").value==""){googleSearch(document.getElementById("keywords").value);
return false
}if(document.getElementById("searchType").value=="general"){var A=document.getElementById("search");
A.action="http://"+hostname+"/search";
A.submit()
}}function gup(C,B){B=B.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var A="[\\?&]"+B+"=([^&#]*)";
var E=new RegExp(A);
var D=E.exec(C);
if(D==null){return""
}else{return D[1]
}}function setOpacity(B,A){document.getElementById(A).style.opacity=B/10;
document.getElementById(A).style.filter="alpha(opacity="+B*10+")"
}function fadeInMyPopup(B){for(var A=0;
A<=100;
A++){setTimeout("setOpacity("+(A/10)+',"'+B+'")',7*A)
}}function fadeOutMyPopup(B){for(var A=0;
A<=100;
A++){setTimeout("setOpacity("+(10-A/10)+',"'+B+'")',7*A)
}}function toggleSearchMenu(C){var B=document.getElementById("moreMenu");
var A=document.getElementById("lessMenu");
if(C=="more"){B.style.zIndex=2;
A.style.zIndex=-1;
B.style.visibility="visible";
A.style.visibility="hidden";
fadeInMyPopup("moreMenu");
if(document.getElementById("tags").length>0){if(document.getElementById("tags").options[0].text==""){document.getElementById("tags").options[0]=null
}}}else{B.style.zIndex=-1;
A.style.zIndex=2;
fadeOutMyPopup("moreMenu");
setTimeout('document.getElementById("moreMenu").style.visibility = "hidden"',700);
A.style.visibility="visible"
}}function updateCart(B,I){var E=gup(B.href,"static");
var J=gup(B.href,"what");
var C=gup(B.href,"which");
var F=gup(B.href,"key");
var G=gup(B.href,"notLoggedIn");
var A="http://"+I+"/updateCart?static="+E+"&which="+C+"&what="+J+"&key="+F+"&notLoggedIn="+G;
B.href="return false;";
var D=false;
if(window.XMLHttpRequest){D=new XMLHttpRequest();
if(D.overrideMimeType){D.overrideMimeType("text/xml")
}}else{if(window.ActiveXObject){try{D=new ActiveXObject("Msxml2.XMLHTTP")
}catch(H){try{D=new ActiveXObject("Microsoft.XMLHTTP")
}catch(H){}}}}if(!D){alert("Giving up :( Cannot create an XMLHTTP instance");
return false
}D.onreadystatechange=function(){displayCart(D)
};
D.open("GET",A,true);
D.send(null)
}function displayCart(H){if(H.readyState==4){var G=H.responseXML;
var J=G.getElementsByTagName("span");
var A="";
var D="";
var B="";
var I=null;
for(i=0;
i<J.length;
i++){if(J[i].getAttribute("id")=="isCartEmpty"){A=J[i].childNodes[0].nodeValue
}if(J[i].getAttribute("id")=="currentSong"){D=J[i].childNodes[0].nodeValue
}if(J[i].getAttribute("id")=="itemCount"){B=J[i].childNodes[0].nodeValue
}if(J[i].getAttribute("id")=="total"&&J[i].childNodes[0]&&J[i].childNodes[0].nodeValue.length>0){I=J[i].childNodes[0].nodeValue
}else{if(J[i].getAttribute("id")=="total"&&J[i].childNodes[0]&&J[i].childNodes[0].nodeValue.length==0){I="0.00"
}}if(J[i].getAttribute("id")=="shoppingCart"){var M=J[i].getElementsByTagName("a");
var O=null;
var F=null;
var L=null;
var C=null;
var N=null;
var E=null;
for(j=0;
j<M.length;
j++){if(M[j].getAttribute("id")=="ogg_"+D){O=M[j];
L=O.getElementsByTagName("span")[0].getAttribute("class");
N='<a id="'+O.getAttribute("id")+'" onmouseout="doQtip(this);" onmouseover="doQtip(this);" href="'+O.getAttribute("href")+'" title="'+O.getAttribute("title")+'" ><span class="'+L+'">'+((L=="addToCart")?"+":"-")+"</span> OGG</a>"
}if(M[j].getAttribute("id")=="flac"+D){F=M[j];
C=F.getElementsByTagName("span")[0].getAttribute("class");
E='<a id="'+F.getAttribute("id")+'" onmouseout="doQtip(this);" onmouseover="doQtip(this);" href="'+F.getAttribute("href")+'" title="'+F.getAttribute("title")+'" ><span class="'+C+'">'+((C=="addToCart")?"+":"-")+"</span> FLAC</a>"
}$("#"+M[j].getAttribute("id")).qtip("hide")
}var K=N+' <span class="bold">-or-</span> '+E;
document.getElementById("addRemoveLink"+D).innerHTML=K
}}if(A=="no"){document.getElementById("itemCountTop").innerHTML=B;
document.getElementById("priceTop").innerHTML=I;
document.getElementById("itemCountBottom").innerHTML=B;
document.getElementById("priceBottom").innerHTML=I;
toggleCheckout("visible")
}else{document.getElementById("itemCountTop").innerHTML="";
document.getElementById("priceTop").innerHTML="";
document.getElementById("itemCountBottom").innerHTML="";
document.getElementById("priceBottom").innerHTML="";
toggleCheckout("hidden")
}if(D==null){alert("current song should never be null.")
}addRemoveHooks(document.getElementById("addRemoveLink"+D))
}}function doQtip(A){$("#"+A.getAttribute("id")).qtip({position:{corner:{target:"topMiddle",tooltip:"bottomLeft"}},style:{width:200,height:53,verticalAlign:"middle",padding:5,background:"#DDD",color:"black",textAlign:"center",border:{width:5,radius:3,color:"#DDD"},tip:{corner:"bottomLeft"}}});
$("#"+A.getAttribute("id")).qtip("api").updateContent(A.getAttribute("title"),false)
}function updateCartNotLoggedIn(C,A){var G=gup(C.href,"static");
var F=gup(C.href,"what");
var E=gup(C.href,"key");
var D=gup(C.href,"notLoggedIn");
var B="http://"+A+"/updateCart?static="+G+"&which=add&what="+F+"&key="+E+"&notLoggedIn="+D;
top.location=B
}function viewCart(B,H){var C=gup(B.getAttribute("href"),"static");
var I=gup(B.getAttribute("href"),"what");
var D=gup(B.getAttribute("href"),"key");
var F=gup(B.getAttribute("href"),"notLoggedIn");
var A="http://"+H+"/updateCart?static="+C+"&which=remove&what="+I+"&key="+D+"&notLoggedIn="+F;
B.href="return false;";
var E=false;
if(window.XMLHttpRequest){E=new XMLHttpRequest();
if(E.overrideMimeType){E.overrideMimeType("text/xml")
}}else{if(window.ActiveXObject){try{E=new ActiveXObject("Msxml2.XMLHTTP")
}catch(G){try{E=new ActiveXObject("Microsoft.XMLHTTP")
}catch(G){}}}}if(!E){alert("Giving up :( Cannot create an XMLHTTP instance");
return false
}E.onreadystatechange=function(){displayViewCart(E)
};
E.open("GET",A,true);
E.send(null)
}function displayViewCart(G){if(G.readyState==4){var F=G.responseXML;
var I=F.getElementsByTagName("span");
var A="";
var D="";
var B="";
var J="";
var H=null;
var L="";
for(i=0;
i<I.length;
i++){if(I[i].getAttribute("id")=="isCartEmpty"){A=I[i].childNodes[0].nodeValue
}if(I[i].getAttribute("id")=="currentSong"){D=I[i].childNodes[0].nodeValue
}if(I[i].getAttribute("id")=="itemCount"){B=I[i].childNodes[0].nodeValue
}if(I[i].getAttribute("id")=="total"&&I[i].childNodes[0]&&I[i].childNodes[0].nodeValue.length>0){L=I[i].childNodes[0].nodeValue
}else{if(I[i].getAttribute("id")=="total"&&I[i].childNodes[0]&&I[i].childNodes[0].nodeValue.length==0){L="0.00"
}}if(I[i].getAttribute("id")=="shoppingCart"){var C=I[i].childNodes[0].nodeValue.split(":");
var E=C[0];
var K=C[1];
document.getElementById("item"+E+K).innerHTML=""
}}document.getElementById("totalPrice").innerHTML="Total: $"+L;
if(A=="no"){document.getElementById("itemCountTop").innerHTML=B;
document.getElementById("priceTop").innerHTML=L;
document.getElementById("itemCountBottom").innerHTML=B;
document.getElementById("priceBottom").innerHTML=L;
toggleCheckout("visible")
}else{document.getElementById("itemCountTop").innerHTML="";
document.getElementById("priceTop").innerHTML="";
document.getElementById("itemCountBottom").innerHTML="";
document.getElementById("priceBottom").innerHTML="";
toggleCheckout("hidden")
}}}function setValue(){document.getElementById("fieldValue").value=document.getElementById("fieldName").value
}function confirmSubmit(C){if(confirm(C)){var B=document.getElementById("fieldName");
for(var A=0;
A<B.options.length;
A++){if(B.options[A].selected==true){B.options[A].value=B.options[A].text;
break
}}document.getElementById("utilities").submit()
}}function confirmEmailBlast(A){if(confirm(A)){document.emailBlast.submit()
}}function showRawSurveyResults(A,F,D){var C=false;
if(window.XMLHttpRequest){C=new XMLHttpRequest();
if(C.overrideMimeType){C.overrideMimeType("text/xml")
}}else{if(window.ActiveXObject){try{C=new ActiveXObject("Msxml2.XMLHTTP")
}catch(E){try{C=new ActiveXObject("Microsoft.XMLHTTP")
}catch(E){}}}}if(!C){alert("Giving up :( Cannot create an XMLHTTP instance");
return false
}C.onreadystatechange=function(){showSurveyResults(C)
};
var B="surveyVote?sid="+A+"&qid="+F+"&date="+D+"&aid=passThrough";
C.open("GET",B,true);
C.send(null)
}function changeMode(C,F,G,E){var B=false;
if(window.XMLHttpRequest){B=new XMLHttpRequest();
if(B.overrideMimeType){B.overrideMimeType("text/xml")
}}else{if(window.ActiveXObject){try{B=new ActiveXObject("Msxml2.XMLHTTP")
}catch(D){try{B=new ActiveXObject("Microsoft.XMLHTTP")
}catch(D){}}}}if(!B){alert("Giving up :( Cannot create an XMLHTTP instance");
return false
}B.onreadystatechange=function(){showDemoResults(B)
};
var A=C+"?which="+F+"&id="+G+"&mode="+E;
B.open("GET",A,true);
B.send(null)
}function showDemoResults(A){if(A.readyState==4){var C=A.responseXML;
var D=C.getElementsByTagName("songid")[0].childNodes[0].nodeValue;
var B=C.getElementsByTagName("results")[0].childNodes[0].nodeValue;
document.getElementById(D).innerHTML=B
}}function submitSurvey(G){var F=false;
if(window.XMLHttpRequest){F=new XMLHttpRequest();
if(F.overrideMimeType){F.overrideMimeType("text/xml")
}}else{if(window.ActiveXObject){try{F=new ActiveXObject("Msxml2.XMLHTTP")
}catch(H){try{F=new ActiveXObject("Microsoft.XMLHTTP")
}catch(H){}}}}if(!F){alert("Giving up :( Cannot create an XMLHTTP instance");
return false
}F.onreadystatechange=function(){showSurveyResults(F)
};
var E=G.action;
var B=G.sid.value;
var I=G.qid.value;
var D=G.date.value;
var J=G.answer;
var C="";
for(i=0;
i<J.length;
i++){if(J[i].checked){C=J[i].value;
break
}}var A=E+"?sid="+B+"&qid="+I+"&date="+D+"&aid="+C;
F.open("GET",A,true);
F.send(null)
}function showSurveyResults(A){if(A.readyState==4){document.getElementById("survey").innerHTML=A.responseText
}}function checkTrackPreview(){if(document.getElementById("preview").checked==true){document.getElementById("timeSlice").innerHTML="<br />Choose time slice:<br />(example. 01:05 - 00:37)<br />Start Time = 1 min 5 seconds.<br />Length = 37 seconds of preview";
document.getElementById("previewTime").innerHTML='<input type="text" name="startMin" size="2" maxlength="2" value="MM" onfocus="this.value=\'\'"/>:<input type="text" name="startSec" size="2" maxlength="2" value="SS" onfocus="this.value=\'\'"/> - <input type="text" name="endMin" size="2" maxlength="2" value="MM" onfocus="this.value=\'\'"/>:<input type="text" name="endSec" size="2" maxlength="2" value="SS" onfocus="this.value=\'\'"/>'
}else{document.getElementById("timeSlice").innerHTML="";
document.getElementById("previewTime").innerHTML=""
}}function editSelectList(C,A,B){if(C=="add"){document.getElementById(B).options[document.getElementById(B).options.length]=new Option(document.getElementById(A).value,document.getElementById(A).value);
document.getElementById(A).value=""
}else{document.getElementById(A).value=document.getElementById(B).options[document.getElementById(B).selectedIndex].value;
document.getElementById(B).options[document.getElementById(B).selectedIndex]=null
}}function selectSelectLists(B,A){var C=document.getElementById(B);
for(i=0;
i<C.length;
i++){C.options[i].selected=true
}if(A){document.forms[A].submit()
}}function checkRadioSelection(){var B=document.getElementById("extendedSearch");
var C=B.keywordType;
var A=false;
for(i=0;
i<C.length;
i++){if(C[i].checked){A=true;
break
}}if(A){B.submit()
}else{alert("You must choose one of the options (radio buttons).")
}}function checkCountry(A){if(A=="new"){document.getElementById("newCountry").style.paddingTop="5px";
document.getElementById("newCountryLabel").style.paddingTop="5px";
document.getElementById("newCountry").innerHTML='<input type="text" name="newCountry" />';
document.getElementById("newCountryLabel").innerHTML="New Country:"
}else{document.getElementById("newCountry").style.paddingTop="0px";
document.getElementById("newCountryLabel").style.paddingTop="0px";
document.getElementById("newCountry").innerHTML="";
document.getElementById("newCountryLabel").innerHTML=""
}}function validateDate(E){var C=E.split("/");
var D=C[0];
var A=C[1];
var B=C[2];
if(isNaN(D)||isNaN(A)||isNaN(B)){alert("bad numbers");
return false
}if(D<1||D>12){alert("bad month");
return false
}if(A<1||A>31){alert("bad day");
return false
}if(D==2&&A>29&&(B%4==0)){alert("not leap year");
return false
}if(((parseInt(D,10)!=1)&&(parseInt(D,10)!=3)&&(parseInt(D,10)!=5)&&(parseInt(D,10)!=7)&&(parseInt(D,10)!=8)&&(parseInt(D)!=10)&&(parseInt(D)!=12))&&parseInt(A)>30){alert("no such day of month");
return false
}return true
}function validateEmail(A){if(A.value==""){alert("email cannot be blank.");
return false
}if(A.indexOf("@")<0){alert("Email "+A+" must contain the '@' character.\n");
return false
}if(A.indexOf("@")==0){alert("Email  "+A+" cannot start with the '@' character.\n");
return false
}if(A.indexOf("@")!=A.lastIndexOf("@")){alert("Email address "+A+" cannot have more than one '@' character.\n");
return false
}if(A.indexOf(" ")>=0){alert("Email address "+A+" cannot contain a space.\n");
return false
}if(A.lastIndexOf(".")<A.lastIndexOf("@")){alert("Email address "+A+" must contain a domain suffix (i.e. abc@xyz.com)\n");
return false
}if(A.lastIndexOf("@")==(A.length-1)){alert("Email address"+A+" cannot end with the '@'character.\n");
return false
}if(A.lastIndexOf(".")==(A.length-1)){alert("Email address"+A+" cannot end with the '.'character.\n");
return false
}return true
}function validateLoginForm(A){if(validateEmail(A.j_username.value)){if(A.j_password.value.length<=15){A.submit()
}else{alert("the password is too long.")
}}}function validateVote(C){var B=C.answer;
var A=false;
for(i=0;
i<B.length;
i++){if(B[i].checked){A=true;
break
}}if(A){submitSurvey(C)
}else{alert("Please select an option to vote.")
}}function toggleCheckout(B){var C=document.getElementById("topCheckout");
if(B=="visible"){C.style.visibility="visible";
fadeInMyPopup("topCheckout")
}else{C.style.visibility="hidden";
fadeOutMyPopup("topCheckout");
setTimeout('document.getElementById("topCheckout").style.visibility = "hidden"',700)
}if(document.getElementById("bottomCheckout")!=null){var A=document.getElementById("bottomCheckout");
if(B=="visible"){A.style.visibility="visible";
fadeInMyPopup("bottomCheckout")
}else{A.style.visibility="hidden";
fadeOutMyPopup("bottomCheckout");
setTimeout('document.getElementById("bottomCheckout").style.visibility = "hidden"',700)
}}}function showTerms(){var A=document.forms[0].regType;
for(i=0;
i<A.length;
i++){if(A[i].value=="artist"&&A[i].checked==true){toggleTerms("artist");
return 
}}toggleTerms("listener")
}function toggleTerms(A){var B=document.getElementById("terms");
var C=document.getElementById("scratch");
if(A=="artist"){B.style.visibility="visible";
B.innerHTML=C.innerHTML;
C.innerHTML=""
}else{B.style.visibility="hidden";
if(B.innerHTML.replace(/^\s+/g,"").replace(/\s+$/g,"").length>0){C.innerHTML=B.innerHTML
}B.innerHTML=""
}}function toggleBio(){var A=document.getElementById("bioArea");
var B=document.getElementById("scratch");
var C=document.getElementById("plus");
if(A.style.visibility=="hidden"){A.style.visibility="visible";
C.innerHTML="-";
A.innerHTML=B.innerHTML;
B.innerHTML=""
}else{A.style.visibility="hidden";
C.innerHTML="+";
B.innerHTML=A.innerHTML;
A.innerHTML=""
}}function toggleArtist(){var B=document.getElementById("bioArea");
var A=document.getElementById("addArtist");
var C=document.getElementById("plus2");
if(B.style.visibility=="hidden"){B.style.visibility="visible";
C.innerHTML="-";
B.innerHTML=A.innerHTML;
A.innerHTML=""
}else{B.style.visibility="hidden";
C.innerHTML="+";
A.innerHTML=B.innerHTML;
B.innerHTML=""
}}function displayReviewForm(C,A){var B=document.getElementById(C);
var D="<form id='reviewForm' name='reviewForm' action='http://"+A+"/review' method='post'>\n";
D+="<fieldset id='songReviewFieldset'>";
D+='<legend>Review &amp; Tag: <span id="helpLink"><a href="help?page=reviewAndTag">Help</a></span></legend>';
D+="<input type='hidden' name='item' value='"+C+"' />\n";
D+='<div class="formRow">';
D+='<label for="review">Review:</label>';
D+='<span class="formInput">';
D+='<textarea id="review" rows="4" cols="40" name="review"></textarea>';
D+="</span>";
D+="</div>";
D+='<div class="formRow">';
D+='<label for="review">Tags:</label>';
D+='<span class="formInput" id="tagControls">';
D+='<span id="tagInput"><input type="text" name="tag" id="tag" /></span>';
D+='<span id="tagAddRemove"><input type="button" value="  &gt;&gt;  " onclick="editSelectList(\'add\',\'tag\',\'tags\');" class="button" /><br />';
D+='<input type="button" value="  &lt;&lt;  " onclick="editSelectList(\'del\',\'tag\',\'tags\');" class="button" /></span>';
D+='<span id="tagOutput"><select id="tags" name="tags" multiple="multiple" size="4"></select></span>';
D+="</span>";
D+="</div>";
D+='<div class="formRow">';
D+='<span class="formInput" id="submitButtonRow">';
D+='<input type="button" value="Review &amp; Tag" onclick="selectSelectLists(\'tags\',\'reviewForm\');" class="button" /> ';
D+='<input type="hidden" name="thanks" value="true" />';
D+='<input type="submit" value="No Thanks" class="button" onclick="this.form.thanks.value=\'false\';"/>';
D+="</span>";
D+="</div>";
D+="</fieldset>";
D+="</form>";
B.innerHTML=D
}function demoCapGetInput(D,B){var C=document.getElementById("demoCap"+D);
var A='<input type="text" id="demoCapInput'+D+'" value="'+B+'" size="5" />';
A+='&nbsp;&nbsp;<input type="button" value="Update" onclick="demoCapUpdate(\'demoCapUpdate\',\''+D+"');\" />";
C.innerHTML=A
}function demoCapUpdate(C,E){var B=false;
if(window.XMLHttpRequest){B=new XMLHttpRequest();
if(B.overrideMimeType){B.overrideMimeType("text/xml")
}}else{if(window.ActiveXObject){try{B=new ActiveXObject("Msxml2.XMLHTTP")
}catch(D){try{B=new ActiveXObject("Microsoft.XMLHTTP")
}catch(D){}}}}if(!B){alert("Giving up :( Cannot create an XMLHTTP instance");
return false
}B.onreadystatechange=function(){showResults(B,"demoCap",null)
};
var A=C+"?song="+E+"&cap="+document.getElementById("demoCapInput"+E).value;
B.open("GET",A,true);
B.send(null)
}function showUploadProgress(){document.getElementById("uploadProgress").style.visibility="visible";
reloadProgress()
}function reloadProgress(){var A=new Date();
document.getElementById("uploadProgress").src="uploadProgress?time="+A.getTime();
t=setTimeout("reloadProgress()",1000)
}function previewSong(C,A){C.innerHTML="";
var E=C.id.substring(7,43);
var D=C.id.substring(43);
var B=document.createElement("object");
if(navigator.appName=="Microsoft Internet Explorer"){var G="<object id='obj-"+E+"' ";
G+=" classid='clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA' ";
G+=" width='150' height='15' > ";
G+=" <param name='code' value='com.fluendo.player.Cortado.class'/> ";
G+=" <param name='archive' value='http://"+A+"/player/"+E+"/cortado.jar'/> ";
G+="  <param name='url' value='http://"+A+"/preview?song="+E+"' /> ";
G+=" <param name='audio' value='true'/> ";
G+=" <param name='bufferSize' value='100'/> ";
G+=" <param name='autoPlay' value='true' /> ";
G+=" <param name='duration' value='"+D+"' /> ";
G+=" <param name='showStatus' value='true'/> ";
G+=" <param name='statusHeight' value='15'/> ";
G+="  <param name='seekable' value='false' /> ";
G+="  <param name='standby' value='Loading Player...' /> ";
G+=" </object> ";
C.innerHTML=G
}else{B.setAttribute("type","application/x-java-applet;version=1.5");
B.setAttribute("archive","http://"+A+"/player/"+E+"/cortado.jar");
B.setAttribute("width","150");
B.setAttribute("height","15");
var F=document.createElement("param");
F.setAttribute("name","code");
F.setAttribute("value","com.fluendo.player.Cortado.class");
B.appendChild(F);
F=document.createElement("param");
F.setAttribute("name","archive");
F.setAttribute("value","http://"+A+"/player/"+E+"/cortado.jar");
B.appendChild(F);
F=document.createElement("param");
F.setAttribute("name","url");
F.setAttribute("value","http://"+A+"/preview?song="+E);
B.appendChild(F);
F=document.createElement("param");
F.setAttribute("name","audio");
F.setAttribute("value","true");
B.appendChild(F);
F=document.createElement("param");
F.setAttribute("name","bufferSize");
F.setAttribute("value","100");
B.appendChild(F);
F=document.createElement("param");
F.setAttribute("name","autoPlay");
F.setAttribute("value","true");
B.appendChild(F);
F=document.createElement("param");
F.setAttribute("name","duration");
F.setAttribute("value",length);
B.appendChild(F);
F=document.createElement("param");
F.setAttribute("name","showStatus");
F.setAttribute("value","true");
B.appendChild(F);
F=document.createElement("param");
F.setAttribute("name","statusHeight");
F.setAttribute("value","15");
B.appendChild(F);
F=document.createElement("param");
F.setAttribute("name","seekable");
F.setAttribute("value","false");
B.appendChild(F);
F=document.createElement("param");
F.setAttribute("name","standby");
F.setAttribute("value","Loading Player...");
B.appendChild(F);
C.appendChild(B)
}}function doRank(N,G,B,I){var M,L,K,J,H;
var E,D;
if(B.search("r1")!=-1){E=1;
M=B;
D=B.replace("r1","");
L=B.replace("r1","r2");
K=B.replace("r1","r3");
J=B.replace("r1","r4");
H=B.replace("r1","r5")
}if(B.search("r2")!=-1){E=2;
L=B;
D=B.replace("r2","");
M=B.replace("r2","r1");
K=B.replace("r2","r3");
J=B.replace("r2","r4");
H=B.replace("r2","r5")
}if(B.search("r3")!=-1){E=3;
K=B;
D=B.replace("r3","");
L=B.replace("r3","r2");
M=B.replace("r3","r1");
J=B.replace("r3","r4");
H=B.replace("r3","r5")
}if(B.search("r4")!=-1){E=4;
J=B;
D=B.replace("r4","");
L=B.replace("r4","r2");
K=B.replace("r4","r3");
M=B.replace("r4","r1");
H=B.replace("r4","r5")
}if(B.search("r5")!=-1){E=5;
H=B;
D=B.replace("r5","");
L=B.replace("r5","r2");
K=B.replace("r5","r3");
J=B.replace("r5","r4");
M=B.replace("r5","r1")
}switch(B){case H:document.getElementById(H).src=G;
case J:document.getElementById(J).src=G;
case K:document.getElementById(K).src=G;
case L:document.getElementById(L).src=G;
case M:document.getElementById(M).src=G
}if(N=="click"){document.getElementById(M).onmouseover=null;
document.getElementById(M).onmouseout=null;
document.getElementById(M).onclick=null;
document.getElementById(L).onmouseover=null;
document.getElementById(L).onmouseout=null;
document.getElementById(L).onclick=null;
document.getElementById(K).onmouseover=null;
document.getElementById(K).onmouseout=null;
document.getElementById(K).onclick=null;
document.getElementById(J).onmouseover=null;
document.getElementById(J).onmouseout=null;
document.getElementById(J).onclick=null;
document.getElementById(H).onmouseover=null;
document.getElementById(H).onmouseout=null;
document.getElementById(H).onclick=null;
var C=false;
if(window.XMLHttpRequest){C=new XMLHttpRequest();
if(C.overrideMimeType){C.overrideMimeType("text/xml")
}}else{if(window.ActiveXObject){try{C=new ActiveXObject("Msxml2.XMLHTTP")
}catch(F){try{C=new ActiveXObject("Microsoft.XMLHTTP")
}catch(F){}}}}if(!C){alert("Giving up :( Cannot create an XMLHTTP instance");
return false
}C.onreadystatechange=function(){showResults(C,"rankStats",E)
};
D=D.substring(4);
var A="http://"+I+"/rankSong?songid="+D+"&rank="+E;
C.open("GET",A,true);
C.send(null)
}}function showResults(C,B,H){if(C.readyState==4){var F=C.responseXML;
var G=F.getElementsByTagName("songid")[0].childNodes[0].nodeValue;
var D=F.getElementsByTagName("results")[0].childNodes[0].nodeValue;
if(H!=null){var A="";
if(hostname.indexOf("earthbeats")==-1){hostname=hostname+"/earthbeats"
}switch(H){case 1:A+='<img src="http://'+hostname+'/images/bongo.gif" />';
break;
case 2:A+='<img src="http://'+hostname+'/images/bongo.gif" />';
A+='<img src="http://'+hostname+'/images/bongo.gif" />';
break;
case 3:A+='<img src="http://'+hostname+'/images/bongo.gif" />';
A+='<img src="http://'+hostname+'/images/bongo.gif" />';
A+='<img src="http://'+hostname+'/images/bongo.gif" />';
break;
case 4:A+='<img src="http://'+hostname+'/images/bongo.gif" />';
A+='<img src="http://'+hostname+'/images/bongo.gif" />';
A+='<img src="http://'+hostname+'/images/bongo.gif" />';
A+='<img src="http://'+hostname+'/images/bongo.gif" />';
break;
case 5:A+='<img src="http://'+hostname+'/images/bongo.gif" />';
A+='<img src="http://'+hostname+'/images/bongo.gif" />';
A+='<img src="http://'+hostname+'/images/bongo.gif" />';
A+='<img src="http://'+hostname+'/images/bongo.gif" />';
A+='<img src="http://'+hostname+'/images/bongo.gif" />';
break
}var E=D;
if(A!=""){E=A+"<br />"+D
}$("#"+B+G).qtip("api").updateContent(E,false)
}document.getElementById(B+G).innerHTML=D
}}function downloadDemo(B,A){B.style.visibility="hidden";
document.location="http://"+A+"/downloadDemo?songid="+B.id.substring(4)
}function addToCartWidget(B,C,A,D){document.getElementById("cartWidgetList").options[document.getElementById("cartWidgetList").options.length]=new Option(C,B);
writeCartWidget(A,D)
}function removeFromCartWidget(C,A,D){var B=document.getElementById("cartWidgetList");
for(i=0;
i<B.length;
i++){if(B.options[i].value==C){B.options[i]=null
}}if(B.length==0){document.getElementById("cartWidget").value=""
}else{writeCartWidget(A,D)
}}function writeCartWidget(A,D){var C="<object ";
C+='data="http://'+A+"/songs/artist/"+D+"?";
var B=document.getElementById("cartWidgetList");
for(i=0;
i<B.length;
i++){C+="title="+B.options[i].value+"&"
}C=C.substring(0,(C.length)-1)+'"';
C+=' type="text/html" ';
C+=' id="myCart" ';
C+=' width="210" ';
C+=' height="'+(140*B.length)+'" ';
C+=">Dude! I couldn't load the shopping cart now :(</object>";
document.getElementById("cartWidget").value=C
}if(hostname.indexOf("earthbeats")==-1){hostname=hostname+"/earthbeats"
}function addRemoveHooks(A){if(A){var B=A.getElementsByTagName("a");
if(B){for(i=0;
i<B.length;
i++){if(gup(B[i].href,"notLoggedIn")){B[i].onclick=function(D){var C;
if(!D){var D=window.event
}if(D.target){C=D.target
}else{if(D.srcElement){C=D.srcElement
}}if(C.nodeType==3){C=C.parentNode
}updateCartNotLoggedIn(C,hostname)
}
}else{B[i].onclick=function(D){var C;
if(!D){var D=window.event
}if(D.target){C=D.target
}else{if(D.srcElement){C=D.srcElement
}}if(C.nodeType==3){C=C.parentNode
}if(C.href){updateCart(C,hostname)
}else{updateCart(C.parentNode,hostname)
}return false
}
}if(B[i].captureEvents){B[i].captureEvents(Event.Click)
}}}}}$(document).ready(function(){var I=[];
var F=[];
var E=[];
var G=[];
var D=[];
var A=document.getElementsByTagName("div");
for(var B=0;
B<A.length;
B++){if(A[B].className=="rank"){I.push(A[B])
}}for(var B=0;
B<A.length;
B++){if(A[B].className=="previewLink"){F.push(A[B])
}}for(var B=0;
B<A.length;
B++){if(A[B].className=="addRemoveLink"){G.push(A[B])
}}for(var B=0;
B<A.length;
B++){if(A[B].className=="cartRow"){D.push(A[B])
}}for(var B=0;
B<A.length;
B++){if(A[B].className=="demoLink"){E.push(A[B])
}}var H=document.getElementsByTagName("a");
for(B=0;
B<H.length;
B++){if(H[B].id.substring(0,4)=="flac"||H[B].id.substring(0,4)=="ogg_"||H[B].id.substring(0,4)=="item"){$("#"+H[B].id).qtip({position:{corner:{target:"topMiddle",tooltip:"bottomLeft"}},style:{width:200,height:53,verticalAlign:"middle",padding:5,background:"#DDD",color:"black",textAlign:"center",border:{width:5,radius:3,color:"#DDD"},tip:{corner:"bottomLeft"}}})
}if(H[B].id.substring(0,4)=="demo"){$("#"+H[B].id).qtip({position:{corner:{target:"topMiddle",tooltip:"bottomLeft"}},style:{width:200,height:53,verticalAlign:"middle",padding:5,background:"#DDD",color:"black",textAlign:"center",border:{width:5,radius:3,color:"#DDD"},tip:{corner:"bottomLeft"}}})
}if(H[B].id.substring(0,7)=="preview"){$("#"+H[B].id).qtip({position:{corner:{target:"topMiddle",tooltip:"bottomLeft"}},style:{width:200,height:53,verticalAlign:"middle",padding:5,background:"#DDD",color:"black",textAlign:"center",border:{width:5,radius:3,color:"#DDD"},tip:{corner:"bottomLeft"}}})
}if(H[B].id=="chillMode"){$("#chillMode").qtip({content:{title:'<span style="color:#32CD32">Chill Mode:</span>'},position:{corner:{target:"bottomLeft",tooltip:"topRight"}},style:{width:200,height:53,verticalAlign:"middle",padding:5,background:"#DDD",color:"black",textAlign:"center",border:{width:5,radius:3,color:"#DDD"},tip:{corner:"topRight"}}})
}if(H[B].id=="funkMode"){$("#funkMode").qtip({content:{title:'<span style="color:#4B0082>Funk Mode:</span>'},position:{corner:{target:"bottomLeft",tooltip:"topRight"}},style:{width:200,height:53,verticalAlign:"middle",padding:5,background:"#DDD",color:"black",textAlign:"center",border:{width:5,radius:3,color:"#DDD"},tip:{corner:"topRight"}}})
}}if(I.length>0){for(j=0;
j<I.length;
j++){$("#"+I[j].id).qtip({position:{corner:{target:"topMiddle",tooltip:"bottomLeft"}},style:{width:200,height:53,verticalAlign:"middle",padding:5,background:"#DDD",color:"black",textAlign:"center",border:{width:5,radius:3,color:"#DDD"},tip:{corner:"bottomLeft"}}});
var C=I[j].getElementsByTagName("img");
if(C){for(B=0;
B<C.length;
B++){C[B].onclick=function(K){var J;
if(!K){var K=window.event
}if(K.target){J=K.target
}else{if(K.srcElement){J=K.srcElement
}}if(J.nodeType==3){J=J.parentNode
}doRank("click","http://"+hostname+"/images/bongo.gif",J.id,hostname)
};
C[B].onmouseover=function(K){var J;
if(!K){var K=window.event
}if(K.target){J=K.target
}else{if(K.srcElement){J=K.srcElement
}}if(J.nodeType==3){J=J.parentNode
}doRank("over","http://"+hostname+"/images/bongo.gif",J.id,hostname)
};
C[B].onmouseout=function(K){var J;
if(!K){var K=window.event
}if(K.target){J=K.target
}else{if(K.srcElement){J=K.srcElement
}}if(J.nodeType==3){J=J.parentNode
}doRank("out","http://"+hostname+"/images/bongo2.gif",J.id,hostname)
};
if(C[B].captureEvents){C[B].captureEvents(Event.Click)
}if(C[B].captureEvents){C[B].captureEvents(Event.MouseOver)
}if(C[B].captureEvents){C[B].captureEvents(Event.MouseOut)
}}}}}if(E.length>0){for(j=0;
j<E.length;
j++){var H=E[j].getElementsByTagName("a");
if(H){for(B=0;
B<H.length;
B++){H[B].onclick=function(K){var J;
if(!K){var K=window.event
}if(K.target){J=K.target
}else{if(K.srcElement){J=K.srcElement
}}if(J.nodeType==3){J=J.parentNode
}downloadDemo(J,hostname);
return false
};
if(H[B].captureEvents){H[B].captureEvents(Event.Click)
}}}}}if(D.length>0){for(j=0;
j<D.length;
j++){var H=D[j].getElementsByTagName("a");
if(H){for(B=0;
B<H.length;
B++){H[B].onclick=function(K){var J;
if(!K){var K=window.event
}if(K.target){J=K.target
}else{if(K.srcElement){J=K.srcElement
}}if(J.nodeType==3){J=J.parentNode
}if(J.href){viewCart(J,hostname)
}else{viewCart(J.parentNode,hostname)
}return false
};
if(H[B].captureEvents){H[B].captureEvents(Event.Click)
}}}}}if(G.length>0){for(j=0;
j<G.length;
j++){addRemoveHooks(G[j])
}}if(F.length>0){for(j=0;
j<F.length;
j++){var H=F[j].getElementsByTagName("a");
if(H){for(B=0;
B<H.length;
B++){H[B].onclick=function(K){var J;
if(!K){var K=window.event
}if(K.target){J=K.target
}else{if(K.srcElement){J=K.srcElement
}}if(J.nodeType==3){J=J.parentNode
}previewSong(J,hostname);
return false
};
if(H[B].captureEvents){H[B].captureEvents(Event.Click)
}}}}}});