var gracenote;var fTimeout,hint_wind;var lyr_al=getCookieValue("lyr_al");var lyr_ff=getCookieValue("lyr_ff");var lyr_fw=getCookieValue("lyr_fw");var preview_vis=getCookieValue("preview_vis");preview_vis=(preview_vis=="false")?false:true;var preview_type=getCookieValue("preview_type");if(!preview_type)preview_type=1;var click_flags={"cust_widget_click":false,"aolim_click":false,"furl_click":false,"reddit_click":false,"stumb_click":false,"face_click":false,"copy_ipod_click":false,"copy_flash_video_click":false,"copy_flash_click":false,"copy_video_click":false,"copy_link_click":false,"copy_link2_click":false,"copy_embed_click":false,"del_click":false,"digg_click":false,"print_click":false,"email_click":false,"trans_click":false,"twitter_click":false,"twitter_bird_click":false};onLoadFunctionList=new Array();function performOnLoadFunctions(){for(var a in onLoadFunctionList)onLoadFunctionList[a]()}function _offsetTop(a){var b=a.offsetTop;var c=a.offsetParent;while(c.tagName.toUpperCase()!="BODY"){b+=c.offsetTop;c=c.offsetParent}return b}function _offsetLeft(a){var b=a.offsetLeft;var c=a.offsetParent;while(c.tagName.toUpperCase()!="BODY"){b+=c.offsetLeft;c=c.offsetParent}return b}function callExternalInterface(a,b){if(fTimeout){clearTimeout(fTimeout);DoHide()}hint_wind=document.getElementById(b);if(youtube_video&&(b=="copy_flash")&&(preview_type!=2)){if(preview_type==3)b="copy_video";else if(preview_type==1)b="copy_flash_video"}/*thisMovie("externalInterfaceExample").ClipboardJS(a.value);*/if(!eval("click_flags['"+b+"_click']")){copy_click(b)}a.select();hint_wind.style.display='block';fTimeout=setTimeout('DoHide()',10000)}function HideShowCommentsDiv(a){var b=gE("userComment"+a);var c=gE("userImg"+a);var d=gE("refUserLink"+a);if(b.className.indexOf("visible")==-1){b.className="visible";d.innerHTML="Hide"}else{b.className="hidden";d.innerHTML="Show"}if(c.className.indexOf("visible")==-1)c.className="visible";else c.className="hidden"}function load_options(){document.getElementById("ff_select").selectedIndex=((lyr_ff===null)||(lyr_ff<0)||(lyr_ff>4))?3:lyr_ff;document.getElementById("fw_select").selectedIndex=((lyr_fw===null)||(lyr_fw<0)||(lyr_fw>4))?2:lyr_fw;if((lyr_al!="left")&&(lyr_al!="center")&&(lyr_al!="right"))lyr_al="left";change_align(lyr_al);changeFontFamily(document.getElementById("ff_select").value);changeFontSize(document.getElementById("fw_select").value);document.getElementById('widgets').style.display=(preview_vis===true)?"block":"none";if(youtube_video){document.getElementById('rb'+preview_type).checked="true";change_preview(preview_type)}document.getElementById('hide_link_id').innerHTML=(preview_vis===true)?'<img id="img_arr_id" src="/i/arr_u.gif" align="middle" border="0" alt="Hide preview" width="18" height="18">':'<img id="img_arr_id" src="/i/arr_d.gif" align="middle" border="0" alt="Show preview" width="18" height="18">'}function hide_preview(){if(preview_vis===true){document.getElementById('widgets').style.display='none';document.getElementById('hide_link_id').innerHTML='<img id="img_arr_id" src="/i/arr_d.gif" align="middle" border="0" alt="Show widget preview" width="18" height="18">'}else{document.getElementById('widgets').style.display='block';document.getElementById('hide_link_id').innerHTML='<img id="img_arr_id" src="/i/arr_u.gif" align="middle" border="0" alt="Hide widget preview" width="18" height="18">'}preview_vis=(preview_vis===true)?false:true;if(preview_vis===true&&youtube_video)change_preview(preview_type);var a=new Date();a.setMonth(a.getMonth()+6);setCookie("preview_vis",preview_vis,"/",a.toGMTString())}function showFormLogin(a,b,c){var d=document.getElementById('login_register');document.getElementById('login_register').style.display='block';document.getElementById('login_register').style.top=_offsetTop(a)+b+'px';document.getElementById('login_register').style.left=_offsetLeft(a)-c+'px'}function setOpacity(a,b){a.style.MozOpacity=b/100;a.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+b+")"}function showForm(a,b){document.getElementById(a).style.display='block';if(b!='yt')document.getElementById(b+'_cancel').focus();document.getElementById(b+'_text').focus()}function rep_change(){if(document.getElementById('br_text').value.replace(/[\ \n\r\t]{2,}/," ").length>3){document.getElementById('br_but').disabled=false}else{document.getElementById('br_but').disabled=true}}function DoHide(){hint_wind.style.display='none'}function copy_click(a){var b=new Subsys_JsHttpRequest_Js();b.onreadystatechange=function(){if((b.readyState==4)&&(b.responseJS))if(b.responseJS['ok'])eval("click_flags['"+a+"_click'] = true")};b.caching=false;b.open('GET',"/code/copy_click.php",true);b.send({inq:a,wwp:(song_id==679857?1:0)})}function thisMovie(a){if(navigator.appName.indexOf("Microsoft")!=-1){return window[a]}else{return document[a]}}function change_align(a){var b=new Array('left','center','right');if(gracenote){var c=document.getElementById("iframe_lyrics").contentDocument;if(c==undefined||c==null)c=document.getElementById("iframe_lyrics").contentWindow.document;c.body.style.textAlign=a}else{document.getElementById("songlyrics").align=a}for(i=0;i<3;i++){if(a==b[i]){document.getElementById("id_"+b[i]).style.borderColor="#999999";lyr_al=a}else{document.getElementById("id_"+b[i]).style.borderColor="#F7F7F7"}}save_options()}function changeFontFamily(a){if(gracenote){var b=document.getElementById("iframe_lyrics").contentDocument;if(b==undefined||b==null)b=document.getElementById("iframe_lyrics").contentWindow.document;b.body.style.fontFamily=a;document.getElementById("iframe_lyrics").style.height=b.getElementById('lyrics').offsetHeight}else{document.getElementById('songlyrics').style.fontFamily=a}save_options()}function changeFontSize(a){if(gracenote){var b=document.getElementById("iframe_lyrics").contentDocument;if(b==undefined||b==null)b=document.getElementById("iframe_lyrics").contentWindow.document;b.getElementById('lyrics').style.fontSize=a;document.getElementById("iframe_lyrics").style.height=b.getElementById('lyrics').offsetHeight}else{document.getElementById('songlyrics').style.fontSize=a}save_options()}function save_options(){var a=new Date();a.setMonth(a.getMonth()+6);setCookie("lyr_al",lyr_al,"/",a.toGMTString());setCookie("lyr_ff",document.getElementById("ff_select").selectedIndex,"/",a.toGMTString());setCookie("lyr_fw",document.getElementById("fw_select").selectedIndex,"/",a.toGMTString())}function change_preview(a){a=parseInt(a);document.getElementById('lrb'+preview_type).className="smg";document.getElementById('lrb'+a).className="smg_u";if(preview_vis===true){switch(a){case 1:{document.getElementById('videowidget').style.display="block";document.getElementById('videowidget').style.borderBottom="";document.getElementById('flashpreview').style.display="block"}break;case 2:{document.getElementById('videowidget').style.display="none";document.getElementById('flashpreview').style.display="block"}break;case 3:{document.getElementById('videowidget').style.display="block";document.getElementById('videowidget').style.borderBottom="1px solid #FF6600";document.getElementById('flashpreview').style.display="none"}break}}switch(a){case 1:document.getElementById('code_input').value=lv_code;break;case 2:document.getElementById('code_input').value=l_code;break;case 3:document.getElementById('code_input').value=v_code;break}preview_type=a;var b=new Date();b.setMonth(b.getMonth()+6);setCookie("preview_type",preview_type,"/",b.toGMTString())}function open_custom(){if(!eval("click_flags['cust_widget_click']"))copy_click('cust_widget');var a=youtube_video?610:415;var b=730;var c=(screen.height-a)/2;var d=(screen.width-b)/2;window.open('/about/widget.php?song_id='+song_id,'','width='+b+',height='+a+',scrollbars=no,resizable=no,status=no,location=no,top='+c+',left='+d)}function open_email(){if(!eval("click_flags['email_click']"))copy_click('email');var a=400;var b=730;var c=(screen.height-a)/2;var d=(screen.width-b)/2;window.open('/mailto.php?songid='+song_id,'','width='+b+',height='+a+',scrollbars=no,resizable=no,status=no,location=no,top='+c+',left='+d)}function gotoPage(c){getUrlXMLResponse("/operations.php?a=gotoPage&songid="+song_id+"&curpage="+c,function(a){var b=getNodeValue(a.responseXML.documentElement,"html_content");document.getElementById('usersMeanings').innerHTML=b})}function vote(d,f){var e,g;if(!isLogged){alert("Please, login or register to vote for the meanings");return}getUrlXMLResponse("/operations.php?a=vote&songid="+song_id+"&valuemean="+d+"&meanid="+f,function(a){var b=getNodeValue(a.responseXML.documentElement,"js_code");if(b!=""){eval(b)}var c=getNodeValue(a.responseXML.documentElement,"html_content");if(c!=""){e=parseInt(c);g=e>0?'#2474AD':'#A71212';c=!e?'':(e>0?('+'+e.toString()):e);gE('voteValue'+f).style.color=g;gE('voteValue'+f).innerHTML=c}})}function badRep(a){if(!isLogged){alert("Please, login or register to report bad meanings");return}popupWin=window.open("/operations.php?a=badrep&meanid="+a,'','width=500, height=300, scrollbars=no,resizable=no,status=no,location=no,top=200,left=300');popupWin.focus()}function strip_tags(a){return a.replace(/<\/?[^>]+>/gi,"")}function trim(a){return rtrim(ltrim(a))}function ltrim(a){return a.replace(/^\s+/,'')}function rtrim(a){return a.replace(/\s+$/,'')}function ChkInputData(){var a;snd=document.frmSendMean.text.value.toString();snd=trim(snd);a=snd.length;snd=strip_tags(snd);if((snd.length!=a)&&(snd.length<50)){alert("HTML tags aren't allowed!");document.frmSendMean.text.focus();return false}if(snd.length<50){alert("Your meaning should be 50 letters at least!");document.frmSendMean.text.focus();return false}}function str_replace(a,b,c){return c.split(a).join(b)}function GoToForm(){var a=getCookieValue("textMeanings")?true:false;var b=getCookieValue("meaningsIdSong");if(song_id!=b)return;else if(a){document.frmSendMean.post.focus();document.frmSendMean.text.value=str_replace("+"," ",getCookieValue("textMeanings"));setCookie('textMeanings','','/');setCookie('meaningsIdSong','','/')}};function ClkTranslate(){copy_click("trans");var a=document.getElementById("iLngTo");if(a.value=="0"){alert("please select language for translate");return false}return true}var UT_RATING_IMG=new Image();UT_RATING_IMG.src='/i/star_bg_yellow_s.gif';var UT_RATING_IMG_BG=new Image();UT_RATING_IMG_BG.src='/i/star_bg_wh_s.gif';function UTRating(d,f,e,g,h,j,t){this.ratingElementId=d;this.maxStars=f;this.objectName=e;this.formName=g;this.ratingMessageId=h;this.componentSuffix=j;this.starTimer=null;this.starCount=0;function k(a,b){this.clearStarTimer();this.greyStars();this.colorStars(a)}function l(a){if(type_rating=="song")messages=new Array("Rate this video","Poor","Nothing special","Worth watching","Pretty cool","Awesome!");else if(type_rating=="playlist"){messages=new Array("Rate this playlist","Poor","Nothing special","Worth watching","Pretty cool","Awesome!")}else messages=new Array("Rate this image","Poor","Nothing special","Worth watching","Pretty cool","Awesome!");document.getElementById(this.ratingMessageId).innerHTML=messages[a]}function m(a){for(var b=0;b<a;b++)document.getElementById('star_'+this.componentSuffix+"_"+(b+1)).src=UT_RATING_IMG.src}function n(){for(var a=0;a<this.maxStars;a++)if(a<=this.starCount)document.getElementById('star_'+this.componentSuffix+"_"+(a+1)).src=UT_RATING_IMG_BG.src;else document.getElementById('star_'+this.componentSuffix+"_"+(a+1)).src=UT_RATING_IMG_BG.src}function o(b){this.starCount=b;this.drawStars(b);document.forms[this.formName]['rating'].value=this.starCount;var c=this.ratingElementId;postForm(this.formName,true,function(a){replaceDivContents(a,c)})}function p(a,b){this.starCount=a;this.showStars(a,b)}function q(){this.starTimer=setTimeout(this.objectName+".resetStars()",0)}function r(){this.clearStarTimer();if(this.starCount)this.drawStars(this.starCount);else this.greyStars()}function s(){if(this.starTimer){clearTimeout(this.starTimer);this.starTimer=null}}this.clearStars=q;this.clearStarTimer=s;this.greyStars=n;this.colorStars=m;this.resetStars=r;this.setStars=o;this.drawStars=p;this.showStars=k;this.setMessage=l};function ChkInputDataBad(){var a;snd=document.getElementById('br_text').value;snd=trim(snd);a=snd.length;snd=strip_tags(snd);if((snd.length!=a))return 1;return 0};function Clk_BadReportSend(){if(ChkInputDataBad()==0){document.getElementById('cor_lyr').style.display='none';popupWin=window.open("/report.php?song="+song_id+"&type=lyrics&reason="+document.getElementById('br_text').value,'','width=500, height=300, scrollbars=no,resizable=no,status=no,location=no,top=200,left=300');popupWin.focus();return false}else{alert("HTML tags aren't allowed!")}};function GetGTranslate(){getUrlXMLResponse("/operations/gtranslate_ops.php?songid="+song_id,function(a){var b=getNodeValue(a.responseXML.documentElement,"html_content");document.getElementById('translate_lyr').innerHTML=b})};function _gE(e){if(typeof e=='string')return document.getElementById(e);else if(typeof e=='object')return e;else return null};function showHideObjects(){var elem;if(arguments[0]){elem=_gE(arguments[0]);if(elem&&typeof elem.style=='object'){elem.style.display=elem.style.display=='block'?'none':'block'}}for(var i=1;i<arguments.length;i++){elem=_gE(arguments[i]);if(elem&&typeof elem.style=='object')elem.style.display='none'}};function favoritesSongInit(){_gE('l_favorites').onclick=function(){showHideObjects('favorites_lyr','translate_lyr','ipod_lyr');this.blur()};setClearFavorites=function(act){showHideObjects('favorites_loading_img','favorites_content');_gE('favorites_action').value=act=='add'?'add':'del';var requireFunc=function(reg){showHideObjects('favorites_content','favorites_loading_img');_gE('favorites_content').innerHTML=reg.responseText};postForm('favoritesForm',true,requireFunc)};showHideObjects('favorites_lyr','translate_lyr','ipod_lyr');if(isLogged)setClearFavorites('add');else showHideObjects('favorites_content')};
