function saveHintSettings(){var A=dojo.byId("disable-hint");if(dojo.cookie.isSupported){if(A.checked){dojo.cookie("showHint","false",{expires:10000})}}else{}hideHint()}function loadHintSettings(){dojo.require("dojo.cookie");var B=dojo.cookie("showHint");if(B=="false"){var A=dojo.byId("start-link");A.href="/applet"}return false}var pairImageSwitchDelay=10000;var pairImageSources=null;var currentPairImage=0;function initImageSwitcher(A){pairImageSources=A;window.setTimeout("preloadImages(pairImageSources);",3500);setTimeout("switchPairImage()",pairImageSwitchDelay)}function switchPairImage(){var A=document.getElementById("pair");var B=dojo.anim(A,{opacity:0},500);dojo.connect(B,"onEnd",function(){var C=pairImageSources[currentPairImage];A.src=C.src;A.style.width=C.w;A.style.height=C.h;dojo.anim("pair",{opacity:1},1000)});B.play();currentPairImage++;if(currentPairImage==pairImageSources.length){currentPairImage=0}setTimeout("switchPairImage()",pairImageSwitchDelay)}function playSoundIn(D,C,A,B){window.setTimeout('playSound("'+D+'", "'+C+'", '+A+");",B)}function playSound(A,E,B){var F=document.getElementById("sounds");if(!F){return}var I;var G=navigator.appVersion.indexOf("Windows")!=-1;var D=navigator.appVersion.indexOf("Macintosh")!=-1||navigator.appVersion.indexOf("Mac OS")!=-1;var C=navigator.appVersion.indexOf("X11")!=-1;if(G){I='<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" Name="MediaPlayer" src="'+urlPrefix+E+'" AutoStart="true" ShowStatusBar="1" ShowControls="1" ShowDisplay="1" volume="100"'+(B?' PlayCount="0"':"")+' height="0" width="0">'}else{if(D){I='<embed src="'+urlPrefix+E+'" autoplay="true" controller="false"'+(B?' loop="true"':"")+' width="0" height="0">'}else{I='<object type="application/x-shockwave-flash" data="/swf/emff_standard.swf" width="0" height="0"><param name="movie" value="emff_standard.swf" /><param name="FlashVars" value="src='+urlPrefix+E+"&amp;autostart=yes&amp;repeat="+(B?"yes":"no")+'" /></object>'}}A="sounds."+A;var H=document.getElementById(A);if(!H){H=document.createElement("div");H.id=A;F.appendChild(H)}H.innerHTML=I}var globalRequestId=0;function Slider(B,I,D,A,G,F,H,C,E){D.Slider=this;this.slider=D;this.allImages=I;this.folder=B;this.scrollDelay=G;if(A!=undefined){this.frameWidth=A}else{this.frameWidth=D.clientWidth}this.frameHeight=D.clientHeight;this.imageWidth=this.frameWidth;this.imageHeight=this.frameHeight;this.mouseOver=F;this.mouseOut=H;this.imagePaddingLeft=0;this.imagePaddingTop=0;var J=3;this.popup=C;this.popupTab=E;this.imageIndex=0;this.firstFrameLeft=0;this.scrollWidth=1;this.timeout=null;this.paused=false;this.slideStep=function(){if(!this.paused){this.firstFrameLeft-=this.scrollWidth;var L=null;var Q=null;var O=this.slider.childNodes;var N=this.firstFrameLeft;for(var M=0;M<O.length;M++){var K=O[M];if(!K.style){continue}Q=K;if(L==null){L=O[M];var P=L.style.left.substring(0,L.style.left.indexOf("px"));L.style.left=(P-this.scrollWidth)+"px"}else{K.style.left=(N+this.imagePaddingLeft)+"px"}N+=this.frameWidth+J}if(this.firstFrameLeft<=0-(this.frameWidth+J)){this.slider.removeChild(L);this.firstFrameLeft=0}if(N<this.slider.offsetWidth){this.putNextImagesIntoSlider(N)}this.timeout=window.setTimeout(createRef(this,this.slideStep),this.scrollDelay)}},this.putNextImagesIntoSlider=function(M){var L=this.slider.offsetWidth;var K=L+this.frameWidth;while(M+this.frameWidth<K){this.putNextImageIntoSlider(M);M+=this.frameWidth+J}},this.putNextImageIntoSlider=function(L){var M=document.createElement("img");M.setAttribute("src",this.folder+this.allImages[this.imageIndex]);M.width=this.imageWidth;M.height=this.imageHeight;var K=this.slider.offsetWidth;M.style.position="absolute";M.style.left=(L+this.imagePaddingLeft)+"px";M.style.top=this.imagePaddingTop+"px";M.style.height=this.imageHeight+"px";this.imageIndex++;if(this.imageIndex>=this.allImages.length){this.imageIndex=0}if(this.mouseOver!=undefined){dojo.connect(M,"onmouseover",this.mouseOver);M.Slider=this}this.slider.appendChild(M)},this.start=function(){if(this.slider!=null){this.paused=false;if(this.timeout==null){this.timeout=window.setTimeout(createRef(this,this.slideStep),this.scrollDelay*2)}}},this.stop=function(){window.clearTimeout(this.timeout);this.timeout=null;this.paused=true};this.showImage=function(K){}}function onMouseOver(N){target=getTarget(N);var E=target.src;var K=E.lastIndexOf("/");var H=E.substring(K+1);var J=H.indexOf("-");var I=H.substring(0,J);target.Slider.stop();dojo.connect(target,"onmouseout",target.Slider.mouseOut);return;var L=229;var F=229-44;var C=parseInt(target.style.left)-4;var M=C;var D=slider.offsetWidth;if(C>D-L){C=C-F;if(C>D-L){C=D-L}M=C+F}if(C<0){C=0;M=C}var A=target.Slider.popup;if(!isNaN(C)){A.style.left=C+"px"}A.style.display="";var G=target.Slider.popupTab;if(!isNaN(M)){G.style.left=M+"px"}G.style.display="";target.Slider.showImage(target);var B=++globalRequestId;dojo.xhrGet({url:"/app/getTickerProfile?requestId="+B+"&userId="+I,handleAs:"json",timeout:5000,load:function(P,O){if(P.status=="ok"){profileLoaded(P)}else{}},error:function(P,O){}})}function onMouseOut(A){target=getTarget(A);var D=target.src;var B=D.lastIndexOf("/");var F=D.substring(B+1);var E=F.indexOf("-");var C=F.substring(0,E);target.Slider.start()}function pictureMouseOver(A){window.clearTimeout(mouseOutTimerId);window.clearTimeout(profileLoadedTimerId);profileDiv.style.display="none";profileIconMaleDiv.style.display="none";profileIconFemaleDiv.style.display="none";pause=true;var I=getTarget(A);var C=parseInt(I.style.left)-4;var K=C;var E=slider.offsetWidth;if(C>E-popupWidth){C=C-popupTabDelta;if(C>E-popupWidth){C=E-popupWidth}K=C+popupTabDelta}if(C<0){C=0;K=C}if(!isNaN(C)){popup.style.left=C+"px"}popup.style.display="";if(!isNaN(K)){popupTab.style.left=K+"px"}popupTab.style.display="";var D=I.src;var J=D.lastIndexOf("/");var F=D.substring(J+1);var H=F.indexOf("-");var G=F.substring(0,H);var B=++globalRequestId;dojo.xhrGet({url:"/app/getTickerProfile?requestId="+B+"&userId="+G,handleAs:"json",timeout:5000,load:function(M,L){if(M.status=="ok"){createRef(this,profileLoaded).call(M)}else{console.error("error while requesting profile data")}},error:function(M,L){}})}function profileLoaded(A){var G=dojo.byId("profileTableRight");var T=dojo.byId("profileImage");var B=dojo.byId("sliderPopup");var R=dojo.byId("profileTextBottom");var E=dojo.byId("profileTableLeftFemale");var U=dojo.byId("profileTableLeftMale");var X=173;var Z=20;var Y=20;if(A.requestId!=globalRequestId){return}if(B.style.display=="none"){}var Q=A.gender=="MALE";var O=A.userName;var N=folder+A.imageFileName;var M=A.age;var D=A.level;var J=A.fans;var F=A.city;var W=parseInt(A.fameRankPercentage);var S=W/100*X;var I=Q?profileBottomTextMale:profileBottomTextFemale;I=I.replace(/\{0\}/g,W);if(Q){profileNameDiv=dojo.byId("profileNameMale");profileProgressDiv=dojo.byId("profileProgressMale");profileProgressCircleImgDiv=dojo.byId("profileProgressCircleImgMale");profileProgressCircleTextDiv=dojo.byId("profileProgressCircleTextMale")}else{profileNameDiv=dojo.byId("profileNameFemale");profileProgressDiv=dojo.byId("profileProgressFemale");profileProgressCircleImgDiv=dojo.byId("profileProgressCircleImgFemale");profileProgressCircleTextDiv=dojo.byId("profileProgressCircleTextFemale")}T.src=N;profileNameDiv.innerHTML=O;G.innerHTML=M+"<br />"+D+"<br />"+J+"<br />"+F;profileProgressDiv.style.clip="rect(auto "+S+"px auto auto)";var P=Z+(Y-Z)*W/100;profileProgressCircleImgDiv.style.left=P+"px";profileProgressCircleTextDiv.style.left=P+"px";profileProgressCircleTextDiv.innerHTML=W;R.innerHTML=I;U.style.display=Q?"":"none";var K=dojo.byId("profileMale");K.style.display=Q?"":"none";var H=dojo.byId("profileIconMale");H.style.display=Q?"":"none";E.style.display=Q?"none":"";var V=dojo.byId("profileFemale");V.style.display=Q?"none":"";var C=dojo.byId("profileIconFemale");C.style.display=Q?"none":"";var L=dojo.byId("profile");L.style.display=""}function pictureMouseOut(A){mouseOutTimerId=window.setTimeout("closeIfMouseOut();",500)}function sliderPopupMouseOver(){mouseOverPopup=true}function sliderPopupMouseOut(){mouseOverPopup=false;mouseOutTimerId=window.setTimeout("closeIfMouseOut();",500)}function closeIfMouseOut(){if(!mouseOverPopup){pause=false;var B=dojo.byId("sliderPopup");var A=dojo.byId("sliderPopupTab");B.style.display="none";A.style.display="none";globalRequestId++}}function SlideShow(B,A,D,C){D.SlideShow=this;this.slider=D;this.allImages=A;this.folder=B;this.frameWidth=D.clientWidth;this.frameHeight=D.clientHeight;this.imageIndex=0;this.paused=false;this.lastImage=null;this.fadeInTime=1000;this.slideDelay=C;this.images=new Array();this.start=function(){this.animStep()};this.showNextImage=function(){if(this.lastImage!=undefined){this.lastImage.style.zIndex="10"}var F=this.folder+this.allImages[this.imageIndex];if(this.imageIndex>=this.images.length){var E=document.createElement("img");E.src=F;dojo._setOpacity(E,"0");E.style.position="absolute";this.images[this.imageIndex]=E;this.slider.appendChild(E)}else{E=this.images[this.imageIndex]}E.style.zIndex="100";E.style.display="";if(!E.complete){dojo.connect(E,"onload",createRef(this,function(){this.showImage(E)}))}else{this.showImage(E)}};this.showImage=function(F){var G=dojo.anim(F,{opacity:1},this.fadeInTime);if(this.lastImage!=null){var E=this.lastImage;dojo.connect(G,"onEnd",function(){dojo._setOpacity(E,"0");E.style.display="none"})}G.play();this.imageIndex=this.getNextImageIndex();this.lastImage=F;window.setTimeout(createRef(this,this.animStep),this.slideDelay)};this.animStep=function(){this.showNextImage()};this.getNextImageIndex=function(){var E=this.imageIndex+1;if(E>=this.allImages.length){E=0}return E}}function WordToggler(B,A){this.container=B;this.catchwordsArray=A;this.contentParagraph=dojo.query("p",this.container)[0];this.catchWordIndex=0;this.fadeInTime=1000;this.switchTime=14000;this.start=function(){this.container.style.display="";this.container.style.opacity="0";var C=dojo.anim(this.container,{opacity:1},this.fadeInTime);this.showNextCatchWord()},this.showNextCatchWord=function(){currentCatchWord=this.catchwordsArray[this.catchWordIndex];this.contentParagraph.innerHTML="";this.contentParagraph.appendChild(document.createTextNode(currentCatchWord));this.catchWordIndex++;if(this.catchWordIndex>=this.catchwordsArray.length){this.catchWordIndex=0}window.setTimeout(createRef(this,this.showNextCatchWord),this.switchTime)}};