cSongId=false;var TABN=0;function isLogged2(){return getCookieValue("name")&&getCookieValue("c")}function gE(b){return document.getElementById(b)}function getCookieValue(b){for(var c=document.cookie.split("; "),d=0;d<c.length;d++){var a=c[d].split("=");if(b==a[0])return unescape(a[1])}return null}function setCookie(b,c,d,a){c=escape(c);if(a==""){a=new Date;a.setHours(a.getHours()+12);a=a.toGMTString()}if(d!="")d=";Path="+d;document.cookie=b+"="+c+";expires="+a+d} function vTrim(b){b=b.replace(/^\s+/,"");return b=b.replace(/\s+$/,"")} function checkMail(){var b=document.formFriend,c=true,d=true;if(vTrim(b.name.value).length<2){alert('Please input "Your Name:" ');return false}for(var a=0;a<6;a++){var e=vTrim(b["email"+(a?a:"")].value);if(e)if(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e))if(a==0)d=false;else c=false;else{c=true;break}}if(d){alert('You must fill "Your Email" address !');return false}if(c){alert('You must fill "Friend\'s Email" address !');return false}gE("tableMail2").style.display=""; gE("tableMail").style.display="none";return true}function ucwords(b){return b.toLowerCase().replace(/\w+/g,function(c){return c.charAt(0).toUpperCase()+c.substr(1)})};
function Subsys_JsHttpRequest_Js(){this._construct()} (function(){var k=0,h={},i={};Subsys_JsHttpRequest_Js.dataReady=function(a,b,c){var d,e=h[a];delete h[a];if(e){delete e._xmlReq;if(e.caching)i[e.hash]=[b,c];e._dataReady(b,c)}else typeof e!=typeof d&&alert("ScriptLoader: unknown pending id: "+a)};Subsys_JsHttpRequest_Js.prototype={onreadystatechange:null,readyState:0,responseText:null,responseXML:null,status:200,statusText:"OK",session_name:"PHPSESSID",responseJS:null,caching:false,_span:null,_id:null,_xmlReq:null,_openArg:null,_reqHeaders:null,dummy:function(){}, abort:function(){if(this._xmlReq)return this._xmlReq.abort();if(this._span){this.readyState=0;this.onreadystatechange&&this.onreadystatechange();this._cleanupScript()}},open:function(a,b,c,d,e){this._openArg={method:a,url:b,asyncFlag:c,username:d,password:e};this._xmlReq=this._id=null;this._reqHeaders=[];return true},send:function(a){var b=(new Date).getTime()+""+k++;a.COOKIE=document.cookie;a=this._hash2query(a);var c=this._openArg.url,d=this._getSid();if(d)c+=(c.indexOf("?")>=0?"&":"?")+this.session_name+ "="+this.escape(d);d=this.hash=c+"?"+a;if(this.caching&&i[d]){b=i[d];this._dataReady(b[0],b[1]);return false}d=(this._xmlReq=this._obtainXmlReq(b,c))&&(window.ActiveXObject||this._xmlReq.setRequestHeader);if(this._xmlReq&&d&&(""+this._openArg.method).toUpperCase()=="POST"){this._openArg.method="POST";c=c;a=a}else{this._openArg.method="GET";c=c+(c.indexOf("?")>=0?"&":"?")+a;a=null}c=c+(c.indexOf("?")>=0?"&":"?")+b;h[b]=this;if(this._xmlReq){b=this._openArg;this._xmlReq.open(b.method,c+"-xml",b.asyncFlag, b.username,b.password);if(d){for(b=0;b<this._reqHeaders.length;b++)this._xmlReq.setRequestHeader(this._reqHeaders[b][0],this._reqHeaders[b][1]);this._xmlReq.setRequestHeader("Content-Type","application/octet-stream")}return this._xmlReq.send(a)}else{this._obtainScript(b,c);return true}},getAllResponseHeaders:function(){if(this._xmlReq)return this._xmlReq.getAllResponseHeaders();return""},getResponseHeader:function(a){if(this._xmlReq)return this._xmlReq.getResponseHeader(a);return""},setRequestHeader:function(a, b){this._reqHeaders[this._reqHeaders.length]=[a,b]},_construct:function(){},_dataReady:function(a,b){with(this){if(a!==null||b!==null){readyState=4;responseText=responseXML=a;responseJS=b}else{readyState=0;responseText=responseXML=responseJS=null}onreadystatechange&&onreadystatechange();_cleanupScript()}},_obtainXmlReq:function(a,b){if(b.match(/^[a-z]+:\/\//i))return null;var c=null;if(window.XMLHttpRequest)try{c=new XMLHttpRequest}catch(d){}else if(window.ActiveXObject){try{c=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}if(!c)try{c= new ActiveXObject("Msxml2.XMLHTTP")}catch(j){}}if(c){var g=this;c.onreadystatechange=function(){var f=c.readyState;if(f==4){c.onreadystatechange=g.dummy;f=c.responseText;try{eval(f)}catch(l){Subsys_JsHttpRequest_Js.dataReady(a,"JavaScript code generated by backend is invalid!\n"+f,null)}}else{g.readyState=f;g.onreadystatechange&&g.onreadystatechange()}};this._id=a}return c},_obtainScript:function(a,b){with(document){var c=null;c=body.appendChild(createElement("SPAN"));c.style.display="none";c.innerHTML= "Text for stupid IE.<script><\/script>";setTimeout(function(){var d=c.getElementsByTagName("script")[0];d.language="JavaScript";if(d.setAttribute)d.setAttribute("src",b);else d.src=b},10);this._id=a;this._span=c}},_cleanupScript:function(){var a=this._span;if(a){this._span=null;setTimeout(function(){a.parentNode.removeChild(a)},50)}return false},_hash2query:function(a,b){if(b==null)b="";var c=[];if(a instanceof Object)for(var d in a){var e=a[d];if(!(e==null||((e.constructor||{}).prototype||{})[d])){var j= b?b+"["+this.escape(d)+"]":this.escape(d);c[c.length]=e instanceof Object?this._hash2query(e,j):j+"="+this.escape(e)}}else c=[a];return c.join("&")},_getSid:function(){var a=document.location.search.match(new RegExp("[&?]"+this.session_name+"=([^&?]*)")),b=null;if(a)b=a[1];else if(a=document.cookie.match(new RegExp(s="(;|^)\\s*"+this.session_name+"=([^;]*)")))b=a[2];return b},escape:function(a){return escape(a).replace(new RegExp("\\+","g"),"%2B")}}})();
function getXmlHttpRequest(){var a=null;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){a=null}}if(!a&&typeof XMLHttpRequest!="undefined")a=new XMLHttpRequest;return a}function getUrlSync(a){return getUrl(a,false,null)}function getUrlAsync(a,b){return getUrl(a,true,b)}function getUrl(a,b,c){var d=getXmlHttpRequest();if(d){d.onreadystatechange=c?function(){c(d)}:function(){};d.open("GET",a,b);d.send(null)}} function postUrl(a,b,c,d){var e=getXmlHttpRequest();if(e){e.open("POST",a,c);e.onreadystatechange=function(){d(e)};e.setRequestHeader("Content-Type","application/x-www-form-urlencoded");e.send(b)}}function urlEncodeDict(a){for(var b="",c=0;c<a.length;c++)b+="&"+encodeURIComponent(a[c].name)+"="+encodeURIComponent(a[c].value);return b}function execOnSuccess(a){return function(b){b.readyState==4&&b.status==200&&a(b)}} function postFormByForm(a,b,c){for(var d=[],e=0;e<a.elements.length;e++){var f=a.elements[e];if(!(f.type=="checkbox"&&!f.checked))if(!(f.type=="radio"&&!f.checked)){var g={};g.name=f.name;g.value=f.value;d.push(g)}}postUrl(a.action,urlEncodeDict(d),b,execOnSuccess(c))}function postForm(a,b,c){return postFormByForm(document.forms[a],b,c)} function replaceDivContents(a,b){b=document.getElementById(b);a=a.responseText.split("||");b.innerHTML=a[0];if(a[1])document.getElementById("rating_id").innerHTML="Rated: "+a[1]} function getUrlXMLResponseCallback(a){if(a.responseXML!=null){var b=getRootNode(a),c=getNodeValue(b,"return_code");if(c==0){redirect_val=getNodeValue(b,"redirect_on_success");if(redirect_val!=null)window.location=redirect_val;else{success_message=getNodeValue(b,"success_message");success_message!=null&&alert(success_message);this.successCallback!=null&&this.successCallback(a)}}else{a=getNodeValue(b,"error_message");if(a==null||a.length==0)a=c==2?"You must be logged in to perform this operation.": "An error occured while performing this operation.";alert(a)}}}function getNodeValue(a,b){node=a.getElementsByTagName(b);return node!=null&&node.length>0?node[0].firstChild.nodeValue:null}function getRootNode(a){return a.responseXML.getElementsByTagName("root")[0]}function getUrlXMLResponse(a,b){this.successCallback=b;this.urlResponseCallback=getUrlXMLResponseCallback;getUrl(a,true,execOnSuccess(this.urlResponseCallback))} function postUrlXMLResponse(a,b,c){this.successCallback=c;this.urlResponseCallback=getUrlXMLResponseCallback;postUrl(a,b,true,execOnSuccess(this.urlResponseCallback))}function postFormXMLResponse(a,b){this.successCallback=b;postForm(a,true,execOnSuccess(getUrlXMLResponseCallback))};
makeSuggestion=true;mainContainerId="ss_container";searchInputId="s";typeSelectorId="what";activeElem=0;oldVal="";lastResultNull=false;ssArray=new Array({words:"",rating:0});minLength=2;keyPressTime=200;keyPressTimerLink=null;ssCache={};ssSeparator="---";ssIsHidden=true;ssLastQueryNumber=0; function search_suggestions_init(){document.getElementById(searchInputId).setAttribute("autocomplete","off");document.getElementById(searchInputId).onblur=function(){hideSearchResult()};document.getElementById(typeSelectorId).onblur=function(){hideSearchResult()};document.getElementById(searchInputId).onkeydown=function(a){if(makeSuggestion){keyCode=a?a.keyCode:window.event.keyCode;if(keyCode==38&&ssArray.length>minLength-1)if(ssIsHidden)showSearchResult();else{activeElem=(activeElem+(ssArray.length- 1))%ssArray.length;refreshCurrentValue();tableRefresh()}else if(keyCode==40&&ssArray.length>minLength-1)if(ssIsHidden)showSearchResult();else{activeElem=(activeElem+1)%ssArray.length;refreshCurrentValue();tableRefresh()}else keyCode==13&&hideSearchResult()}};document.getElementById(searchInputId).onkeyup=function(a){if(makeSuggestion){keyCode=a?a.keyCode:window.event.keyCode;if(keyCode!=38&&keyCode!=40&&keyCode!=13){keyPressTimerLink&&clearTimeout(keyPressTimerLink);keyPressTimerLink=setTimeout("searchSuggestion()", keyPressTime)}}};document.getElementById("what").onchange=function(){oldVal="";lastResultNull=false;searchSuggestion()}}function offSuggestions(){makeSuggestion=false}function hideSearchResult(){document.getElementById(mainContainerId).style.display="none";ssIsHidden=true}function showSearchResult(){document.getElementById(mainContainerId).style.display="block";ssIsHidden=false} function unpackNodeValueAll(a,b){if(a){node=a.getElementsByTagName(b);if(node!=null&&node.length>0)for(i=0;i<node.length;i++){childs=node[i].childNodes;retObj={};for(j=0;j<childs.length;j++)retObj[childs[j].tagName]=childs[j].firstChild.nodeValue;ssArray.push(retObj)}}}function refreshCurrentValue(){document.getElementById(searchInputId).value=ssArray[activeElem].words}function setActiveElem(a){activeElem=a;tableRefresh()} function submitSearch(){refreshCurrentValue();document.getElementById("LMsearchForm").submit()}function tableRefresh(){document.getElementById(mainContainerId).innerHTML=makeTable()}function zeroRound(a,b){b||(b=3);pow=Math.abs(a).toString().length-b;pow=pow>0?pow:0;return a-a%Math.pow(10,pow)}function cutWords(a,b){b||(b=38);words_cut=a.substring(0,b);return words_cut!=a?words_cut+"...":words_cut} function addDigitSpaces(a){str=a.toString();new_str="";for(a=0;a<str.length;a++){if(a%3==0)new_str=" "+new_str;new_str=str.charAt(str.length-a-1)+new_str}return new_str}function trimDelSpaces(a){a=a.toLowerCase();a=a.replace(/[^a-z0-9 ']/gi," ");a=a.replace(/(^\s+)|(\s+$)/g,"");if(a.match(/^'+[a-z0-9 ']+'+$/i))a=a.replace(/(^[' ]+)|([' ]+$)/g,"");else{a=a.replace(/^[' ]+/g,"");a=a.replace(/[' ]+$/g,"'")}return a=a.replace(/\s+/g," ")} function makeTable(){outHTML='<table cellpadding="0" cellspacing="0" id="ss_table">';if(ssArray)for(i=1;i<ssArray.length;i++){rating=zeroRound(ssArray[i].rating);rating=addDigitSpaces(rating);words=cutWords(ssArray[i].words);outHTML+=activeElem==i?'<tr class="act_ss" onmousedown="submitSearch();"><td class="firstCol">'+words+'</td><td align="right" class="secondCol"> '+rating+(rating==1?"search":"searches")+"</td></tr>":'<tr class="not_act_ss" onmousemove = "setActiveElem('+i+');"><td class="firstCol">'+ words+'</td><td align="right" class="secondCol"> '+rating+(rating==1?"search":"searches")+"</td></tr>"}outHTML+='<tr><td colspan="2" align="right" class="secondCol"><a href="" style="font-size:7pt;text-decoration:none" onmousedown="offSuggestions();" onclick="return false;">close <font color=red><b>x</b></font></a></td></tr>';outHTML+="</table>";return outHTML} function whenTakeResult(){if(ssArray.length==1){lastResultNull=true;hideSearchResult()}else{lastResultNull=false;showSearchResult();tableRefresh()}} function searchSuggestion(){currentVal=trimDelSpaces(document.getElementById(searchInputId).value);ssArray[0].words=document.getElementById(searchInputId).value;if(makeSuggestion&&currentVal!=oldVal&&!(lastResultNull&&currentVal.indexOf(oldVal)==0)){oldVal=currentVal;if(currentVal.length>=minLength){activeElem=0;if(ssCache[currentVal+ssSeparator+document.getElementById("what").value]){ssArray=ssCache[currentVal+ssSeparator+document.getElementById("what").value];ssArray[0].words=document.getElementById(searchInputId).value; whenTakeResult()}else{ssLastQueryNumber++;data=[];data.push({name:"words",value:currentVal});data.push({name:"type",value:document.getElementById("what").value});data.push({name:"qn",value:ssLastQueryNumber});postUrl("/operations/search_suggestion.php",urlEncodeDict(data),true,execOnSuccess(function(a){if(a.responseXML.documentElement.getElementsByTagName("qn")[0].firstChild.data==ssLastQueryNumber){ssArray=new Array({words:document.getElementById(searchInputId).value,rating:0});unpackNodeValueAll(a.responseXML.documentElement, "ss_elem");ssCache[currentVal+ssSeparator+document.getElementById("what").value]=ssArray;whenTakeResult()}}))}}else{lastResultNull=false;ssArray=new Array({words:document.getElementById(searchInputId).value,rating:0});hideSearchResult()}}};
cookie_days=3; function overlay_init(){var b="",a="";a='<div id="rm_container"><div id="rm_overlay" style="position:absolute; left:0; top:0; width:3000px; height:3000px; text-align:center; z-index:10000; background-color:#000; opacity:0.75; filter:alpha(opacity=75);"></div><div id="rm_modal" style="position: absolute; color:#000; width:650px; height:200px; top:50%; margin-top:-175px; left:50%; margin-left:-325px; background-color:#FFF; border:10px solid #74caff; text-align:center; z-index:10001; font-family:Arial,Sans-serif,Serif;">';a+= '<a href="#" style="position:absolute; top:5px; right:7px; font-size:11px; font-weight:700; color:#000; text-decoration:none; border-style: none;" onclick="rm_hide_overlay(); return false;">Close Box</a>';a+='<a href="'+rm_url+'" onclick="rm_hide_overlay();" target="_blank"><img src="/images/icon_ringtones.gif" border="0" alt="" id="rm_ring_icon" style="position:absolute; top:20px; left:300px;" /></a>';a+='<span id="rm_notice" style="position:absolute; bottom:5px; left:225px; font-size:10px; color:#404040;">This will not be displayed again for '+ cookie_days+" days.</span>";a+='<a id="rm_ad_text" onclick="rm_hide_overlay();" style="line-height: 30px; font-family:Verdana; font-weight:700; font-size:25px; color:#FF5000; text-decoration:underline; display:block; position:absolute; top:75px; left:20px; width:610px; border-style: none;" target="_blank" href="'+rm_url+'">Send &quot;';if(rm_songtitle!="")a+=rm_songtitle;else{a+=rm_artist;b="s"}a+="&quot; Ringtone"+b+" to your Cell</a></div></div>";if(!paretnerReferrerDetect()&&showAd()&&a!=""){document.write(a); rm_show_overlay()}}function paretnerReferrerDetect(){return document.referrer&&/(vh1|mtv)\.com/.test(document.referrer)}function showAd(){ad_shown=get_cookie("rm_ad_shown");if(ad_shown!=null&&ad_shown!="")return false;else{set_cookie("rm_ad_shown","true",cookie_days);return true}} function rm_show_overlay(){if(isIE())window.onload=function(){document.body.scrollTop=0};else{document.getElementById("rm_modal").style.position="fixed";if(document.getElementById("rm_modal2")!=null)document.getElementById("rm_modal2").style.position="fixed"}hideflash();document.body.style.overflow="hidden"}function rm_hide_overlay(){document.getElementById("rm_container").innerHTML="";document.getElementById("rm_container").style.display="none";document.body.style.overflow="auto";showflash()} function is_defined(b){return typeof window[b]!="undefined"}function mt_rand(b,a){return Math.floor(Math.random()*(a-b+1))+b}function set_cookie(b,a,d){var c=new Date;c.setDate(c.getDate()+d);document.cookie=b+"="+escape(a)+";path=/"+(d==null?"":";expires="+c.toGMTString())+"omain=."+top.location.host.replace(/www\./i,"")} function get_cookie(b){if(document.cookie.length>0){c_start=document.cookie.indexOf(b+"=");if(c_start!=-1){c_start=c_start+b.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end))}}return""}function hideflash(){document.getElementById("widgets").style.display="none";document.getElementById("replace_widgets").style.display="block"} function showflash(){document.getElementById("widgets").style.display="block";document.getElementById("replace_widgets").style.display="none"}function isIE(){return/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent)};
function getLeft(el){var left=0;do{left+=el.offsetLeft||0;el=el.offsetParent}while(el);return left+(window.ie6||window.ie7?1:0)}function getTop(el){var top=0;do{top+=el.offsetTop||0;el=el.offsetParent}while(el);return top+(window.ie6||window.ie7?1:0)}function MClkPlus(id,obj){objContaner=gE("contenerCovers");gE("cor_band").style.left=getLeft(objContaner)+15;gE("cor_band").style.top=getTop(obj)+18;document.frmSendACover.action+=id;if(gE("cor_band").style.display!="block"){gE("cor_band").style.display="block"}else{gE("cor_band").style.display="none"}}function PopupWnd(){var config='width=500,height=300,scrollbars=no,resizable=no,status=no,location=no,top=200,left=300';hPopupWnd=window.open('/yt_link.php','',config);hPopupWnd.focus()}function ChkSendFile(){if(document.getElementById('imgCoverId').value==""){alert('select file');return false}return true}