Qik.Streams=function(){var A=false;var D;var B;var C;return{homePage:function(){if($("txtEmail")){Event.observe("txtEmail","keyup",Qik.Streams.expandSignupForm);Event.observe("txtEmail","click",Qik.Streams.expandSignupForm)}if($("txtEmail")){$("txtEmail").focus()}if($("signupForm")){Qik.initializePhoneNumberInput()}},eventPage:function(){$$("div#eventsTopStrip ul li a").each(function(E){var H=E.up("li");var F=E.href.substring(E.href.indexOf("/video/")+7);var G=H.id.substring(H.id.indexOf("smallVideo")+10);E.onclick=function(){if(!isNaN(parseInt(F))){new Ajax.Updater($("userVideo").down(),"/streams/get/"+F+"?width=480&height=420",{asynchronous:true,evalScripts:true});return false}else{return}}})},macworldPage:function(){Qik.Streams.eventPage()},davosPage:function(){Qik.Streams.eventPage()},expandSignupForm:function(){if(!A&&!D){if(IS_IE6){$("signUpForQik").down().style.backgroundPosition="left bottom"}$("mainContent").style.zIndex=2;A=true;D=true;var G=$("signupForm");var E=$("signupFormBack");E.style.height="75px";var F=IS_IE?"210px":"205px";E.appear({duration:0.3,afterFinish:function(){new Effect.Parallel([new Effect.BlindDown($("hiddenFormFields"),{sync:true}),new Effect.Morph($("signupFormBack"),{sync:true,style:{height:F}})],{duration:0.5,afterFinish:function(){A=false;Event.observe(document.body,"click",Qik.Streams.closeSignupForm)}})}})}},closeSignupForm:function(F){if(!A&&D&&F.element().up("#signupForm")==null){A=true;D=false;var E=$("signupFormBack");new Effect.Parallel([new Effect.BlindUp($("hiddenFormFields"),{sync:true}),new Effect.Morph($("signupFormBack"),{sync:true,style:{height:"75px"}})],{duration:0.5,afterFinish:function(){E.fade({duration:0.3,afterFinish:function(){A=false;if(IS_IE6){$("signUpForQik").down().style.backgroundPosition="left top"}}})}})}},paginateTopQikkers:function(H,I){var G=$("featuredUsers").down(".paginateRight").down();var K=$("featuredUsers").down(".paginateLeft").down();G.onclick=function(){return false};K.onclick=function(){return false};I=I?parseInt(I):1;H=H?parseInt(H):1;var E=H>I;var J=window.location.href.replace(window.location.search,"").gsub("#","");var F=J+".js?snippet=top_qikkers&page="+H;if(updateDiv=$("topQikkerThumbs")){new Ajax.Request(F,{method:"get",onComplete:function(Q){updateDiv.insert({bottom:"<div class='tops2 clearFix' style='z-index:11;display:none'>"+Q.responseText+"</div>"});var P=updateDiv.down(".tops1");var O=updateDiv.down(".tops2");var N=parseInt($F("totalTopQikkerPages"));var M=updateDiv.down(".topQikkerBoxes");$$(".tops1 .infoBox").each(function(R){R.remove()});$("featuredUsers").insert({bottom:M.innerHTML});M.remove();$$(".tops2 ul li a").each(function(R){Event.observe(R,"mouseover",function(){Qik.Streams.topQikkerOver(R.id.gsub("topQikkerThumb",""))});Event.observe(R,"mouseout",function(){Qik.Streams.topQikkerOut()})});if(H>=N){G.style.visibility="hidden"}else{G.style.visibility="visible"}G.onclick=function(){Qik.Streams.paginateTopQikkers(H+1,H);return false};if(H<=1){K.style.visibility="hidden"}else{K.style.visibility="visible"}K.onclick=function(){Qik.Streams.paginateTopQikkers(H-1,H);return false};var L=O.getWidth();if(!E){L*=-1}O.style.left=L+"px";O.show();new Effect.Parallel([new Effect.Move(P,{x:-L,y:0,mode:"relative",sync:true}),new Effect.Move(O,{x:-L,y:0,mode:"relative",sync:true,delay:0.1})],{duration:0.7,afterFinish:function(){O.removeClassName("tops2").addClassName("tops1");P.remove()}})}})}return false},addTopQikkersPopups:function(E){new Ajax.Updater($("featuredUsers"),"/account/top_qikkers_info_boxes",{method:"get",insertion:Insertion.Bottom,onComplete:function(){$$(".tops1 ul li a").each(function(F){Event.observe(F,"mouseover",function(){Qik.Streams.topQikkerOver(F.id.gsub("topQikkerThumb",""))});Event.observe(F,"mouseout",function(){Qik.Streams.topQikkerOut()})})}})},topQikkerOver:function(E){clearTimeout(B);B=setTimeout("Qik.Streams.showInfoBox("+E+", 'topQikkerThumb"+E+"');",250)},topQikkerOut:function(){clearTimeout(B)},infoBoxOver:function(){clearTimeout(C)},infoBoxOut:function(){C=setTimeout("Qik.Streams.hideInfoBoxes()",1000)},showInfoBox:function(H,G){Qik.Streams.hideInfoBoxes();clearTimeout(C);var F=$(G).positionedOffset();var E=$("topQikkerBox"+H);if(E){$("mainContent").style.zIndex=11;E.style.left=(F[0]-35)+"px";E.style.bottom=(168-F[1])+"px";E.show()}},hideInfoBoxes:function(){$$(".infoBox").each(function(E){E.hide()})}}}();