You are on page 1of 2

function AppletLoad(){

var jar1="AppletTest.jar" ;
var aplt = document.getElementById("appletDiv");
var MSIE1 = false;
var browser1 = navigator.userAgent.toLowerCase();
if ((browser1.indexOf('msie') >= 0) &&
(browser1.indexOf('opera') < 0)) MSIE1 = true;
try{
if(MSIE1)
aplt.innerHTML = '<OBJECT classid="clsid:8AD9C840-
044E-11D1-B3E9-00805F499D93" id = "apltid" name = "aplttest" width="1"
height="1">'+
'<param name="code"
value="AppletLoadTest.class"> '+
'<param name="archive"
value="/ireps/pki/' + jar1 + '" /></OBJECT>';
else
aplt.innerHTML ='<embed id="apltid" type="application/x-
java-applet;" width="1" height="1" archive="/ireps/pki/' + jar1 + '"
code="AppletLoadTest.class"/>'+
'</embed>';
this.loadflag = true;
}
catch (e) {
this.loadflag = false;
}
}

function ApltLoadTest(){
if(this.loadflag)
{
try{
var apltId= document.getElementById("apltid")
var jrever = apltId.vercheck();
var no1 = parseFloat(jrever.substring(0,3));
var no2 = parseFloat(jrever.substring(6,8));
var flag = false;
if(no1>1.6)flag = true;
else if(no1==1.6)
{
if(no2>=45)flag=true;
else alert("Installed JRE Version is not
latest.");
}
else flag = false;
if( flag == true)
{
document.getElementById('verlabel').innerHTML =
'Successful (Installed JRE ver is '+jrever+'.)';
document.getElementById('verlabel').style.color =
'green';
}
else
{
document.getElementById('verlabel').innerHTML = 'Failed
(Installed JRE ver is '+jrever+'.)';
document.getElementById('verlabel').style.color = 'red';
}
}
catch (err) {
alert("Failed to open AppletLoader:"+err.message);
document.getElementById('verlabel').innerHTML = 'Failed';
document.getElementById('verlabel').style.color = 'red';
}
}
else{
alert("Failed to load Applet");
document.getElementById('verlabel').innerHTML = 'Failed';
document.getElementById('verlabel').style.color = 'red';

}
}