// CHECK BROWSER
		var Browser = BrowserDetect.browser;
		var BrowserVersion = BrowserDetect.version;
		switch (Browser) {
		    case "Firefox":
				systemOK.push("1");
				browserCheck="1";
				break;
			case "Explorer":
        		if (BrowserVersion>=4) { // INTERNET EXPLORER = OKAY
            			    browserCheck="1";
                            systemOK.push("1");
        		} else { // NOT OKAY
            			    browserCheck="0";
							systemOK.push("0");
							 error = 1;
        		}
        		break;
			case "Safari":
				systemOK.push("0"); 
				browserCheck="0";
				error = 1;
				break;
			case "Opera":
				systemOK.push("0"); 
				browserCheck="0";
				error = 1;
				break;
			case "Chrome":
				systemOK.push("0"); 
				browserCheck="0";
				error = 1;
				break;
			default:
                systemOK.push("0");
				browserCheck="0";
				error = 1; 
			break;
		}

	//CHECK JAVA
	var JavaVersion = PluginDetect.getVersion("Java");
	var java_msg = "<img src='http://help.ekpsupport.com/scripts/images/go.jpg' alt='OK' border=0 hspace=5 align=left> ";
	var nojava_msg = "<img src='http://help.ekpsupport.com/scripts/images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left> ";
    if(JavaVersion) {
        var daVersion = JavaVersion.replace(/,/g,".");
        var testVersion = daVersion.split(".");

        if(testVersion[1]<5) {
    		nojava_msg = nojava_msg + 'You have an older version of Java installed; you will need to update the software.<br><br>';
    		nojava_msg = nojava_msg + 'Sun Microsystems has a site that allows you to download and install the latest version of Java. Click the button below and follow the instructions on the Java.com website.<br><br>';
    		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="http://help.ekpsupport.com/scripts/images/getjava.jpg" width="113" height="66" border=0 alt="Get Java"></a></div><br>';
            javaCheck = 0;
        } else {
            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(JavaVersion >= 0 && navigator.javaEnabled()) {
                    javaCheck = 1;
                    java_msg = java_msg + "Java version " + daVersion + " is installed & enabled correctly. The system should function normally.";
                } else {
                    javaCheck = 0;
                    nojava_msg = nojava_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(JavaVersion >= 0) {
                    javaCheck = 1;
                    java_msg = java_msg + "Java version " + daVersion + " is installed & enabled correctly. The system should function normally.";
                } else {
                    javaCheck = 0;
					if (Browser=="Firefox") {
                    	nojava_msg = nojava_msg + "Java version " + daVersion + " is disabled in your browser settings, please enable Java in your Tools -> Options -> Content tab.";  // Works in FF
					} else {
                    	nojava_msg = nojava_msg + "Java version " + daVersion + " is installed but not enabled, please enable Java in your browser's configuration settings.";
					}
                }
            };

            // Try to detect if Sun Java 1.6.0.16 or higher is installed
            minVersion = '1,5'
            var 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;
					nojava_msg = nojava_msg + "Java version " + daVersion + " is disabled in your browser settings, please enable Java in your Tools -> Internet Options -> Security settings.";  // Works in IE
                } else {
                    javaCheck = 1;
                    java_msg = java_msg + "Java version " + daVersion + " is installed & enabled correctly. The system should function normally.";
				}
            } 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;
                nojava_msg = nojava_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;
                nojava_msg = nojava_msg + "Please enable ActiveX in Internet Explorer so that we can detect your plugins."; // Need to enable Active X
            }
        }
    } else {
    javaCheck=0;
    nojava_msg = "<img src='http://help.ekpsupport.com/scripts/images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>";
    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>';
    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="http://help.ekpsupport.com/scripts/images/getjava.jpg" width="113" height="67" border=0 alt="Get Java"></a></div><br>';
    }

    // Need a test here if there is no Java -> Makes it blank
	    if(javaCheck>0) {
    	    systemOK.push("1");
	    } else {
    		systemOK.push("0");
			error = 2; 
    	}

	// CHECK FOR FLASH
	var flash_msg = "<img src='http://help.ekpsupport.com/scripts/images/go.jpg' alt='OK' border=0 hspace=5 align=left> ";
	var noflash_msg = "<img src='http://help.ekpsupport.com/scripts/images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>";

	var flashVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

	// Check to see if the version meets the requirements for playback
	if (flashVersion) {
	// if we've detected an acceptable version
			systemOK.push("1");
			flash_msg = flash_msg + "You have Flash version " + flashVersion + " installed. The system should function normally.";
	} else {  // flash is too old or we can't detect the plugin
					systemOK.push("0");
			noflash_msg = noflash_msg + "Either you don't have Flash Player installed or you have an older version.  You need to download the newest Flash Player from Adobe.";
			noflash_msg = noflash_msg + "Flash is not required to operate EKP itself, but it is required for many of the modules to be loaded and tracked.";
			noflash_msg = noflash_msg + "Many computers do not come with Flash pre-installed, so you may need to install Flash.<br><br>";
			noflash_msg = noflash_msg + "Even if you have Flash, it is possible the modules may not function properly with an older version.  A newer version may be obtained directly from Adobe.";
			noflash_msg = noflash_msg + "<br><br><div style='color:#990000; font-weight:bold'>NOTE: Adobe may provides other software when you download Flash.  ";
			noflash_msg = noflash_msg + "Please make sure you de-select the options on the Adobe website to download other software with Adobe Flash.</div><br>";
			noflash_msg = noflash_msg + "<br><div align=center><a href='http://www.adobe.com/products/flashplayer/' target='_blank' style='font-weight:bold'>";
			noflash_msg = noflash_msg + "<img src='http://help.ekpsupport.com/scripts/images/get_flash_player.gif' border=0 alt='Get Flash Player'></a></div><br></div>";
	}

function winTest() {
    var theWindow;
	var popup_msg = "";
    theWindow = window.open("http://help.ekpsupport.com/scripts/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) {
        document.write("<img src='http://help.ekpsupport.com/scripts/images/go.jpg' alt='OK!' border=0 hspace=5 align=left>");
		document.write("All pop-up blockers are turned off. This should allow the system to function normally.");
    } else {
			document.write("<img src='http://help.ekpsupport.com/scripts/images/stop.jpg' alt='Alert!' border=0 hspace=5 align=left>");
			document.write("You have a pop-up blocker turned on, which could be your browser or it could be other software. ");
			document.write("Some toolbars, instant messengers, anti-malware, and other software includes pop-up blockers.<br><br>");
            switch (Browser){
                case "Explorer":
					document.write('<p><strong>Internet Explorer Blocker</strong></p><ol><li>Open the <b>Tools</b> menu</li><li>Select <b>Pop-up Blocker</b></li><li>Click <b>Turn Off Pop-up Blocker</b></li><img src="http://help.ekpsupport.com/scripts/images/explorer.jpg" alt="Explorer Tools menu" border=0></ol><br>');
                    break;
                case "Firefox":
					document.write('<p><strong>Netscape/Mozilla (Firefox) Blocker</strong></p><ol><li>Open the <b><u>T</u>ools</b> menu</li><img src="http://help.ekpsupport.com/scripts/images/firefox1.jpg" alt="Firefox Tools menu" border=0><li>Select <b><u>O</u>ptions</b></li><li>Click on the <b>Content</b> menu</li><li>Uncheck <b><u>B</u>lock pop-up windows</b></li><img src="http://help.ekpsupport.com/scripts/images/firefox2.jpg" alt="Firefox Options" border=0></ol><br>');
                    break;
                case "Safari":
					document.write('<p><strong>Safari Blocker<br></strong><ol><li>Open the <b>Edit</b> menu</li><li>Click to Uncheck <b>Block Pop-Up Windows</b></li><img src="http://help.ekpsupport.com/scripts/images/safari.jpg" alt="Safari Edit menu" border=0></ol><br>');
                    break;
                case "Opera":
					document.write('<p><strong>Opera Blocker</strong></p><ol><li>Open the <b>Tools</b> menu</li><li>Select <b>Quick preferences</b></li><li>Click <b>Open all pop-ups</b></li><img src="http://help.ekpsupport.com/scripts/images/opera.jpg" alt="Opera Tools menu" border=0></ol><br>');
                    break;
                default : // 'Unknown'
					document.write('<p><strong>Other Browser</strong></p>');
					document.write('Unfortunately, the system can not tell what browser you are using.  We recommend Internet Explorer. The browser you are using does not meet EKP minimum requirements.<br><br>');
					document.write('While other web browsers, such as Firefox and Opera can also be used, Internet Explorer works best. Although the current version is Internet Explorer 8, Internet Explorer 6 or 7 will work with EKP and most modules.<br><br>');
					document.write('You can download the latest version of Internet Explorer from Microsoft.<br>');
					document.write('<div align=center><a href="http://www.microsoft.com/windows/products/winfamily/ie/default.mspx/" target="_blank" style="font-weight:bold"><img src="http://help.ekpsupport.com/scripts/images/Internet_Explorer-logo.jpg" width=50 height=50 border=0 alt="Get I.E."></a></div>');
                    break;
			}
			document.write('<hr><h3>Here are some other things you can try:</h3><br>');
			document.write('Once you have turned off your pop-up blockers, <a href="#" onClick="reTest();">click here to test again</a>.<br><br>');
			document.write('<b>PLEASE NOTE: These are instructions for <em>some of the more common</em> pop-up blockers that may be on your computer.  You may have software other not listed here that includes a pop-up blocker.</b>');
			document.write('<br><br>Programs such as AOL Instant Messenger and My Web Search come with pop-up blockers. You should turn these off while using the Learning Management System.</b><br><hr>');
			document.write('<p><strong>Norton Internet Security</strong><img height="26" alt="Norton Internet Security Image" src="http://help.ekpsupport.com/scripts/images/nortonInternetSecurity.gif" width="27" align="absMiddle"></p>');
			document.write('<ol><li>In your System Tray, double click on the Norton Icon (as pictured above) in the System Tray</li><li>Click Ad Blocking </li><li>Click Turn Off </li></ol>');
			document.write('<hr><p><strong>Google Toolbar:</strong><img height="28" alt="Google Toolbar Image" src="http://help.ekpsupport.com/scripts/images/googleToolbar.gif" width="70" align="absMiddle"></p>');
			document.write('The pop-up blocker in the Toolbar Options menu prevents new windows from automatically opening when you visit a website. Often times,');
			document.write('these new windows display advertising that can interfere with your ability to see the content on the page you are trying to read. ');
			document.write('When the pop-up blocker intercepts an incoming ad, your cursor changes briefly to look like this: <img src="http://help.ekpsupport.com/scripts/images/google_popup_cursor.gif" border=0 alt="Popup Blocker Cursor">.');
			document.write('The pop-up blocker button displays this icon: <img src="http://help.ekpsupport.com/scripts/images/google_pbtool01.gif" alt="Popup Blocker" border=0> along with a count of the number of pop-ups blocked');
			document.write('since the last Toolbar installation.<br><br>');
			document.write('To disable the pop-up blocker:<ol><li>On your Toolbar, click on the Google Icon (as pictured above) and select Options </li><li>In the Accessories Section uncheck Popup Blocker </li></ol>');
			document.write('<hr><p><strong>Yahoo Toolbar:</strong><img height="29" alt="Yahoo Toolbar Image" src="http://help.ekpsupport.com/scripts/images/yahooToolbar.gif" width="43" align="absMiddle"></p>');
			document.write('Yahoo! Pop-Up Blocker is only available for Yahoo! Toolbar 5.6 or newer for Internet Explorer. Pop-Up Blocker is enabled by default,');
			document.write('however you can turn Pop-Up Blocker on and off using the Pop-Up Blocker menu <img src="http://help.ekpsupport.com/scripts/images/yahoo_pub2_s1.gif" alt="Pop-Up Blocker Icon" border=0>.<br><br>');
			document.write('To turn Pop-Up Blocker on or off:<ol><li>On your Toolbar, click on the Pop Up Icon (as pictured above) </li><li>Uncheck Enable Pop-Up Blocker</li>');
			document.write('<li>If the button does not appear in the Yahoo bar, click on the pencil icon. Also, from the tools menu in IE, uncheck Yahoo Companion. ');
			document.write('It is also possible that the user downloaded the companion toolbar but chose not to download the block. </li></ol>');
			document.write('<hr><p><strong>AOL Toolbar:</strong><img height="37" alt="Aol Toolbar Image" src="http://help.ekpsupport.com/scripts/images/aolToolbar.gif" width="150" align="absMiddle"></p><ol>');
			document.write('<li>On your Toolbar, click the drop down arrow (as pictured above).</li><li>Settings - to remove, uncheck the pop-up blocker </li>');
			document.write('<li>To enable/disable temporarily - click on the Allowed / Blocked box </li></ol>');
    }
}




