var deployJava={ debug:null, firefoxJavaVersion:null, myInterval:null, preInstallJREList:null, returnPage:null, brand:null, locale:null, installType:null, EAInstallEnabled:false, EarlyAccessURL:null, getJavaURL:'http://www.java.com/ko/?', 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', browserName:null, browserName2:null, getJREs:function() { var list=new Array(); if(deployJava.isPluginInstalled()) { var plugin=deployJava.getPlugin(); var VMs=plugin.jvms; for(var i=0;i'; document.write(s); } if(!codebaseParam) { document.write(''); } } document.write('<'+'/'+'applet'+'>'); } ,versionCheck:function(versionPattern) { var index=0; var regex="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?(\\*|\\+)?$"; var matchData=versionPattern.match(regex); if(matchData!=null) { var familyMatch=true; var patternArray=new Array(); for(var i=1;i'+'<'+'PARAM name="launchjnlp" value="'+jnlp+'"'+'>'+'<'+'PARAM name="docbase" value="'+jnlpDocbase+'"'+'>'+'<'+'/'+'object'+'>'); } else if(browser=='Netscape Family') { document.write('<'+'embed type="application/x-java-applet;jpi-version='+ deployJava.firefoxJavaVersion+'" '+'width="0" height="0" '+'launchjnlp="'+jnlp+'"'+'docbase="'+jnlpDocbase+'"'+' />'); } document.location=jnlpDocbase; } ,createWebStartLaunchButtonEx:function(jnlp,minimumVersion) { if(deployJava.returnPage==null) { deployJava.returnPage=jnlp; } var url='javascript:deployJava.launchWebStartApplication(\''+jnlp+'\');'; document.write('<'+'a href="'+url+'" onMouseOver="window.status=\'\'; '+'return true;"><'+'img '+'src="'+deployJava.launchButtonPNG+'" '+'border="0" /><'+'/'+'a'+'>'); } ,createWebStartLaunchButton:function(jnlp,minimumVersion) { if(deployJava.returnPage==null) { deployJava.returnPage=jnlp; } var url='javascript:'+'if (!deployJava.isWebStartInstalled("'+ minimumVersion+'")) {'+'if (deployJava.installLatestJRE()) {'+'if (deployJava.launch("'+jnlp+'")) {}'+'}'+'} else {'+'if (deployJava.launch("'+jnlp+'")) {}'+'}'; document.write('<'+'a href="'+url+'" onMouseOver="window.status=\'\'; '+'return true;"><'+'img '+'src="'+deployJava.launchButtonPNG+'" '+'border="0" /><'+'/'+'a'+'>'); } ,launch:function(jnlp) { if(deployJava.isPluginInstalled()) { return deployJava.getPlugin().launch(jnlp); } else { document.location=jnlp; return true; } } ,isPluginInstalled:function() { var plugin=deployJava.getPlugin(); if(plugin&&plugin.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(type) { deployJava.installType=type; if(deployJava.isPluginInstalled()) { return deployJava.getPlugin().setInstallerType(type); } return false; } ,setAdditionalPackages:function(packageList) { if(deployJava.isPluginInstalled()) { return deployJava.getPlugin().setAdditionalPackages(packageList); } return false; } ,setEarlyAccess:function(enabled) { deployJava.EAInstallEnabled=enabled; } ,isPlugin2:function() { if(deployJava.isPluginInstalled()) { if(deployJava.versionCheck('1.6.0_10+')) { try { return deployJava.getPlugin().isPlugin2(); } catch(err) { } } } return false; } ,allowPlugin:function() { deployJava.getBrowser(); var ret=('Chrome'!=deployJava.browserName2&&'Safari'!=deployJava.browserName2&&'Opera'!=deployJava.browserName2); return ret; } ,getPlugin:function() { deployJava.refresh(); var ret=null; if(deployJava.allowPlugin()) { ret=document.getElementById('deployJavaPlugin'); } return ret; } ,compareVersionToPattern:function(version,patternArray,familyMatch) { var regex="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$"; var matchData=version.match(regex); if(matchData!=null) { var index=0; var result=new Array(); for(var i=1;ipatternArray[i]) // { // return true; // } // } // return true; // modify kj for (var i = 0; i < l; ++i) { if (result < patternArray) { return false; } else if (result > patternArray) { return true; } } for (var i = l; i < patternArray.length; ++i) { if (patternArray != "0") { return false; } } return true; } } else { return false; } } ,getBrowser:function() { if(deployJava.browserName==null) { var browser=navigator.userAgent.toLowerCase(); if(deployJava.debug) { alert('userAgent -> '+browser); } if(browser.indexOf('msie')!=-1) { deployJava.browserName='MSIE'; deployJava.browserName2='MSIE'; } else if(browser.indexOf('trident')!=-1) { deployJava.browserName='MSIE'; deployJava.browserName2='MSIE'; } else if(browser.indexOf('firefox')!=-1) { deployJava.browserName='Netscape Family'; deployJava.browserName2='Firefox'; } else if(browser.indexOf('chrome')!=-1) { deployJava.browserName='Netscape Family'; deployJava.browserName2='Chrome'; } else if(browser.indexOf('safari')!=-1) { deployJava.browserName='Netscape Family'; deployJava.browserName2='Safari'; } else if(browser.indexOf('mozilla')!=-1) { deployJava.browserName='Netscape Family'; deployJava.browserName2='Other'; } else if(browser.indexOf('opera')!=-1) { deployJava.browserName='Netscape Family'; deployJava.browserName2='Opera'; } else { //deployJava.browserName='?'; //deployJava.browserName2='unknown'; deployJava.browserName='MSIE'; deployJava.browserName2='MSIE'; } if(deployJava.debug) { alert('Detected browser name:'+deployJava.browserName+', '+deployJava.browserName2); } } return deployJava.browserName; } ,testUsingActiveX:function(version) { var objectName='JavaWebStart.isInstalled.'+version+'.0'; if(!ActiveXObject) { if(deployJava.debug) { alert('Browser claims to be IE, but no ActiveXObject object?'); } return false; } try { return(new ActiveXObject(objectName)!=null); } catch(exception) { return false; } } ,testForMSVM:function() { var clsid='{08B0E5C0-4FCB-11CF-AAA5-00401C608500}'; if(typeof oClientCaps!='undefined') { var v=oClientCaps.getComponentVersion(clsid,"ComponentID"); if((v=='')||(v=='5,0,5000,0')) { return false; } else { return true; } } else { return false; } } ,testUsingMimeTypes:function(version) { if(!navigator.mimeTypes) { if(deployJava.debug) { alert('Browser claims to be Netscape family, but no mimeTypes[] array?'); } return false; } for(var i=0;ib[0])return true; if(a[0]b[1])return true; if(a[1]b[2])return true; if(a[2]'+'<'+'/'+'object'+'>'); } else if(browser=='Netscape Family'&&deployJava.allowPlugin()) { deployJava.writeEmbedTag(); } } ,refresh:function() { navigator.plugins.refresh(false); var browser=deployJava.getBrowser(); if(browser=='Netscape Family'&&deployJava.allowPlugin()) { var plugin=document.getElementById('deployJavaPlugin'); if(plugin==null) { deployJava.writeEmbedTag(); } } } ,writeEmbedTag:function() { var written=false; if(navigator.mimeTypes!=null) { for(var i=0;i