function displayMessage(A){mb._get(A).style.display="";window.setTimeout(hideMessage,5000)}function hideMessage(){mb._get("savedMsg").style.display="none"}function initXMLHttp(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}else{return new ActiveXObject("Msxml2.XMLHTTP")}}}function playSong(D){var A=addContextPath("/music/playSong.do?player=smallPlayer&");var B="songId="+D+"&"+Date();var C=readCookie("musicPlayer");if(C){wopen(addContextPath("/music/showPopupPlayer.do?shuffle=true&"+B),"playerPopup",365,155,"no");B="playSong=false&player=smallPlayer"}else{B+="&playSong=true"}A+=B+"&playSound=true";playSongInPlayer(A)}function playSongInPlayer(A){var B=initXMLHttp();B.open("GET",A,true);B.onreadystatechange=function(){if(B.readyState==4){try{mb._get("playerId").innerHTML=B.responseText}catch(C){}}};B.send(A)}function changeBackgroundColor(A){mb._get(A).style.background="#C1D3DD"}function changeToDefaultColor(A){mb._get(A).style.background="#FFFFFF"}function setHotRating(D,C){var A=addContextPath("/music/musicHotRating.do?");var B="songId="+D+"&points="+C+"&"+Date();A+=B;updateHotRatingOfSong(A)}function updateHotRatingOfSong(A){var B=initXMLHttp();B.open("GET",A,true);B.onreadystatechange=function(){if(B.readyState==4){try{alert(B.responseText)}catch(C){}}};B.send(A)}function removeSongFromJukebox(A,C){var B=initXMLHttp();B.open("GET",A,true);B.onreadystatechange=function(){if(B.readyState==4){try{mb._get("playerList").innerHTML=B.responseText;if(C=="tunes"){alert("Song has been deleted from your jukebox")}else{alert("Song has been deleted from the "+C+" playlist")}}catch(D){}}};B.send(A)}function removeFromJukebox(E,D,A){var B=addContextPath("/music/addSongToPlayList.do?method=removeSongFromJukebox&");var C="songsId="+E+"&websiteId="+A+"&playListType="+D+"&"+Date();B+=C;removeSongFromJukebox(B,D)}function playSongSingle(F,E,D){var A=addContextPath("/music/playSong.do?shuffle=true&");var B="songId="+F+"&songName="+E+"&"+Date()+"&player=smallPlayer";var C=readCookie("musicPlayer");if(C){wopen(addContextPath("/music/showPopupPlayer.do?shuffle=true&"+B),"playerPopup",365,155,"no");B="playSong=false&player=smallPlayer"}else{B+="&playSong=true"}A+=B+"&playSound="+D;playSongInPlayer(A)}function playSongInUserPlayList(H,G,A,D,F){var B=addContextPath("/music/playSong.do?shuffle=true&");var C="songId="+H+"&songName="+G+"&"+Date()+"&websiteId="+A+"&player="+D;var E=readCookie("musicPlayer");if(E){wopen(addContextPath("/music/showPopupPlayer.do?shuffle=true&"+C),"playerPopup",365,155,"no");C="playSong=false&player="+D}else{C+="&playSong=true"}B+=C+"&playSound="+F;playSongInPlayer(B)}function dummyPlayer(B,C){var A=addContextPath("/music/playSong.do?shuffle=true&playSong=false&player="+B+"&songId="+C);playSongInPlayer(A)}function changeBgColor(B){var A=mb._get(B);A.style.backgroundColor="#C1D3DD"}function changeToDefaultColor(B){var A=mb._get(B);A.style.backgroundColor="#F6F8FA"}function clearVoteMsg(){var A=mb._get("playListVoteAlert");if(A){A.innerHTML=""}}function voteCastedPlayList(A,D){chgClass("playListCastLink","hideDiv");var B=mb._get("playListUnCastLink");if(B){B.style.display="block"}B=mb._get("playListVoteCountDiv");if(B){B.style.display="block";B=mb._get("playListVoteCountSpan");var C=B.innerHTML;if(!C){C=0}B.innerHTML=(C-0)+1}B=mb._get("playListVoteAlert");if(B){B.innerHTML=D.message;window.setTimeout(clearVoteMsg,5000)}else{alert(D.message)}}function castVoteInit(B,A,C){chgClass("playListCastLink","hideDiv");return true}function addSongToPlaylistCallback(A,B){mb._get("savedMsg").innerHTML=B.message;displayMessage("savedMsg")}function addToJukeBoxCallback(A,B){alert(B.message)}function showUserDetails(D,A,E){var B=addContextPath("/music/showSongDetails.do?");var C="userWebsiteId="+D+"&websiteId="+A+"&"+Date();B+=C;showDetails(B,E)}function showDetails(A,C){var B=initXMLHttp();B.open("GET",A,true);B.onreadystatechange=function(){if(B.readyState==4){try{mb._get("show").innerHTML=B.responseText;var D=mb._get(C);completeList(D,725,0)}catch(E){}}};B.send(A)}function completeList(E,C,A){var D=getElementPosition(E);var B=mb._get("show");B.style.position="absolute";B.style.right=(D.left-C)+"px";B.style.top=(D.top+A)+"px";B.style.display="block"}function getElementPosition(A){var C=0;var B=0;while(A){C+=A.offsetLeft;B+=A.offsetTop;A=A.offsetParent}if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined"){C+=document.body.leftMargin;B+=document.body.topMargin}return{left:C,top:B}}function hidePopup(){window.setTimeout(hide,5000)}function hide(){mb._get("show").style.display="none"};