123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971 |
- 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<VMs.getLength();i++)
- {
- list[i]=VMs.get(i).version;
- }
- }
- else
- {
- var browser=deployJava.getBrowser();
- if(browser=='MSIE')
- {
- if(deployJava.testUsingActiveX('1.7.0'))
- {
- list[0]='1.7.0';
- }
- else if(deployJava.testUsingActiveX('1.6.0'))
- {
- list[0]='1.6.0';
- }
- else if(deployJava.testUsingActiveX('1.5.0'))
- {
- list[0]='1.5.0';
- }
- else if(deployJava.testUsingActiveX('1.4.2'))
- {
- list[0]='1.4.2';
- }
- else if(deployJava.testForMSVM())
- {
- list[0]='1.1';
- }
- }
- else if(browser=='Netscape Family')
- {
- deployJava.getJPIVersionUsingMimeType();
- if(deployJava.firefoxJavaVersion!=null)
- {
- list[0]=deployJava.firefoxJavaVersion;
- }
- else if(deployJava.testUsingMimeTypes('1.7'))
- {
- list[0]='1.7.0';
- }
- else if(deployJava.testUsingMimeTypes('1.6'))
- {
- list[0]='1.6.0';
- }
- else if(deployJava.testUsingMimeTypes('1.5'))
- {
- list[0]='1.5.0';
- }
- else if(deployJava.testUsingMimeTypes('1.4.2'))
- {
- list[0]='1.4.2';
- }
- else if(deployJava.browserName2=='Safari')
- {
- if(deployJava.testUsingPluginsArray('1.7.0'))
- {
- list[0]='1.7.0';
- }
- else if(deployJava.testUsingPluginsArray('1.6'))
- {
- list[0]='1.6.0';
- }
- else if(deployJava.testUsingPluginsArray('1.5'))
- {
- list[0]='1.5.0';
- }
- else if(deployJava.testUsingPluginsArray('1.4.2'))
- {
- list[0]='1.4.2';
- }
- }
- }
- }
- if(deployJava.debug)
- {
- for(var i=0;i<list.length;++i)
- {
- alert('We claim to have detected Java SE '+list[i]);
- }
- }
- return list;
- }
- ,installJRE:function(requestVersion)
- {
- var ret=false;
- if(deployJava.isPluginInstalled())
- {
- if(deployJava.getPlugin().installJRE(requestVersion))
- {
- 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 browser=deployJava.getBrowser();
- var platform=navigator.platform.toLowerCase();
- if((deployJava.EAInstallEnabled=='true')&&(platform.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(browser=='MSIE')
- {
- return deployJava.IEInstall();
- }
- else if((browser=='Netscape Family')&&(platform.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(attributes,parameters,minimumVersion)
- {
- if(minimumVersion=='undefined'||minimumVersion==null)
- {
- minimumVersion='1.1';
- }
- var regex="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$";
- var matchData=minimumVersion.match(regex);
- if(deployJava.returnPage==null)
- {
- deployJava.returnPage=document.location;
- }
- if(matchData!=null)
- {
- var browser=deployJava.getBrowser();
- if((browser!='?')&&('Safari'!=deployJava.browserName2))
- {
- if(deployJava.versionCheck(minimumVersion+'+'))
- {
- deployJava.writeAppletTag(attributes,parameters);
- }
- else if(deployJava.installJRE(minimumVersion+'+'))
- {
- deployJava.refresh();
- location.href=document.location;
- deployJava.writeAppletTag(attributes,parameters);
- }
- else
- {
- deployJava.writeAppletTag(attributes,parameters);
- }
- }
- }
- else
- {
- if(deployJava.debug)
- {
- alert('Invalid minimumVersion argument to runApplet():'+
- minimumVersion);
- }
- }
- }
- ,writeAppletTag:function(attributes,parameters)
- {
- var s='<'+'applet ';
- var codeAttribute=false;
- for(var attribute in attributes)
- {
- s+=(' '+attribute+'="'+attributes[attribute]+'"');
- if(attribute=='code')
- {
- codeAttribute=true;
- }
- }
- if(!codeAttribute)
- {
- s+=(' code="dummy"');
- }
- s+='>';
- document.write(s);
- if(parameters!='undefined'&¶meters!=null)
- {
- var codebaseParam=false;
- for(var parameter in parameters)
- {
- if(parameter=='codebase_lookup')
- {
- codebaseParam=true;
- }
- s='<param name="'+parameter+'" value="'+
- parameters[parameter]+'">';
- document.write(s);
- }
- if(!codebaseParam)
- {
- document.write('<param name="codebase_lookup" value="false">');
- }
- }
- 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<matchData.length;++i)
- {
- if((typeof matchData[i]=='string')&&(matchData[i]!=''))
- {
- patternArray[index]=matchData[i];
- index++;
- }
- }
- if(patternArray[patternArray.length-1]=='+')
- {
- familyMatch=false;
- patternArray.length--;
- }
- else
- {
- if(patternArray[patternArray.length-1]=='*')
- {
- patternArray.length--;
- }
- }
- var list=deployJava.getJREs();
- for(var i=0;i<list.length;++i)
- {
- if(deployJava.compareVersionToPattern(list[i],patternArray,familyMatch))
- {
- return true;
- }
- }
- return false;
- }
- else
- {
- alert('Invalid versionPattern passed to versionCheck: '+
- versionPattern);
- return false;
- }
- }
- ,isWebStartInstalled:function(minimumVersion)
- {
- var browser=deployJava.getBrowser();
- if((browser=='?')||('Safari'==deployJava.browserName2))
- {
- return true;
- }
- if(minimumVersion=='undefined'||minimumVersion==null)
- {
- minimumVersion='1.4.2';
- }
- var retval=false;
- var regex="^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$";
- var matchData=minimumVersion.match(regex);
- if(matchData!=null)
- {
- retval=deployJava.versionCheck(minimumVersion+'+');
- }
- else
- {
- if(deployJava.debug)
- {
- alert('Invalid minimumVersion argument to isWebStartInstalled(): '+minimumVersion);
- }
- retval=deployJava.versionCheck('1.4.2+');
- }
- return retval;
- }
- ,getJPIVersionUsingMimeType:function()
- {
- for(var i=0;i<navigator.mimeTypes.length;++i)
- {
- var s=navigator.mimeTypes[i].type;
- var m=s.match(/^application\/x-java-applet;jpi-version=(.*)$/);
- if(m!=null)
- {
- deployJava.firefoxJavaVersion=m[1];
- break;
- }
- }
- }
- ,launchWebStartApplication:function(jnlp)
- {
- var uaString=navigator.userAgent.toLowerCase();
- deployJava.getJPIVersionUsingMimeType();
- if(uaString.indexOf("windows",0)!=-1)
- {
- if(deployJava.isWebStartInstalled('1.6.0_18')==false)
- {
- if(deployJava.isPluginInstalled())
- {
- if(deployJava.installLatestJRE()==false)
- {
- alert("Java install failed: cannot use launchWebStartApplication function");
- return;
- }
- }
- else
- {
- alert("Please visit java.com to install Java and try again after");
- return;
- }
- }
- }
- else
- {
- if(deployJava.firefoxJavaVersion==null)
- {
- alert("Please visit java.com to install Java and try again after");
- return;
- }
- if(deployJava.firefoxJavaVersion<"1.6.0_18")
- {
- alert("Please visit java.com to install Java and try again after");
- return;
- }
- }
- var jnlpDocbase=null;
- if(document.documentURI)
- {
- jnlpDocbase=document.documentURI;
- }
- if(jnlpDocbase==null)
- {
- jnlpDocbase=document.URL;
- }
- var browser=deployJava.getBrowser();
- if(browser=='MSIE')
- {
- document.write('<'+'object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" '+'width="0" height="0">'+'<'+'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;i<matchData.length;++i)
- {
- if((typeof matchData[i]=='string')&&(matchData[i]!=''))
- {
- result[index]=matchData[i];
- index++;
- }
- }
- var l=Math.min(result.length,patternArray.length);
- if(familyMatch)
- {
- for(var i=0;i<l;++i)
- {
- if(result[i]!=patternArray[i])return false;
- }
- return true;
- }
- else
- {
- // for(var i=0;i<l;++i)
- // {
- // if(result[i]<patternArray[i])
- // {
- // return false;
- // }
- // else if(result[i]>patternArray[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;i<navigator.mimeTypes.length;++i)
- {
- s=navigator.mimeTypes[i].type;
- var m=s.match(/^application\/x-java-applet\x3Bversion=(1\.8|1\.7|1\.6|1\.5|1\.4\.2)$/);
- if(m!=null)
- {
- if(deployJava.compareVersions(m[1],version))
- {
- return true;
- }
- }
- }
- return false;
- }
- ,testUsingPluginsArray:function(version)
- {
- if((!navigator.plugins)||(!navigator.plugins.length))
- {
- return false;
- }
- var platform=navigator.platform.toLowerCase();
- for(var i=0;i<navigator.plugins.length;++i)
- {
- s=navigator.plugins[i].description;
- if(s.search(/^Java Switchable Plug-in (Cocoa)/)!=-1)
- {
- if(deployJava.compareVersions("1.5.0",version))
- {
- return true;
- }
- }
- else if(s.search(/^Java/)!=-1)
- {
- if(platform.indexOf('win')!=-1)
- {
- if(deployJava.compareVersions("1.5.0",version)||deployJava.compareVersions("1.6.0",version))
- {
- return true;
- }
- }
- }
- }
- if(deployJava.compareVersions("1.5.0",version))
- {
- 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(name,result)
- {
- }
- ,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(installed,required)
- {
- var a=installed.split('.');
- var b=required.split('.');
- for(var i=0;i<a.length;++i)
- {
- a[i]=Number(a[i]);
- }
- for(var i=0;i<b.length;++i)
- {
- b[i]=Number(b[i]);
- }
- if(a.length==2)
- {
- a[2]=0;
- }
- if(a[0]>b[0])return true;
- if(a[0]<b[0])return false;
- if(a[1]>b[1])return true;
- if(a[1]<b[1])return false;
- if(a[2]>b[2])return true;
- if(a[2]<b[2])return false;
- return true;
- }
- ,enableAlerts:function()
- {
- deployJava.browserName=null;
- deployJava.debug=true;
- }
- ,poll:function()
- {
- deployJava.refresh();
- var postInstallJREList=deployJava.getJREs();
- if((deployJava.preInstallJREList.length==0)&&(postInstallJREList.length!=0))
- {
- clearInterval(deployJava.myInterval);
- if(deployJava.returnPage!=null)
- {
- location.href=deployJava.returnPage;
- };
- }
- if((deployJava.preInstallJREList.length!=0)&&(postInstallJREList.length!=0)&&(deployJava.preInstallJREList[0]!=postInstallJREList[0]))
- {
- clearInterval(deployJava.myInterval);
- if(deployJava.returnPage!=null)
- {
- location.href=deployJava.returnPage;
- }
- }
- }
- ,writePluginTag:function()
- {
- var browser=deployJava.getBrowser();
- if(browser=='MSIE')
- {
- document.write('<'+'object classid="clsid:CAFEEFAC-DEC7-0000-0000-ABCDEFFEDCBA" '+'id="deployJavaPlugin" width="0" height="0">'+'<'+'/'+'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<navigator.mimeTypes.length;i++)
- {
- if(navigator.mimeTypes[i].type==deployJava.mimeType)
- {
- if(navigator.mimeTypes[i].enabledPlugin)
- {
- document.write('<'+'embed id="deployJavaPlugin" type="'+
- deployJava.mimeType+'" hidden="true" />');
- written=true;
- }
- }
- }
- if(!written)for(var i=0;
- i<navigator.mimeTypes.length;
- i++)
- {
- if(navigator.mimeTypes[i].type==deployJava.oldMimeType)
- {
- if(navigator.mimeTypes[i].enabledPlugin)
- {
- document.write('<'+'embed id="deployJavaPlugin" type="'+
- deployJava.oldMimeType+'" hidden="true" />');
- }
- }
- }
- }
- }
- ,do_initialize:function()
- {
- deployJava.writePluginTag();
- if(deployJava.locale==null)
- {
- var loc=null;
- if(loc==null)try
- {
- loc=navigator.userLanguage;
- }
- catch(err)
- {
- }
- if(loc==null)try
- {
- loc=navigator.systemLanguage;
- }
- catch(err)
- {
- }
- if(loc==null)try
- {
- loc=navigator.language;
- }
- catch(err)
- {
- }
- if(loc!=null)
- {
- loc.replace("-","_");
- deployJava.locale=loc;
- }
- }
- }
- };
- 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);
- }
- }
- var browser = deployJava.browserName2;
- if(browser == "MSIE"){
- }else{
- deployJava.do_initialize();
- }
|