// AJAX SCRIPTS
// JavaScript Document
function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();

function ajax(url, action) {
// 	alert("Ajax = "+url+"?"+action);
	http.open('get', ''+url+'?'+action, true);
    http.onreadystatechange = handleResponse;
    http.send(null);
}

function handleResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
        var update = new Array();

        if(response.indexOf('~|~' != -1)) {
            update = response.split('~|~');
//			alert (update[0]+" ~|~ "+update[1]);
            document.getElementById(update[0]).innerHTML = update[1];
        }
    }
}
   
function replaceChars(entry) {
out = " "; // replace this
add = "%20"; // with this
temp = "" + entry; // temporary holder

	while (temp.indexOf(out)>-1) {
	pos= temp.indexOf(out);
	temp = "" + (temp.substring(0, pos) + add + 
	temp.substring((pos + out.length), temp.length));
	}
return temp;
}
// END AJAX SCRIPTS

// GET THE BROWSER
var appName = navigator.appName;
var browserName = "";
var browserType = 99;
switch (appName) {
    case "Netscape":
        var bversion_arr=navigator.appVersion.split(".");
        var bversion=bversion_arr[0];
        if (bversion>=5) { // OKAY
            browserCheck=1;
            var b = navigator.userAgent.length;
            for (i=0; i<(b-7); i++) {
                var c = navigator.userAgent.substring(i,i+7);
                if (c=="Firefox") {browserName = "Firefox"; browserType = 2;}
                if (c==" Safari") {browserName = "Safari";  browserType = 3;}
            }
        } else { // NOT OKAY
            browserCheck=0;
        } 
        break;
    case "Microsoft Internet Explorer":
        var bversion_arr=navigator.appVersion.split(".");
        var bversion=bversion_arr[0];
        if (bversion>=7) { // OKAY
            browserCheck=1;
            browserName = "Internet Explorer";
            browserType = 1;
        } else { // NOT OKAY
            browserCheck=0;
        } 
        break;
    case "Opera":
        var bversion_arr=navigator.appVersion.split(".");
        var bversion=bversion_arr[0];
        if (bversion>=8) { // OKAY
            browserCheck=1;
            browserName = "Opera";
            browserType = 4;
        } else { // NOT OKAY
            browserCheck=0;
        } 
        break;
    default:
        browserCheck=0;
        browserName = "Unknown";
        browserType = 5;
        break;

}
// RELOAD
function reloader(theX) {
    var addX = theX;
    var herenow = unescape(window.document.location);

    if (herenow.indexOf("#") > -1) {
    //whether the location contains a "#" or not
        var list1 = herenow.split("#");
        var disPage = list1[0] + "?x=" + addX;
    } else {
        var disPage = unescape(window.document.location) + "?x=" + addX;
    }
    location.href=disPage;
}


// CHECK THE POP-UP BLOCKER
function winTest() {
    var URL = unescape(window.document.location);

    if (URL.indexOf("?") > -1) {
    //whether the location contains a "?" or not
        var list1 = URL.split("?");
        //split at "?";
        var list2 = list1[1].split ("=");
        //split at "=";
        var x = list2[1];
        var daPage = list1[0];
    } else {
        var daPage = unescape(window.document.location);
    }

    var theWindow;
    theWindow = window.open("files/popup.htm","t","height=1,width=1,top=1,left=1");
    if(theWindow){
	    var winCheck = 1; // Pop-up blockers are turned off.
    } else { // OOPS!! TURN IT OFF!!   
	    var winCheck = 0; // Pop-up blockers are turned on!!
    }
    if (winCheck>0) {
        if(browserName=="Opera") {
            if (x == 9) {
                document.write("<img src='images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>");
                document.write("You followed the instructions for Opera, but you may still have a pop-up blocker turned on.<br><br>");
                document.write("In addition to browsers, some software (toolbars, instant messengers, etc) come with pop-up blockers.<br><br>");
                document.write("<a href='#' onClick=\"ajax('files/popup_no.htm','')\">Click here for help with some of them</a>.");
            } else {
                document.write("All pop-up blockers are turned off. This should allow the system to function normally.");
                document.write("<br><br>NOTE: Opera sometimes returns a false reading. ");
                document.write("<a href='#' onClick=\"ajax('files/popup_op.htm','')\">Click here for instructions for making Opera's pop-up blocker is turned off</a>.");
            }
        } else {
                document.write("All pop-up blockers are turned off. This should allow the system to function normally.");
        }
    } else {
        if (x == 9) {
            document.write("<img src='images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>");
            document.write("You followed the instructions for your browser, but you still have a pop-up blocker turned on.<br><br>");
            document.write("In addition to browsers, some software (toolbars, instant messengers, etc) come with pop-up blockers.<br><br>");
            document.write("<a href='#' onClick=\"ajax('files/popup_no.htm','')\">Click here for help with some of them</a>.");
        } else {
            switch (browserName){
                case "Internet Explorer":
                    document.write("<img src='images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>");
                    document.write("You have a pop-up blocker turned on. <a href='#' onClick=\"ajax('files/popup_ie.htm','')\">Click here for instructions for turning it off</a>.");
                    break;
                case "Firefox":
                    document.write("<img src='images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>");
                    document.write("You have a pop-up blocker turned on. <a href='#' onClick=\"ajax('files/popup_ff.htm','')\">Click here for instructions for turning it off</a>.");
                    break;
                case "Safari":
                    document.write("<img src='images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>");
                    document.write("You have a pop-up blocker turned on. <a href='#' onClick=\"ajax('files/popup_sa.htm','')\">Click here for instructions for turning it off</a>.");
                    break;
                case "Opera":
                    document.write("<img src='images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>");
                    document.write("You have a pop-up blocker turned on. <a href='#' onClick=\"ajax('files/popup_op.htm','')\">Click here for instructions for turning it off</a>.");
                    break;
                default : // 'Unknown'
                    document.write("<img src='images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>");
                    document.write("You have a pop-up blocker turned on. <a href='#' onClick=\"ajax('files/popup_ot.htm','')\">Click here for instructions for turning it off</a>.");
                    break;
            }
        }
    }
}


// CHECK FOR JAVA
/* PluginDetect v0.1.9 by Eric Gerds */ var PluginDetect={minIEver:5.5,getNum:function(A){if(!A){return null}var m=/[\d][\d\.\_,-]*/.exec(A);return m?m[0].replace(/[\.\_-]/g,","):null},hasMimeType:function(_3){var s,t,z,M=_3.constructor==String?[_3]:_3;for(z=0;z<M.length;z++){s=navigator.mimeTypes[M[z]];if(s&&s.enabledPlugin){t=s.enabledPlugin;if(t.name||t.description){return s}}}return null},findNavPlugin:function(N,_6){var _7=N.constructor==String?N:N.join(".*"),numS=_6===false?"":"\\d";var i,re=new RegExp(_7+".*"+numS+"|"+numS+".*"+_7,"i");var _9=navigator.plugins;for(i=0;i<_9.length;i++){if(re.test(_9[i].description)||re.test(_9[i].name)){return _9[i]}}return null},getAXO:function(_a){var _b,e;try{_b=new ActiveXObject(_a);return _b}catch(e){}return null},num:function(A){return (typeof A!="string"?false:(/\d/).test(A))},compareNums:function(_d,_e){if(!this.num(_d)||!this.num(_e)){return 0}var m1=_d.split(","),m2=_e.split(","),x,p=parseInt;for(x=0;x<Math.min(m1.length,m2.length);x++){if(p(m1[x],10)>p(m2[x],10)){return 1}if(p(m1[x],10)<p(m2[x],10)){return -1}}return 0},formatNum:function(num){if(!this.num(num)){return null}var n=num.replace(/[\.\_]/g,","),i;n=n.split(",").concat(["0","0","0","0"]);return n.slice(0,4).join(",")},initScript:function(){var $=this,IE;$.isIE=(/*@cc_on!@*/false);$.IEver=-1;if($.isIE){var IE=(/msie\s*\d\.{0,1}\d*/i).exec(navigator.userAgent),progid,x;if(IE){$.IEver=parseFloat((/\d.{0,1}\d*/i).exec(IE[0]),10)}progid=["ShockwaveFlash.ShockwaveFlash","Msxml2.XMLHTTP","Microsoft.XMLDOM","Msxml2.DOMDocument","TDCCtl.TDCCtl","Shell.UIHelper","Scripting.Dictionary"];$.ActiveXEnabled=false;for(x=0;x<progid.length;x++){if($.getAXO(progid[x])){$.ActiveXEnabled=true;break}}};if($.ActiveXEnabled&&$.IEver>=$.minIEver){$.head=typeof document.getElementsByTagName!="undefined"?document.getElementsByTagName("head")[0]:null;var T=document.createElement("script");T.setAttribute("type","text/vbscript");var Y=["<!"+"--","function PluginDetect1(c)","on error resume next","PluginDetect1=false","dim head, r","set head=PluginDetect.head","set r=head.firstChild","if TypeName(r)=\"HTMLObjectElement\" then","r.setAttribute \"classid\", c","if not TypeName(r.getAttribute(\"object\")) = \"Nothing\" then","PluginDetect1=true","if r.getAttribute(\"readyState\")<4 then","r.clearAttributes()","head.removeChild(r)","end if","else r.clearAttributes()","head.removeChild(r)","end if","end if","r=\"Nothing\"","head=\"Nothing\"","end function","--"+">"];T.setAttribute("text",Y.join("\n"));if($.head.firstChild){$.head.insertBefore(T,$.head.firstChild)}else{$.head.appendChild(T)}$.vbscript=false;var e;$.head.insertBefore(document.createElement("object"),$.head.firstChild);try{if(PluginDetect1("")===false){$.vbscript=true}}catch(e){}}},init:function(_17){var $=this,IE,p;_17=_17.toLowerCase().replace(/\s/g,"");p=$.plugin=$[_17];if(!p){return -3}if(typeof p.minversion=="undefined"){p.minversion={}}if(typeof p.version=="undefined"){p.version=null}if(typeof p.installed=="undefined"){p.installed=null}$.garbage=false;if($.isIE&&!$.ActiveXEnabled){return -2}return 1},isMinVersion:function(_19,_1a){var $=PluginDetect,i=$.init(_19);if(i<0){return i}if(!$.num(_1a)){return -3}var p=$.plugin,m=p.minversion;_1a=$.formatNum(_1a);if(typeof m["a"+_1a]=="undefined"){if(p.installed==null&&p.getCodeBaseVersion&&$.IEver>=p.minIEver){var tmp,x;for(x in m){tmp=$.compareNums(_1a,x.substring(1,x.length));if(m[x]==1&&tmp<=0){return 1}if(m[x]==-1&&tmp>=0){return -1}}m["a"+_1a]=$.isActiveXObject(_1a)?1:-1}else{if(p.installed==null){p.getVersion()}if(p.installed==-1){m["a"+_1a]=-1}else{if(p.version==null){m["a"+_1a]=0}else{m["a"+_1a]=($.compareNums(p.version,_1a)>=0?1:-1)}}}}$.cleanup();return m["a"+_1a];return -3},getVersion:function(_1e){var $=PluginDetect,i=$.init(_1e);if(i<0){return null}var p=$.plugin;if(p.installed==null){p.getVersion()}$.cleanup();return p.version;return null},cleanup:function(){var $=this;if($.garbage&&typeof window.CollectGarbage!="undefined"){window.CollectGarbage()}},isActiveXObject:function(_22){var $=this,result,s="<object width=\"1\" height=\"1\" "+"style=\"display:none\" "+$.plugin.getCodeBaseVersion(_22)+">"+$.plugin.HTML+"</object>";$.head.insertBefore(document.createElement("object"),$.head.firstChild);$.head.firstChild.outerHTML=s;result=$.vbscript?PluginDetect1($.plugin.classID):$.detect($.plugin.classID);return result},detect:function(_24){var $=this,result;$.head.firstChild.setAttribute("classid",_24);result=$.head.firstChild.getAttribute("object")?true:false;if(!result||$.head.firstChild.getAttribute("readyState")<4){$.head.firstChild.clearAttributes();$.head.removeChild($.head.firstChild);$.garbage=true}return result},search:function(){var _26=[0,0,0,0];var $=this,x,y,A=$.plugin.digits,t=function(x,y){var _2a=(x==0?y:_26[0])+","+(x==1?y:_26[1])+","+(x==2?y:_26[2])+","+(x==3?y:_26[3]);return $.isActiveXObject(_2a)};var _2b,upper,tmp;var _2c=false;for(x=0;x<A.length;x++){upper=A[x]*2;_26[x]=0;for(y=0;y<20;y++){if(upper==1&&x>0&&_2c){break}if(upper-_26[x]>1){tmp=Math.round((upper+_26[x])/2);if(t(x,tmp)){_26[x]=tmp;_2c=true}else{upper=tmp}}else{if(upper-_26[x]==1){upper--;if(!_2c&&t(x,upper)){_2c=true}break}else{if(!_2c&&t(x,upper)){_2c=true}break}}}if(!_2c){return null}}return _26[0]+","+_26[1]+","+_26[2]+","+_26[3]},dummy1:0};PluginDetect.initScript();PluginDetect.quicktime={mimeType:["video/quicktime","application/x-quicktimeplayer","image/x-macpaint","image/x-quicktime"],progID:"QuickTimeCheckObject.QuickTimeCheck.1",progID0:"QuickTime.QuickTime",classID:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",minIEver:7,HTML:"<param name=\"src\" value=\"A14999.mov\" /><param name=\"controller\" value=\"false\" />",getCodeBaseVersion:function(v){return "codebase=\"#version="+v+"\""},digits:[16,16,16,0],getVersion:function(){var _2e=null,p,$=PluginDetect;if(!$.isIE){p=$.findNavPlugin(["QuickTime","(Plug-in|Plugin)"]);if(p&&p.name&&$.hasMimeType(this.mimeType)){_2e=$.getNum(p.name)}this.installed=_2e?1:-1}else{var obj;if($.IEver<this.minIEver){obj=$.getAXO(this.progID);if(obj&&obj.QuickTimeVersion){_2e=obj.QuickTimeVersion.toString(16);_2e=_2e.charAt(0)+"."+_2e.charAt(1)+"."+_2e.charAt(2)}}else{_2e=$.search()}this.installed=_2e?1:($.getAXO(this.progID0)?0:-1)}this.version=$.formatNum(_2e)}};PluginDetect.java={mimeType:"application/x-java-applet",classID:"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93",JavaVersions:["1.7.0.15","1.6.0.15","1.5.0.14","1.4.2.13","1.3.1.18"],searchJava:function(M){if(!M){return null}var G,e,x3,x4;var AXO=ActiveXObject;var T=M.split("."),J="JavaPlugin."+T[0]+T[1],v=T[0]+"."+T[1]+".";for(x3=T[2];x3>=0;x3--){for(x4=T[3];x4>=0;x4--){G=x4<10?"0"+x4:x4;try{new AXO(J+x3+"_"+G);return v+x3+"_"+G}catch(e){}}if(J+x3=="JavaPlugin.131"){return null}try{new AXO(J+x3);return v+x3}catch(e){}}return null},minIEver:5.5,HTML:"<param name=\"code\" value=\"A14999.class\" />",getCodeBaseVersion:function(v){var r=this.getDigits(v),$=PluginDetect;if($.compareNums(v,"1,4,1,02")<0){v=r[0]+","+r[1]+","+r[2]+","+r[3]}else{if($.compareNums(v,"1,5,0,02")<0){v=r[0]+","+r[1]+","+r[2]+","+r[3]+"0"}else{v=Math.round((parseFloat(r[0]+"."+r[1],10)-1.5)*10+5)+","+r[2]+","+r[3]+"0"+",0"}}return "codebase=\"#version="+v+"\""},digits:[1,9,32,32],getDigits:function(n){/([\d]+)[,_\.]([\d]+)[,_\.]([\d]+)[,_\.]([\d]+)/.test(n);return [RegExp.$1,RegExp.$2,RegExp.$3,RegExp.$4]},hasRun:false,value:null,queryJavaHandler:function(){var $=PluginDetect.java,j=window.java,e;$.hasRun=true;try{if(typeof j.lang!="undefined"&&typeof j.lang.System!="undefined"){$.value=j.lang.System.getProperty("java.version")+" "}}catch(e){}},queryJava:function(){var $=PluginDetect,t=this,nua=navigator.userAgent,e;if(typeof window.java!="undefined"&&window.navigator.javaEnabled()){if(/gecko/i.test(nua)){if($.hasMimeType("application/x-java-vm")){try{var div=document.createElement("div"),evObj=document.createEvent("HTMLEvents");evObj.initEvent("focus",false,true);div.addEventListener("focus",t.queryJavaHandler,false);div.dispatchEvent(evObj)}catch(e){}if(!t.hasRun){t.queryJavaHandler()}}}else{if(/opera.9\.(0|1)/i.test(nua)&&/mac/i.test(nua)){return null}t.queryJavaHandler()}}return t.value},getVersion:function(){var _3a=null,$=PluginDetect;if(!$.isIE){var p1,p,mt;p=$.findNavPlugin(["Java","Plug-in"]);mt=$.hasMimeType(this.mimeType);if(p){p1=$.getNum(p.description)}if(p1&&mt&&navigator.javaEnabled()){_3a=p1}if(!_3a){p=this.queryJava();if(p){_3a=p}}this.installed=-1;if(_3a){this.installed=1}else{if(mt&&navigator.javaEnabled()){if(/macintosh/i.test(navigator.userAgent)&&/safari/i.test(navigator.userAgent)){this.installed=0}}}}else{var x,tmp=null;if($.IEver>=this.minIEver){_3a=$.search();this.installed=_3a?1:-1}else{for(x=0;x<this.JavaVersions.length;x++){tmp=this.searchJava(this.JavaVersions[x]);if(tmp){_3a=tmp;break}}this.installed=_3a?1:($.getAXO("JavaPlugin")?0:-1)}}this.version=$.formatNum($.getNum(_3a))}};PluginDetect.devalvr={mimeType:"application/x-devalvrx",progID:"DevalVRXCtrl.DevalVRXCtrl.1",classID:"clsid:5D2CF9D0-113A-476B-986F-288B54571614",minIEver:5.5,HTML:"<param name=\"src\" value=\"A14999.mov\" />",getCodeBaseVersion:function(v){return "codebase=\"#version="+v+"\""},digits:[2,16,16,16],getVersion:function(){var _3e=null,p,$=PluginDetect,o;if(!$.isIE){p=$.findNavPlugin("DevalVR");if(p&&p.name&&$.hasMimeType(this.mimeType)){_3e=p.description.split(" ")[3]}this.installed=_3e?1:-1}else{o=$.getAXO(this.progID);if($.IEver>=this.minIEver){_3e=$.search()}this.installed=_3e?1:(o?0:-1)}this.version=$.formatNum(_3e)}};PluginDetect.flash={mimeType:["application/x-shockwave-flash","application/futuresplash"],progID:"ShockwaveFlash.ShockwaveFlash",classID:"clsid:D27CDB6E-AE6D-11CF-96B8-444553540000",getVersion:function(){var _3f=function(A){if(!A){return null}var m=/[\d][\d\,\.\s]*[rRdD]{0,1}[\d\,]*/.exec(A);return m?m[0].replace(/[rRdD\.]/g,",").replace(/\s/g,""):null};var p,$=PluginDetect,e,i,version=null,AXO=null,majV=null;if(!$.isIE){p=$.findNavPlugin("Flash");if(p&&p.description&&$.hasMimeType(this.mimeType)){version=_3f(p.description)}}else{for(i=15;i>2;i--){AXO=$.getAXO(this.progID+"."+i);if(AXO){majV=i.toString();break}}if(majV=="6"){try{AXO.AllowScriptAccess="always"}catch(e){return "6,0,21,0"}}try{version=_3f(AXO.GetVariable("$version"))}catch(e){}if(!version&&majV){version=majV}}this.installed=version?1:-1;this.version=$.formatNum(version)}};PluginDetect.shockwave={mimeType:"application/x-director",progID:"SWCtl.SWCtl",classID:"clsid:166B1BCA-3F9C-11CF-8075-444553540000",getVersion:function(){var _43=null,s=null,e,p,$=PluginDetect;if(!$.isIE){p=$.findNavPlugin("Shockwave for Director");if(p&&p.description&&$.hasMimeType(this.mimeType)){_43=$.getNum(p.description)}}else{try{s=$.getAXO(this.progID).ShockwaveVersion("")}catch(e){}if(typeof s=="string"&&s.length>0){_43=$.getNum(s)}else{if($.getAXO(this.progID+".8")){_43="8"}else{if($.getAXO(this.progID+".7")){_43="7"}else{if($.getAXO(this.progID+".1")){_43="6"}}}}}this.installed=_43?1:-1;this.version=$.formatNum(_43)}};PluginDetect.windowsmediaplayer={mimeType:"application/x-mplayer2",progID:"wmplayer.ocx",classID:"clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6",getVersion:function(){var _44=null,$=PluginDetect,tmp;if(!$.isIE){this.installed=($.findNavPlugin(["Windows","Media","Plug-in"],false)||$.hasMimeType(["Flip4Mac","Windows","Media"],false))?0:-1}else{tmp=$.getAXO(this.progID);if(tmp){_44=tmp.versionInfo}this.installed=_44?1:-1}this.version=$.formatNum(_44)}};

function javaTest() {
    var Java  = PluginDetect.isMinVersion('Java', '0');
    var java_msg = "Doh!";
    var nojava_msg = "<img src='images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>";

    var daVersion = PluginDetect.getVersion('Java');
    if(daVersion) {
        var daVersion = daVersion.replace(/,/g,".");
        var testVersion = daVersion.split(".");

        if((testVersion[1]<6) || (testVersion[3]<27)) {
            javaCheck = 0;
	    nojava_msg = nojava_msg + 'It appears that you have and older version of Java installed. Your version is ' + daVersion + ' and you need at least 1.6.0.16.<br><br>';
	    nojava_msg = nojava_msg + 'You can download the latest version from the Sun Microsystems Java website. Click the button below.<br><br>';
        } else {
            java_msg = "";
            if (PluginDetect.isIE){
                // A Java applet can be put into a web page using the <applet> tag.  When you disable Java in the IE browser settings, you disable the <applet> tag - but NOT the <object> tag.
                if(Java >= 0 && navigator.javaEnabled()) {
                    javaCheck = 1;
                    java_msg = java_msg + "Java version " + daVersion + " is installed & enabled correctly. The system should function normally.";
                } else {
                    javaCheck = 0;
                    java_msg = java_msg + "Java version " + daVersion + " is installed but not enabled, please enable Java in your Internet Options -> Security settings.";
                }  // Works or doesn't work in IE
            } else { // For the non-IE browsers, you can also use <object>/<embed>/<applet> tags for your Java applets.
                if(Java >= 0) {
                    javaCheck = 1;
                    java_msg = java_msg + "Java version " + daVersion + " is installed & enabled correctly. The system should function normally.";
                } else {
                    javaCheck = 0;
                    java_msg = java_msg + "Java version " + daVersion + " is installed but not enabled, please enable Java in your Internet Options -> Security settings.";
                }
            };

            // Try to detect if Sun Java 1.3 or higher is installed
            minVersion = '1,3'
            Java = PluginDetect.isMinVersion('Java', minVersion);
            if (Java == 1){
                // For IE, when javaEnabled() is false, then the <applet> tag is disabled. However, you can still use the <object> tag with classid to display Java, assuming that ActiveX is enabled.
                if (PluginDetect.isIE && !navigator.javaEnabled()){
                    javaCheck = 0;
                    java_msg = java_msg + "Java version " + daVersion + " is disabled in your browser settings, please enable Java in your Internet Options -> Security settings.";  // Works in IE
                }
            } else if (Java == 0) {
                // Some browsers (ie Safari 2) do not reveal the Java version in their navigator array,
                // they only show whether Java is installed or not. It is thus the user's responsibility to
                // make sure that their Java is up to date.
                javaCheck = 0;
                java_msg = java_msg + "Java is installed but version is unknown"; // If this happens, need to direct people to the "Do I Have Java?" link
            } else if (Java == -2) {
                // ActiveX is disabled
                javaCheck = 0;
                java_msg = java_msg + "Please enable ActiveX in Internet Explorer so that we can detect your plugins."; // Need to enable Active X
            }
        }
    } else {
    javaCheck=0;
    nojava_msg = nojava_msg + 'It does not appear that you have Java installed.<br><br>';
    nojava_msg = nojava_msg + 'Sun Microsystems has a site that allows you to verify if you have Java installed. Click the button below.<br><br>';
    }

    // Need a test here if there is no Java -> Makes it blank
    if(javaCheck>0) {
        document.write(java_msg);
    } else {
        nojava_msg = nojava_msg + '<div align=center><a href="http://jdl.sun.com/webapps/getjava/BrowserRedirect?locale=en&host=www.java.com" target="_blank" style="font-weight:bold">';
        nojava_msg = nojava_msg + '<img src="images/java-logo.png" border=0 alt="Java" width=125 height=125></a></div><br>';
        document.write(nojava_msg);
    }
}

// CHECK FOR SHOCKWAVE
function shockTest() {
var tMajorVersion = 10;
var tMinorVersion = 1;
var tShockwaveFound = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-director"]&& navigator.mimeTypes["application/x-director"].enabledPlugin) {
  if (navigator.plugins && navigator.plugins["Shockwave for Director"]&& (tVersionIndex = navigator.plugins["Shockwave for Director"].description.indexOf(".")) != - 1) {
    var tMajorVersionString = navigator.plugins["Shockwave for Director"].description.substring(tVersionIndex-2, tVersionIndex);
   var tMinorVersionString = navigator.plugins["Shockwave for Director"].description.substring(tVersionIndex+1, tVersionIndex+2);
   if (parseInt(tMajorVersionString) >= tMajorVersion) {
     if (tMinorVersion > 0) {
       if (parseInt(tMinorVersionString) >= tMinorVersion) {
         tShockwaveFound = 1;
    }
     } else {
       tShockwaveFound = 1;
     }
    }
  }
} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
  var tVersionString = "";
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('set tSWControl = CreateObject("SWCtl.SWCtl") \n');
  document.write('if IsObject(tSWControl) then \n');
  document.write('tVersionString = tSWControl.ShockwaveVersion("") \n');
  document.write('end if');
  document.write('</SCRIPT\> \n');
  if (tVersionString != "") {
    tVersionIndex = tVersionString.indexOf(".")
   var tMajorVersionString = tVersionString.substring(tVersionIndex-2, tVersionIndex);
   var tMinorVersionString = tVersionString.substring(tVersionIndex+1, tVersionIndex+2);
   if (parseInt(tMajorVersionString) >= tMajorVersion) {
     if (tMinorVersion > 0) {
       if (parseInt(tMinorVersionString) >= tMinorVersion) {
         tShockwaveFound = 1;
       }
     } else {
       tShockwaveFound = 1;
     }
   }
  }
}
if ( tShockwaveFound ) {
  var shockmsg = '';
     if(tMajorVersionString>=7) {
        var shockmsg="You have Shockwave version " + tMajorVersionString + " installed. The system should function normally.";
     } else {
        var shockmsg = "";
        shockmsg = shockmsg + "<img src='images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>";
        shockmsg = shockmsg + "You have Shockwave version " + tMajorVersionString + " installed. We recommend you update your Adobe Shockwave Player.";
        shockmsg = shockmsg + "<a href='#' onClick=\"ajax('files/shockinfo.htm','')\">Click here for more details</a>.";
     }
  document.write(shockmsg);
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
  var noshock = '';
  noshock = noshock + "<img src='images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>";
  noshock = noshock + "You don't have Shockwave installed.  You need to download it from Adobe.  <a href='#' onClick=\"ajax('files/shockinfo.htm','')\">Click here for more details</a>.";
  document.write(noshock);
}
}


// CHECK FOR FLASH
var flashinstalled = 0;
var flashversion = 0;
var MSDetect = "false";
if (navigator.plugins && navigator.plugins.length) {
    x = navigator.plugins["Shockwave Flash"];
    if (x) {
        flashinstalled = 2;
        if (x.description) {
            y = x.description;
            if ( (y.charAt(y.indexOf('.')-2)==1) && (y.charAt(y.indexOf('.')-1)==0) ) {
                flashversion = 10; 
               } else {
                flashversion = y.charAt(y.indexOf('.')-1); }
            }
        } else {
        flashinstalled = 1;
        }
    if (navigator.plugins["Shockwave Flash 2.0"]) {
        flashinstalled = 2;
        flashversion = 2;
    }
} else if (navigator.mimeTypes && navigator.mimeTypes.length) {
    x = navigator.mimeTypes['application/x-shockwave-flash'];
    if (x && x.enabledPlugin)
        flashinstalled = 2;
    else
        flashinstalled = 1;
} else {
    MSDetect = "true";
}

