Imagelooop.PAGE.changeCounter=1;Imagelooop.PAGE.changeInterval=false;$(document).ready(function(){$("#launchpadBgDiv").css("opacity",0.75).css("height",$(window).height()+"px");$("#launchpadDiv").css("height",$(window).height()+"px");var E=$("#right div");Imagelooop.PAGE.approveImages=$("#sl_detail_approvetable div.approveImage");Imagelooop.PAGE.subCancelers=E.find("div[@type=changeBox]");Imagelooop.PAGE.stars=E.find("div.stars a");Imagelooop.PAGE.changeBoxes=E.find("[@type=changeBox]");Imagelooop.PAGE.changeBoxLinks=E.find("a.dotLink");Imagelooop.PAGE.changeBoxLinks.each(function(F){this.myImg=$(this).find("img")[0];this.myBox=Imagelooop.PAGE.changeBoxes[F];this.index=F});Imagelooop.PAGE.changeBoxLinks.click(function(){window.clearInterval(Imagelooop.PAGE.changeInterval);$(this).mouseover();this.blur();return changeBox(this.index)}).mouseover(function(){this.myImg.src=this.myImg.src.replace(/dot\./,"dot-active.")}).mouseout(function(){var F=Imagelooop.PAGE.changeBoxLinks.index(this);if(!Imagelooop.PAGE.changeBoxes[this.index].getAttribute("active")||Imagelooop.PAGE.changeBoxes[this.index].getAttribute("active")=="false"){this.myImg.src=this.myImg.src.replace(/dot-active/,"dot")
}});Imagelooop.PAGE.stars.each(function(F){this.index=F;this.myImg=$(this).parent().find("img")[F];this.myImgSrc=this.myImg.src;var G=(mainSiteStaticUrl+"/_img/slDetail/star");if(this.index<Math.round(Imagelooop.PAGE.mainObject.getMetaData()["rating"])){this.myImgSrc=(G+"-active.gif")}else{this.myImgSrc=(G+".gif")}this.myImg.src=this.myImgSrc}).mouseover(function(){var F=$(this);Imagelooop.PAGE.stars.each(function(G){if(G>F.attr("index")){return }Imagelooop.PAGE.stars[G].myImg.src=Imagelooop.PAGE.stars[G].myImg.src.replace(/([^/\.]*\.[\w]{3})$/,"star-gold.gif")})}).mouseout(function(){Imagelooop.PAGE.stars.each(function(F){Imagelooop.PAGE.stars[F].myImg.src=this.myImgSrc})}).click(function(){this.blur();try{var H=("looopID="+Imagelooop.PAGE.mainObject.getId());H+=("&rating="+(this.index+1));Imagelooop.PAGE.mainObject.ilMain.rpcCall("imagelooop.looopRating",H,function(J){if(!J||(J&&J.isException)){return false}displayCheckArr("success",false);try{$("#voteCount").html(J.voteCount);$("#currentVote").html(Math.round(J.rating*10)/10)
}catch(I){}})}catch(F){}var G=this;Imagelooop.PAGE.stars.each(function(I){if(I<=G.index){this.myImg.src=this.myImg.src.replace(/star[-\w]*\.[\w]{3}/,"star-active.gif")}else{this.myImg.src=this.myImg.src.replace(/star[-\w]*\.[\w]{3}/,"star.gif")}});Imagelooop.PAGE.stars.unbind();Imagelooop.PAGE.stars.css("cursor","default");return false});Imagelooop.PAGE.subCancelers.one("click",function(){Imagelooop.PAGE.subCancelers.unbind();window.clearInterval(Imagelooop.PAGE.changeInterval)});Imagelooop.PAGE.changeInterval=window.setInterval("changeBox((Imagelooop.PAGE.changeCounter % Imagelooop.PAGE.changeBoxes.length));Imagelooop.PAGE.changeCounter++;",30000);var B=400;var C=325;try{var B=parseInt(Imagelooop.PAGE.mainObject.getLpcfg()["width"]);var C=parseInt(Imagelooop.PAGE.mainObject.getLpcfg()["height"])}catch(A){}var D="";try{D=Imagelooop.PAGE.mainObject.name}catch(A){D="slider"}Imagelooop.PAGE.launchpadMenu=$Launchpad.CreateMenu({userId:"473c4df06a8f0108",customCSS:"http://cdn.clearspring.com/launchpad/skins/black.css",widgetName:D,source:"clearspringDiv",sources:{myspace:"clearspringMySpaceDiv",friendster:"clearspringFriendsterDiv",hi5:"clearspringHi5Div"},menuWidth:500,menuHeight:300,targetElement:"clearspringShowDiv",widgetWidth:B,widgetHeight:C,servicesInclude:["myspace","blogger","live","orkut","hi5","friendster","facebook","piczo","netvibes","typepad","xanga","google","spaces","tagged","livejournal","pageflakes","typepadsidebar","bloggersidebar","blackplanet","eons","freewebs","multiply","webwag","bookmark","embed"]})
});$(window).load(function(){Imagelooop.PAGE.launchpadMenu.show()});function changeBox(C){if(!Imagelooop.PAGE.changeBoxes[C]){return false}var A;var B;Imagelooop.PAGE.changeBoxes.each(function(D){if(D==C){$(this).attr("active","true");A=$(this);$(Imagelooop.PAGE.changeBoxLinks[D]).trigger("mouseover")}else{if($(this).css("display")!="none"){B=$(this)}$(this).attr("active","false");$(Imagelooop.PAGE.changeBoxLinks[D]).trigger("mouseout")}});if(A&&B){B.fadeOut(1000);A.fadeIn(1000)}return false}function addFan(A){if(!$("#fanNameOrEmail").val()||$("#fanNameOrEmail").val()==youri18nEmail){alert("Please choose an email.");return false}var B=$.trim($("#fanNameOrEmail").val());if(B.search(/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/)<0){alert("Invalid email: "+B);return false}try{params=("userId="+A);params+=("&fanNameOrEmail="+encodeURIComponent(B));Imagelooop.PAGE.mainObject.ilMain.rpcCall("imagelooop.addFan",params,function(D){if(D.isException){window.setTimeout('alert("'+D.message+'");window.setTimeout(\'displayCheckArr("", false)\', 500);',100);
return false}window.setTimeout('displayCheckArr("success", 1)',1000)});displayCheckArr("wait",false);$("#fanboxview").css("display","none");$("#fanboxcheck").css("display","block")}catch(C){}return false}function displayCheckArr(G,B){window.clearInterval(Imagelooop.PAGE.changeInterval);var A=Imagelooop.PAGE.changeBoxes.filter("[@active=true]");var D=Imagelooop.PAGE.changeBoxes.index(A[0]);if(A.length>0){if(""+parseInt(B)!="NaN"&&G=="success"){A=removeBox(parseInt(B));Imagelooop.PAGE.changeBoxes.each(function(I){if(this==A[0]){D=I;return }})}var H=$("#changeCheckArrow");var F=$("#changeCheckArrow img");var E=F.attr("src");switch(G){case"wait":F.attr("src",E.replace(/([^/\.]*\.[\w]{3})$/,"ani_loading.gif"));break;case"success":F.attr("src",E.replace(/([^/\.]*\.[\w]{3})$/,"check.gif"));G="wasSuccess";break}if(H.css("display")=="none"){H.fadeIn(1000);A.fadeOut(1000);Imagelooop.PAGE.changeBoxLinks.css("visibility","hidden");var C="";if(B){C=Imagelooop.PAGE.changeBoxes.index(A)}if(G!="wait"){window.setTimeout("displayCheckArr('"+G+"','"+C+"')",2000)
}}else{if(G.toLowerCase().indexOf("success")>-1){A.fadeIn(1000);H.fadeOut(1000)}else{A.fadeOut(1000);H.fadeIn(1000)}Imagelooop.PAGE.changeBoxLinks.css("visibility","visible")}}return false}function removeBox(C){var D=$(Imagelooop.PAGE.changeBoxes[C]);if(!D||D.length<=0){return false}var B=$(Imagelooop.PAGE.changeBoxes[C]);try{Imagelooop.PAGE.changeBoxes=Imagelooop.PAGE.changeBoxes.not(remover);D.remove();if(B&&B.length>0){B.remove();Imagelooop.PAGE.changeBoxLinks=Imagelooop.PAGE.changeBoxLinks.not(B);Imagelooop.PAGE.changeBoxLinks.each(function(E){$(this).attr("index",E)})}changeBox(C%Imagelooop.PAGE.changeBoxes.length)}catch(A){}return $(Imagelooop.PAGE.changeBoxes[C%Imagelooop.PAGE.changeBoxes.length])}function shareMe(E){var D=$.trim($("#shareSenderName").val());var B=$.trim($("#shareSenderMail").val());var A=$.trim($("#shareRecipientMail").val());if(D.length==0||D==$("#shareSenderName")[0].defaultValue){alert(i18n_share_error_senderNameRequired);return }if(B.length==0||B==$("#shareSenderMail")[0].defaultValue){alert(i18n_share_error_senderMailRequired);
return }if(B.search(/^[^@]+@[^@]+\.[^@]+$/)<0){alert(i18n_share_error_invalidMail+" "+B);return }if(A.length==0||A==$("#shareRecipientMail")[0].defaultValue){alert(i18n_share_error_recipientMailRequired);return }if(A.indexOf(",")>-1){A=A.split(",")}else{if(A.indexOf(";")>-1){A=A.split(";")}else{A=A.split(" ")}}for(var C=0;C<A.length;++C){A[C]=$.trim(A[C]);if(A[C].search(/^[^@]+@[^@]+\.[^@]+$/)<0){alert(i18n_share_error_invalidMail+" "+A[C]);return }}try{var G=("looopID="+Imagelooop.PAGE.mainObject.getId());G+=("&senderName="+encodeURIComponent(D));G+=("&senderMail="+encodeURIComponent(B));G+=("&recipients="+encodeURIComponent(A.join(",")));G+=("&message=");displayCheckArr("wait",false);Imagelooop.PAGE.mainObject.ilMain.rpcCall("imagelooop.sendLooop",G,function(H){if(H.isException){displayCheckArr("",false);alert("Could not send invitation: "+H.message)}else{displayCheckArr("success",false);$("#shareRecipientMail").val($("#shareRecipientMail")[0].defaultValue)}});if(E&&E.blur){E.blur()}}catch(F){}}function postComment(C,B,E){C=C||window.event;
E=$.trim($(E).val()).replace(/</,"&lt;").replace(/>/,"&gt");B=$.trim($(B).val()).replace(/</,"&lt;").replace(/>/,"&gt");if(!B){alert("Invalid title(empty)");return false}if(!E){alert("Invalid message(empty)");return false}else{if(E.length>2000){alert("Message exceeds maxLength of 2000 signs");return false}}var F=("looopID="+Imagelooop.PAGE.mainObject.getId());F+=("&title="+encodeURIComponent(B));F+=("&comment="+encodeURIComponent(E));$("#commentAddTable").fadeTo(1,0.5);var D=$(C.target||C.srcElement);D.oldOnclick=D.onclick;D.click(function(){});var A=$("#copyRow").clone(true);A.find(".commentTitle div").html(B);A.find(".commentMessage div").html(E);A.find(".commentTimeSpan").html("&nbsp;");A.attr("id","rd_"+Math.random());A.css("display","block");A.css("padding","0px");D.cloneRow=A;Imagelooop.PAGE.mainObject.ilMain.rpcCall("imagelooop.addComment",F,function(H,G){$("#commentAddSndr").val("");$("#commentAddMsg").val("");$("#commentAddTable").fadeTo(1,1);window.globalBlargh=G;$("#commentListTable").prepend(G.cloneRow);
if(G.oldOnclick){G.click(G.oldOnclick)}},D);return false}function removeComment(B,A){var D=("looopID="+Imagelooop.PAGE.mainObject.getId());D+=((A?"&imageID=":"&messageID=")+B);if(confirm(i18nCommentDelete)){var C=(A?"imagelooop.deleteImage":"imagelooop.removeComment");Imagelooop.PAGE.mainObject.ilMain.rpcCall(C,D,function(G,F){if(!G||G.isException){var E="Error during deletion of comment";if(G&&G.info){E+=("\n"+G.info)}alert(E)}else{$("#commentShow_"+F).fadeOut(1000,function(){$(this).remove()})}},B)}return false}function showOriginal(){if(!Imagelooop.PAGE.mainObject.isOriginal){Imagelooop.PAGE.mainObject.isOriginal=false;if(!Imagelooop.PAGE.origHtml){Imagelooop.PAGE.origHtml=Imagelooop.PAGE.mainObject.ilMain.getLooopPlayerExportHtml("slideshowDetail");$("#origFlash").html(Imagelooop.PAGE.origHtml)}$("#flash").html(Imagelooop.PAGE.origHtml);$("#originalLink").html(i18nShowDetail)}else{$("#flash").html(Imagelooop.PAGE.labHtml);$("#originalLink").html(i18nShowSlideshow)}Imagelooop.PAGE.mainObject.isOriginal=!Imagelooop.PAGE.mainObject.isOriginal;
return false}var oldSlDetail_onload=window.onload;window.onload=function(){if(oldSlDetail_onload){oldSlDetail_onload()}try{Imagelooop.PAGE.clrSprPad.show()}catch(A){}};function disapproveAll(A){var B=0;Imagelooop.PAGE.approveImages.each(function(C){window.setTimeout("disapproveImage('"+this.id.split("_")[1]+"', "+A+")",C*200+50);B++});$("#approve_title").fadeIn(B*200+50).fadeOut(1000,function(){$(this).remove()});$("#sl_detail_approvetable").fadeIn(B*200+50).fadeOut(1000,function(){$(this).remove()});return false}function disapproveImage(A,B){var C=("looopID="+Imagelooop.PAGE.mainObject.getId()+"&imageID="+A);if(B){C+="&published=true";window.il.rpcCall("imagelooop.setImageMetaData",C)}else{window.il.rpcCall("imagelooop.deleteImage",C)}$("#approvalImage_"+A).fadeOut(1000,function(){$(this).remove()});Imagelooop.PAGE.approveImages=Imagelooop.PAGE.approveImages.not("#approvalImage_"+A);if(Imagelooop.PAGE.approveImages.length<=0){disapproveAll(B)}}function toggleLaunchpad(B){if(B){Imagelooop.PAGE.launchpadMenu.show();
$("#clearspringShowDiv").css("top",$(window).height()/4);$("#clearspringCloseDiv").css("margin-top",($(window).height()/4)-16)}var A=2000;if(B){$("#launchpadDiv").slideDown(A,function(){$("#flash embed, #flash object").css("visibility","hidden")})}else{$("#flash embed, #flash object").css("visibility","visible");$("#launchpadDiv").slideUp(A);window.setTimeout("Imagelooop.PAGE.launchpadMenu.hide();",A+100)}return false};