var InstallHelper={build:false,guid:"EAC139A9-D22D-4c29-8D1C-252BE63750F9",browser:false,firstWindowHeight:window.innerHeight,windowHeight:0,log:function(A){StatLoggerNew.logEvent("newih_"+A)},clickedDownload:function(){InstallHelper.build=InstallerBuild;InstallHelper.windowHeight=window.innerHeight;InstallHelper.log("Download_Clicked");if(InstallHelper.build.browser=="ff"){return InstallHelper.ff_begin()}else{if(InstallHelper.build.browser=="ie"){return InstallHelper.ie_begin()}else{if(InstallHelper.build.browser=="sa"){return InstallHelper.sa_begin()}else{return InstallHelper.browser_not_supported()}}}return false},browser_not_supported:function(){InstallHelper.displayHelper("na_allproducts");return false},helper:false,current:false,displayHelper:function(A,B){if(!InstallHelper.helper){InstallHelper.helper=InstallHelper.window_factory($("divInstallHelper"))}if(A){if(InstallHelper.current){Effect.Fade(InstallHelper.current,{duration:0.5});setTimeout("Effect.Appear('"+A+"', { duration: 0.5 })",500)}else{Effect.Appear(A)}InstallHelper.current=A}if(!InstallHelper.helper.isOpen){InstallHelper.helper.open()}},window_factory:function(B){var A=new Control.Modal(B,Object.extend({overlayOpacity:0.9,className:"installhelper_window",closeOnClick:$("installhelper_window_close"),width:300,minHeight:150,position:[document.viewport.getWidth()-335,0],fade:true},{}));if(InstallHelper.build.browser!="ie"||InstallHelper.build.browserversion!="6"){Control.Overlay.container.setStyle({position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"});$("divInstallHelper").style.position="fixed"}return A},version_cmp:function(E,C){if(!C){return 1}var B=E.split(".");var A=C.split(".");if(B.length<3){B[2]=0}if(A.length<3){A[2]=0}if(B.length<4){B[3]=0}if(A.length<4){A[3]=0}for(var D=0;D<4;D++){if(B[D]>A[D]){InstallHelper.log("Version_Older");return 1}else{if(B[D]<A[D]){InstallHelper.log("Version_Newer");return -1}}}InstallHelper.log("Version_Same");return 0},sa_start:function(){return true},ff_linux:function(){InstallHelper.displayHelper("ff_linux","Firefox Linux");return false},ff_begin:function(){if(InstallHelper.build.browserversion=="3"){return InstallHelper.ff3_begin()}else{if(InstallHelper.build.browserversion=="2"){return InstallHelper.ff2_begin()}}},ff_install_try:false,ff_tryInstall:function(){var A=false;try{var C=new Array();C["Cooliris "+InstallHelper.build.majorVersion+" for Firefox"]={URL:$("downloadLink").href,IconURL:"/s/i/installer/firefox.png"};A=InstallTrigger.install(C)}catch(B){}InstallHelper.ff_install_try=A;return A},ff_barPresent:function(){if(InstallHelper.windowHeight>window.innerHeight){return true}var A=InstallHelper.firstWindowHeight-InstallHelper.windowHeight;return(A!=0&&(A<35||A>-35))},ff3_begin:function(){InstallHelper.ff3_waitForBarDown(1);return InstallHelper.ff_tryInstall()},ff3_waitForBarDown:function(A){if(A>5){InstallHelper.ff3_allowBarUp()}else{if(InstallHelper.ff_barPresent()){InstallHelper.ff3_allowBarDown()}else{setTimeout("InstallHelper.ff3_waitForBarDown("+(A+1)+")",500)}}},ff3_allowBarDown:function(){InstallHelper.log("Allow_Bar_Down");setTimeout("Effect.Appear('div_arrow_up', { duration: 1.0 });",1000);InstallHelper.displayHelper("ff3_instructions");InstallHelper.log("Shown_Instructions");InstallHelper.ff3_waitForBarUp()},ff3_waitForBarUp:function(){if(InstallHelper.windowHeight==window.innerHeight){InstallHelper.ff3_allowBarUp()}else{setTimeout("InstallHelper.ff3_waitForBarUp()",500)}},ff3_allowBarUp:function(){InstallHelper.log("Clicked_Allow");Effect.Fade("div_arrow_up",{duration:0.5});$("clickAllow").style.color="#666";$("clickInstallNow").style.color="#666";$("restartFirefox").style.color="#fff"},ff2_begin:function(){InstallHelper.ff2_waitForBarDown(1);InstallHelper.ff_tryInstall();return false},ff2_waitForBarDown:function(A){if(A>5){}else{if(InstallHelper.windowHeight>window.innerHeight){InstallHelper.ff2_allowBarDown()}else{setTimeout("InstallHelper.ff2_waitForBarDown("+(A+1)+")",500)}}},ff2_allowBarDown:function(){InstallHelper.log("Edit_Options_Bar_Down");$("ff2_clickEditOptions").style.color="#fff";$("ff2_clickAllow").style.color="#666";$("ff2_clickDownloadAgain").style.color="#666";InstallHelper.displayHelper("ff2_instructions");InstallHelper.ff2_waitForBarUp()},ff2_waitForBarUp:function(){if(InstallHelper.windowHeight==window.innerHeight){InstallHelper.ff2_allowBarUp()}else{setTimeout("InstallHelper.ff2_waitForBarUp()",500)}},ff2_allowBarUp:function(){InstallHelper.log("Clicked_Edit_Options");$("ff2_clickEditOptions").style.color="#666";$("ff2_clickAllow").style.color="#fff";setTimeout("InstallHelper.ff2_clickedAllow()",4000)},ff2_clickedAllow:function(){$("ff2_clickAllow").style.color="#666";$("ff2_clickDownloadAgain").style.color="#fff"},ff2_clickedDownloadAgain:function(){InstallHelper.log("Download_Clicked_Again");InstallHelper.windowHeight=window.innerHeight;InstallHelper.ff2_begin()},ie_cookie:"activexinstall",ie_cookie_val:false,ie_ax_on:false,ie_begin:function(){InstallHelper.ie_ax_write();setTimeout("InstallHelper.ie_ax_ask()",500);return false},ie_onload:function(){if(Cookie.get(InstallHelper.ie_cookie)=="try"||Cookie.get(InstallHelper.ie_cookie)=="try2"){InstallHelper.build=InstallerBuild;InstallHelper.ie_ax_yes(true);InstallHelper.ie_begin();InstallHelper.ie_retry_switch=true;setTimeout("InstallHelper.ie_begin_retry() ",1500)}},ie_retry_switch:false,ie_begin_retry:function(){InstallHelper.log("AX_Retry");$("debug").innerHTML+="Retry.";if(InstallHelper.ie_retry_switch){InstallHelper.ie_ax_write();setTimeout("InstallHelper.ie_begin_retry()",2500)}},ie_cookie_exp:0.0052,ie_cookie_func:function(){var A=Cookie.get(InstallHelper.ie_cookie);if(A=="try"){Cookie.set(InstallHelper.ie_cookie,"try2",InstallHelper.ie_cookie_exp);InstallHelper.ie_cookie_val="try";InstallHelper.ie_ax_on=true}else{if(A=="try2"){Cookie.eat(InstallHelper.ie_cookie);InstallHelper.ie_cookie_val="try2";InstallHelper.ie_ax_on=true}else{if(!A){Cookie.set(InstallHelper.ie_cookie,"try",InstallHelper.ie_cookie_exp);InstallHelper.ie_cookie_val=false}}}},ie_MSI_begin:function(){InstallHelper.log("MSI_Begin");InstallHelper.ie_window_close_ask(InstallHelper.ie_MSI_instructions)},ie_MSI_instructions:function(){InstallHelper.log("MSI_Instructions");InstallHelper.displayHelper("ie_MSI_instructions")},ie_MSI_download:function(){InstallHelper.log("MSI_Download");window.location=InstallHelper.build.full;return false},ie_context:false,ie_context_exists:false,ie_context_start:function(){try{InstallHelper.ie_context=new ActiveXObject("PicLens.Context")}catch(A){InstallHelper.ie_context=null;return true}if(InstallHelper.ie_context){window.piclens=InstallHelper.ie_context}},ie_context_version_cmp:function(A){if(InstallHelper.ie_context){return InstallHelper.version_cmp(A,InstallHelper.ie_context.version)}return null},ie_ax_plinstaller:false,ie_ax_write:function(C){var B='<object id="plinstaller" classid="clsid:'+InstallHelper.guid+'" codebase="/shared/plinstll.cab"></object>';var A=$("activexiframe");var D=A.contentWindow||A.contentDocument;if(D.document){D=D.document}D.open();D.write(B);InstallHelper.ie_ax_plinstaller=D.getElementById("plinstaller");InstallHelper.ie_ax_attach();D.close()},ie_ax_attach:function(){InstallHelper.ie_ax_plinstaller.attachEvent("ControlStarted",InstallHelper.ie_ax_onControlStarted);InstallHelper.ie_ax_plinstaller.attachEvent("DownloadStarting",InstallHelper.ie_ax_onDownloadStarting);InstallHelper.ie_ax_plinstaller.attachEvent("DownloadProgress",InstallHelper.ie_ax_onDownloadProgress);InstallHelper.ie_ax_plinstaller.attachEvent("DownloadComplete",InstallHelper.ie_ax_onDownloadComplete);InstallHelper.ie_ax_plinstaller.attachEvent("InstallStarting",InstallHelper.ie_ax_onInstallStarting);InstallHelper.ie_ax_plinstaller.attachEvent("InstallFailed",InstallHelper.ie_ax_onInstallFailed);InstallHelper.ie_ax_plinstaller.attachEvent("InstallSucceeded",InstallHelper.ie_ax_onInstallSucceeded)},ie_ax_ask:function(){if(!InstallHelper.ie_ax_on){InstallHelper.log("AX_Ask_Bar");InstallHelper.displayHelper("ie_ask_AX")}},ie_ax_yes:function(A){InstallHelper.ie_cookie_func();if(A){InstallHelper.log("AX_Clicked_Bar");$("ie_ax_inst_1").style.color="#666";$("ie_ax_inst_2").style.color="#666"}else{InstallHelper.log("AX_Sees_Bar")}InstallHelper.displayHelper("ie_AX_instructions")},ie_ax_downgrade:function(){InstallHelper.log("Downgrading");InstallHelper.ie_window_close_ask(InstallHelper.ie_ax_confirm)},ie_ax_confirm:function(){InstallHelper.log("AX_Installer_Go");var A=InstallHelper.build.url.lastIndexOf("/");var C=InstallHelper.build.url.substring(0,A+1);var B=InstallHelper.build.url.substring(A+1);InstallHelper.ie_ax_plinstaller.go(C,B)},ie_ax_onControlStarted:function(){InstallHelper.log("AX_Control_Started");InstallHelper.ie_retry_switch=false;InstallHelper.ie_ax_on=true;if(InstallHelper.ie_cookie_val=="try"){InstallHelper.log("AX_Just_Allowed")}else{if(!InstallHelper.ie_cookie_val){InstallHelper.log("AX_Already_Allowed")}}Cookie.eat(InstallHelper.ie_cookie);InstallHelper.ie_context_start();var A=InstallHelper.ie_context_version_cmp(InstallHelper.build.buildVersion);if(A===0){InstallHelper.log("AX_Client_UpToDate");InstallHelper.ie_ax_onAlreadyUpToDate()}else{if(A<0){InstallHelper.log("AX_Ask_Downgrade");InstallHelper.displayHelper("ie_downgrade")}else{if(InstallHelper.ie_context){InstallHelper.log("AX_Client_Older")}else{InstallHelper.log("AX_Client_Unexistant")}InstallHelper.ie_window_close_ask(InstallHelper.ie_ax_confirm)}}},ie_ax_onDownloadStarting:function(){InstallHelper.log("AX_Download_Start");InstallHelper.displayHelper("ie_download")},ie_ax_onDownloadProgress:function(A,C){if(A>0&&C>0){var B=A/C*99;$("ie_progressbar_fill").style.width=B+"%"}},ie_ax_onDownloadComplete:function(A){if(A){InstallHelper.log("AX_Download_Succeed");$("ie_progressbar_fill").style.width="99%";Effect.Appear("ie_download_complete",{duration:0.5})}else{InstallHelper.log("AX_Download_Failed");InstallHelper.ie_MSI_instructions()}},ie_ax_onInstallStarting:function(){InstallHelper.log("AX_Install_Start");InstallHelper.displayHelper("ie_install")},ie_ax_onInstallFailed:function(){InstallHelper.log("AX_Install_Failed");InstallHelper.ie_MSI_instructions()},ie_ax_onInstallSucceeded:function(){InstallHelper.log("AX_Install_Succeed")},ie_ax_onAlreadyUpToDate:function(){InstallHelper.displayHelper("ie_uptodate")},ie_window_close_func:false,ie_window_close_ask:function(A){InstallHelper.log("AX_Ask_Window_Close");InstallHelper.ie_window_close_func=A;InstallHelper.displayHelper("window_close_warning")},ie_window_close_confirm:function(){InstallHelper.log("AX_Confirmed_Window_Close");InstallHelper.ie_window_close_func()},end:true};