var deployJava={debug:null,myInterval:null,preInstallJREList:null,returnPage:null,brand:null,locale:null,installType:null,EAInstallEnabled:false,EarlyAccessURL:null,getJavaURL:"http://java.sun.com/webapps/getjava/BrowserRedirect?host=java.com",appleRedirectPage:"http://www.apple.com/support/downloads/",oldMimeType:"application/npruntime-scriptable-plugin;DeploymentToolkit",mimeType:"application/java-deployment-toolkit",launchButtonPNG:"http://java.sun.com/products/jfc/tsc/articles/swing2d/webstart.png",getJREs:function(){var E=new Array();if(deployJava.isPluginInstalled()){var D=deployJava.getPlugin();var A=D.jvms;for(var C=0;C<A.getLength();C++){E[C]=A.get(C).version}}else{var B=deployJava.getBrowser();if(B=="MSIE"){if(deployJava.testUsingActiveX("1.8.0")){E[0]="1.8.0"}else{if(deployJava.testUsingActiveX("1.7.0")){E[0]="1.7.0"}else{if(deployJava.testUsingActiveX("1.6.0")){E[0]="1.6.0"}else{if(deployJava.testUsingActiveX("1.5.0")){E[0]="1.5.0"}else{if(deployJava.testUsingActiveX("1.4.2")){E[0]="1.4.2"}else{if(deployJava.testForMSVM()){E[0]="1.1"}}}}}}}else{if(B=="Netscape Family"){if(deployJava.testUsingMimeTypes("1.8")){E[0]="1.8.0"}else{if(deployJava.testUsingMimeTypes("1.7")){E[0]="1.7.0"}else{if(deployJava.testUsingMimeTypes("1.6")){E[0]="1.6.0"}else{if(deployJava.testUsingMimeTypes("1.5")){E[0]="1.5.0"}else{if(deployJava.testUsingMimeTypes("1.4.2")){E[0]="1.4.2"}}}}}}else{if(B=="Safari"){if(deployJava.testUsingPluginsArray("1.8.0")){E[0]="1.8.0"}else{if(deployJava.testUsingPluginsArray("1.7.0")){E[0]="1.7.0"}else{if(deployJava.testUsingPluginsArray("1.6.0")){E[0]="1.6.0"}else{if(deployJava.testUsingPluginsArray("1.5.0")){E[0]="1.5.0"}else{if(deployJava.testUsingPluginsArray("1.4.2")){E[0]="1.4.2"}}}}}}}}}if(deployJava.debug){for(var C=0;C<E.length;++C){alert("We claim to have detected Java SE "+E[C])}}return E},installJRE:function(B){var A=false;if(deployJava.isPluginInstalled()){if(deployJava.getPlugin().installJRE(B)){deployJava.refresh();if(deployJava.returnPage!=null){document.location=deployJava.returnPage}return true}else{return false}}else{return deployJava.installLatestJRE()}},installLatestJRE:function(){if(deployJava.isPluginInstalled()){if(deployJava.getPlugin().installLatestJRE()){deployJava.refresh();if(deployJava.returnPage!=null){document.location=deployJava.returnPage}return true}else{return false}}else{var B=deployJava.getBrowser();var A=navigator.platform.toLowerCase();if((deployJava.EAInstallEnabled=="true")&&(A.indexOf("win")!=-1)&&(deployJava.EarlyAccessURL!=null)){deployJava.preInstallJREList=deployJava.getJREs();if(deployJava.returnPage!=null){deployJava.myInterval=setInterval("deployJava.poll()",3000)}location.href=deployJava.EarlyAccessURL;return false}else{if(B=="MSIE"){return deployJava.IEInstall()}else{if((B=="Netscape Family")&&(A.indexOf("win32")!=-1)){return deployJava.FFInstall()}else{location.href=deployJava.getJavaURL+((deployJava.returnPage!=null)?("&returnPage="+deployJava.returnPage):"")+((deployJava.locale!=null)?("&locale="+deployJava.locale):"")+((deployJava.brand!=null)?("&brand="+deployJava.brand):"")}}return false}}},runApplet:function(B,F,D){if(D=="undefined"||D==null){D="1.1"}var E="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$";var A=D.match(E);if(deployJava.returnPage==null){deployJava.returnPage=document.location}if(A!=null){var C=deployJava.getBrowser();if((C!="?")&&(C!="Safari")){if(deployJava.versionCheck(D+"+")){deployJava.writeAppletTag(B,F)}else{if(deployJava.installJRE(D+"+")){deployJava.refresh();location.href=document.location;deployJava.writeAppletTag(B,F)}}}else{deployJava.writeAppletTag(B,F)}}else{if(deployJava.debug){alert("Invalid minimumVersion argument to runApplet():"+D)}}},writeAppletTag:function(A,E){var C="<applet ";for(var D in A){C+=(" "+D+'="'+A[D]+'"')}C+=">";document.write(C);if(E!="undefined"&&E!=null){var B=false;for(var F in E){if(F=="codebase_lookup"){B=true}C='<param name="'+F+'" value="'+E[F]+'">';document.write(C)}if(!B){document.write('<param name="codebase_lookup" value="false">')}}document.write("</applet>")},versionCheck:function(H){var C=0;var F="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?(\\*|\\+)?$";var A=H.match(F);if(A!=null){var E=true;var B=new Array();for(var D=1;D<A.length;++D){if((typeof A[D]=="string")&&(A[D]!="")){B[C]=A[D];C++}}if(B[B.length-1]=="+"){E=false;B.length--}else{if(B[B.length-1]=="*"){B.length--}}var G=deployJava.getJREs();for(var D=0;D<G.length;++D){if(deployJava.compareVersionToPattern(G[D],B,E)){return true}}return false}else{alert("Invalid versionPattern passed to versionCheck: "+H);return false}},isWebStartInstalled:function(D){var C=deployJava.getBrowser();if((C=="?")||(C=="Safari")){return true}if(D=="undefined"||D==null){D="1.4.2"}var B=false;var E="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$";var A=D.match(E);if(A!=null){B=deployJava.versionCheck(D+"+")}else{if(deployJava.debug){alert("Invalid minimumVersion argument to isWebStartInstalled(): "+D)}B=deployJava.versionCheck("1.4.2+")}return B},createWebStartLaunchButton:function(C,B){if(deployJava.returnPage==null){deployJava.returnPage=C}var A="javascript:if (!deployJava.isWebStartInstalled(&quot;"+B+"&quot;)) {if (deployJava.installLatestJRE()) {if (deployJava.launch(&quot;"+C+"&quot;)) {}}} else {if (deployJava.launch(&quot;"+C+"&quot;)) {}}";document.write('<a href="'+A+'" onMouseOver="window.status=\'\'; return true;"><img src="'+deployJava.launchButtonPNG+'" border="0" /></a>')},launch:function(A){if(deployJava.isPluginInstalled()){return deployJava.getPlugin().launch(A)}else{document.location=A;return true}},isPluginInstalled:function(){var A=deployJava.getPlugin();if(A&&A.jvms){return true}else{return false}},isAutoUpdateEnabled:function(){if(deployJava.isPluginInstalled()){return deployJava.getPlugin().isAutoUpdateEnabled()}return false},setAutoUpdateEnabled:function(){if(deployJava.isPluginInstalled()){return deployJava.getPlugin().setAutoUpdateEnabled()}return false},setInstallerType:function(A){deployJava.installType=A;if(deployJava.isPluginInstalled()){return deployJava.getPlugin().setInstallerType(A)}return false},setAdditionalPackages:function(A){if(deployJava.isPluginInstalled()){return deployJava.getPlugin().setAdditionalPackages(A)}return false},setEarlyAccess:function(A){deployJava.EAInstallEnabled=A},isPlugin2:function(){if(deployJava.isPluginInstalled()){if(deployJava.versionCheck("1.6.0_10+")){try{return deployJava.getPlugin().isPlugin2()}catch(A){}}}return false},getPlugin:function(){deployJava.refresh();var A=document.getElementById("deployJavaPlugin");return A},compareVersionToPattern:function(F,B,C){var G="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$";var H=F.match(G);if(H!=null){var E=0;var I=new Array();for(var D=1;D<H.length;++D){if((typeof H[D]=="string")&&(H[D]!="")){I[E]=H[D];E++}}var A=Math.min(I.length,B.length);if(C){for(var D=0;D<A;++D){if(I[D]!=B[D]){return false}}return true}else{for(var D=0;D<A;++D){if(I[D]<B[D]){return false}else{if(I[D]>B[D]){return true}}}return true}}else{return false}},getBrowser:function(){var A=navigator.userAgent.toLowerCase();if(deployJava.debug){alert("userAgent -> "+A)}if((navigator.vendor)&&(navigator.vendor.toLowerCase().indexOf("apple")!=-1)&&(A.indexOf("safari")!=-1)){if(deployJava.debug){alert('We claim to have detected "Safari".')}return"Safari"}else{if(A.indexOf("msie")!=-1){if(deployJava.debug){alert('We claim to have detected "IE".')}return"MSIE"}else{if((A.indexOf("mozilla")!=-1)||(A.indexOf("firefox")!=-1)){if(deployJava.debug){alert("We claim to have detected a Netscape family browser.")}return"Netscape Family"}else{if(deployJava.debug){alert("We claim to have failed to detect a browser.")}return"?"}}}},testUsingActiveX:function(A){var C="JavaWebStart.isInstalled."+A+".0";if(!ActiveXObject){if(deployJava.debug){alert("Browser claims to be IE, but no ActiveXObject object?")}return false}try{return(new ActiveXObject(C)!=null)}catch(B){return false}},testForMSVM:function(){var B="{08B0E5C0-4FCB-11CF-AAA5-00401C608500}";if(typeof oClientCaps!="undefined"){var A=oClientCaps.getComponentVersion(B,"ComponentID");if((A=="")||(A=="5,0,5000,0")){return false}else{return true}}else{return false}},testUsingMimeTypes:function(B){if(!navigator.mimeTypes){if(deployJava.debug){alert("Browser claims to be Netscape family, but no mimeTypes[] array?")}return false}for(var C=0;C<navigator.mimeTypes.length;++C){s=navigator.mimeTypes[C].type;var A=s.match(/^application\/x-java-applet\x3Bversion=(1\.8|1\.7|1\.6|1\.5|1\.4\.2)$/);if(A!=null){if(deployJava.compareVersions(A[1],B)){return true}}}return false},testUsingPluginsArray:function(B){if((!navigator.plugins)||(!navigator.plugins.length)){return false}var A=navigator.platform.toLowerCase();for(var C=0;C<navigator.plugins.length;++C){s=navigator.plugins[C].description;if(s.search(/^Java Switchable Plug-in (Cocoa)/)!=-1){if(deployJava.compareVersions("1.5.0",B)){return true}}else{if(s.search(/^Java/)!=-1){if(A.indexOf("win")!=-1){if(deployJava.compareVersions("1.5.0",B)||deployJava.compareVersions("1.6.0",B)){return true}}}}}if(deployJava.compareVersions("1.5.0",B)){return true}return false},IEInstall:function(){location.href=deployJava.getJavaURL+((deployJava.returnPage!=null)?("&returnPage="+deployJava.returnPage):"")+((deployJava.locale!=null)?("&locale="+deployJava.locale):"")+((deployJava.brand!=null)?("&brand="+deployJava.brand):"")+((deployJava.installType!=null)?("&type="+deployJava.installType):"");return false},done:function(B,A){},FFInstall:function(){location.href=deployJava.getJavaURL+((deployJava.returnPage!=null)?("&returnPage="+deployJava.returnPage):"")+((deployJava.locale!=null)?("&locale="+deployJava.locale):"")+((deployJava.brand!=null)?("&brand="+deployJava.brand):"")+((deployJava.installType!=null)?("&type="+deployJava.installType):"");return false},compareVersions:function(D,E){var B=D.split(".");var A=E.split(".");for(var C=0;C<B.length;++C){B[C]=Number(B[C])}for(var C=0;C<A.length;++C){A[C]=Number(A[C])}if(B.length==2){B[2]=0}if(B[0]>A[0]){return true}if(B[0]<A[0]){return false}if(B[1]>A[1]){return true}if(B[1]<A[1]){return false}if(B[2]>A[2]){return true}if(B[2]<A[2]){return false}return true},enableAlerts:function(){deployJava.debug=true},poll:function(){deployJava.refresh();var A=deployJava.getJREs();if((deployJava.preInstallJREList.length==0)&&(A.length!=0)){clearInterval(deployJava.myInterval);if(deployJava.returnPage!=null){location.href=deployJava.returnPage}}if((deployJava.preInstallJREList.length!=0)&&(A.length!=0)&&(deployJava.preInstallJREList[0]!=A[0])){clearInterval(deployJava.myInterval);if(deployJava.returnPage!=null){location.href=deployJava.returnPage}}},writePluginTag:function(){var A=deployJava.getBrowser();if(A=="MSIE"){document.write('<object classid="clsid:CAFEEFAC-DEC7-0000-0000-ABCDEFFEDCBA" id="deployJavaPlugin" width="0" height="0"></object>')}else{if(A=="Netscape Family"){deployJava.writeEmbedTag()}}},refresh:function(){navigator.plugins.refresh(false);var A=deployJava.getBrowser();if(A=="Netscape Family"){var B=document.getElementById("deployJavaPlugin");if(B==null){deployJava.writeEmbedTag()}}},writeEmbedTag:function(){var A=false;if(navigator.mimeTypes!=null){for(var B=0;B<navigator.mimeTypes.length;B++){if(navigator.mimeTypes[B].type==deployJava.mimeType){if(navigator.mimeTypes[B].enabledPlugin){document.write('<embed id="deployJavaPlugin" type="'+deployJava.mimeType+'" hidden="true" />');A=true}}}if(!A){for(var B=0;B<navigator.mimeTypes.length;B++){if(navigator.mimeTypes[B].type==deployJava.oldMimeType){if(navigator.mimeTypes[B].enabledPlugin){document.write('<embed id="deployJavaPlugin" type="'+deployJava.oldMimeType+'" hidden="true" />')}}}}}},do_initialize:function(){deployJava.writePluginTag();if(deployJava.locale==null){var B=null;if(B==null){try{B=navigator.userLanguage}catch(A){}}if(B==null){try{B=navigator.systemLanguage}catch(A){}}if(B==null){try{B=navigator.language}catch(A){}}if(B!=null){B.replace("-","_");deployJava.locale=B}}}};deployJava.do_initialize();
