// -------------------- Start Browser Checking

var detect = navigator.userAgent.toLowerCase();
var OS,browser,total,thestring;
var version = 0;

function checkBrowser () { 

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

dShowBrowser.innerHTML = '<img src="images/bullet_green.gif">We have detected that you are viewing this page with <font color=#ff9966>' + browser + ' ' + version + '</font>.';

}

function checkIt(string){  
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

// -------------------- Start Pop-Up Window
var PopWin;

function testPop(URL) {
	var w = 450, h = 350;
	if (document.all || document.layers) {
	w = screen.availWidth;
	h = screen.availHeight;
	}
	var popW = 450, popH = 350;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	PopWin = window.open(URL,'popup','width=' + popW + ',height=' + popH +',top=' + topPos + ',left=' + leftPos);
}

function testAR(URL) {
	var w = 325, h = 250;
	if (document.all || document.layers) {
	w = screen.availWidth;
	h = screen.availHeight;
	}
	var popW = 325, popH = 250;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	PopWin = window.open(URL,'popup','width=' + popW + ',height=' + popH +',top=' + topPos + ',left=' + leftPos);
}

function CloseChildWindow(){
	if (PopWin){
			PopWin.close();
	}
}

// -------------------- Start JavaScript Check


function checkJava() {

dShowJava.innerHTML = "<img src='images/bullet_green.gif'>We have detected that your browser is <font color=#FF9933>JavaScript Enabled</font>.";

}


// -------------------- Start Check for Flash

function checkFlash() {
	if (flash.installed)
	{
	dShowFlash.innerHTML = "<img src='images/bullet_green.gif'>We have detected that your browser is running <font color=#FF9933> Flash Player " + flash.version + "</font>.  <a href=javascript:testPop('testFlash.htm') class=list>Click here</a> to open a test movie.";
	}
	else
	{
	dShowFlash.innerHTML = "<img src='images/bullet_green.gif'>We have detected that your browser <font color=#FF9933>does not have the Flash Plug-In installed</font>.  <a href=javascript:testPop('testFlash.htm') class=list>Click here</a> to open a test movie.";
	}
}

// -------------------- Start Check OS

function checkOS() {
if ((navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('NT 5.1') != -1)){
	var OpSys = "Windows XP";
} else if ((navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('5.0') != -1)){
	var OpSys = "Windows 2000";
} else if ((navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('98') != -1)){
	var OpSys = "Windows 98";
} else if ((navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('NT') != -1)){
	var OpSys = "Windows NT";
} else if ((navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('95') != -1)){
	var OpSys = "Windows 95";
} else if (navigator.userAgent.indexOf('IRIX') != -1){
	var OpSys = "Irix";
} else if (navigator.userAgent.indexOf('Win') != -1){ 
	var OpSys = "Windows3.1 or NT";
} else if (navigator.userAgent.indexOf('Mac') != -1){
	var OpSys = "Macintosh";
} else { 
	var OpSys = "other";
}
dShowOS.innerHTML = '<img src="images/bullet_green.gif">We have detected that you are running <font color=#FF9933>' + OpSys + '</font>.';
}

// -------------------- Start Verisign
function popUp(url) {
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
	self.name = "mainWin";
}


/*
// Modifications:
// 04/23/07 by JFF -- the following functions were removed from the sysCheck page
//
// -------------------- Start Office Check

  function excelChecker_onnotify(){
	debugger;
    var div = document.getElementById("excelCheck");
    testExcel.innerHTML = "<img src='images/bullet_green.gif'> " + this.message;
  }
  
  function visioChecker_onnotify(){
    var div = document.getElementById("visioCheck");
    testVisio.innerHTML = "<img src='images/bullet_green.gif'> " + this.message;
  }


// -------------------- Start SOAP and Post Tests.

document.onreadystatechange = document_onreadystatechange;
function document_onreadystatechange(){
	if (document.readyState == "complete"){
		doRequirementsCheck();
	}
}

  function postTest_oncontacting(){
    //alert("HTTP POST test: Contacting server");
  }
  
  function postTest_onsuccess(){
    testPost.innerHTML = "<img src='images/bullet_green.gif'> Post Access: Successful";
  }
  
  function postTest_onfailure(){
   testPost.innerHTML = "<img src='images/bullet_green.gif'> Post Access: Failed";
  }
  
  function soapTest_oncontacting(){
    //alert("HTTP SOAP test: Contacting server");
  }
  
  function soapTest_onsuccess(){
    testSoap.innerHTML = "<img src='images/bullet_green.gif'> Soap Access: Successful";
  }
  
  function soapTest_onfailure(){
    testSoap.innerHTML = "<img src='images/bullet_green.gif'> Soap Access: Failed";
  } 
*/
   
