// This file contains JavaScript to determine the browser that is being
// used and to figure out if it is a WeBCT CE or Vista compatible browser 
// This file also contains scripts to check for various plug-ins/activeX controls
// and addons 

//Compatibility variables
  vistaOK=false;
  webctOK=false;
  hlOK=false;
  portalOK=false;
  ugamailOK=false;
  mydriveOK=false;

  winIEflag=false;
  winFlag=false;
  macFlag=false;
  
  browser=""; 
  osName=false;
 
  message="";
  sp2message="";

//Check OS then Browser Type
//Windows
  if (navigator.userAgent.indexOf("Win") > -1) {
    winFlag=true;
    if (navigator.userAgent.indexOf("MSIE 5") > -1) {
      if (navigator.userAgent.indexOf("Opera 5") > -1) {
	  	webctOK=false; vistaOK=false; winIEflag = false; ugamailOK=false; portalOK=false; mydriveOK=false;
        browser="Opera 5.x";
		message="EITS does not support Opera, we recommend that you upgrade to IE 5.5 SP2 or later or Netscape 7.x to be able to use UGA's web-based applications.";
	  } else if (navigator.userAgent.indexOf("Opera 6") > -1) {
	  	webctOK=false; vistaOK=false; winIEflag = false; ugamailOK=false; portalOK=false; mydriveOK=false;
        browser="Opera 6.x";
		message="EITS does not support Opera, we recommend that you upgrade to IE 5.5 SP2 or later or Netscape 7.x to be able to use UGA's web-based applications.";
      } else if (navigator.userAgent.indexOf("MSIE 5.5") > -1) {
        webctOK=true; vistaOK=true; winIEflag = true; ugamailOK=true; portalOK=true; mydriveOK=false;
        browser="Microsoft Internet Explorer 5.5";
	  } else {
        webctOK=true; vistaOK=false; ugamailOK=false; portalOK=false; mydriveOK=false; winIEflag = true;
		message="While your browser is compatible with WebCT CE, we recommend that you upgrade it to IE 5.5 SP2 or later to be able to use UGA's other web-based applications.";
        browser="Microsoft Internet Explorer 5.x";
      }

    } else if (navigator.userAgent.indexOf("MSIE 6") > -1) {
      if (navigator.userAgent.indexOf("Opera 7") > -1) {
        webctOK=false; vistaOK=false; winIEflag = false; ugamailOK=false; portalOK=false; mydriveOK=false;
        browser="Opera 7.x";
		message="EITS does not support Opera, we recommend that you upgrade to IE 5.5 SP2 or later or Netscape 7.x to be able to use UGA's web-based applications.";
      } else {
        webctOK=true; vistaOK=true; winIEflag = true; ugamailOK=true; portalOK=true; mydriveOK=false;
	    browser="Microsoft Internet Explorer 6";
		message="";
      }

	} else if (navigator.userAgent.indexOf("MSIE 7") > -1) {
      if (navigator.userAgent.indexOf("Opera") > -1) {
        webctOK=false; vistaOK=false; winIEflag = false; ugamailOK=false; portalOK=false; mydriveOK=false;
        browser="Opera 7.x";
		message="EITS does not support Opera, we recommend that you upgrade to IE 5.5 SP2 or later or Netscape 7.x to be able to use UGA's web-based applications.";
      } else {
        webctOK=true; vistaOK=true; winIEflag = true; ugamailOK=true; portalOK=true; mydriveOK=false;
	    browser="Microsoft Internet Explorer 7";
		message="";
      }

    } else if (navigator.userAgent.indexOf("Netscape/6.2") > -1) {
      webctOK=true; vistaOK=false; ugamailOK=true; portalOK=false; mydriveOK=false;
	  //message="Your browser will work with the current version of WebCT Vista, but you will have to upgrade to Netscape 7.x to use WebCT Vista 3.0 when it becomes available.";
      browser="Netscape Navigator 6.2.x";

    } else if (navigator.userAgent.indexOf("Netscape6/6.2") > -1) {
      webctOK=true; vistaOK=false; ugamailOK=true; portalOK=false; mydriveOK=false;
	  //message="Your browser will work with the current version of WebCT Vista, but you will have to upgrade to Netscape 7.x to use WebCT Vista 3.0 when it becomes available.";
      browser="Netscape Navigator 6.2.x";

    } else if (navigator.userAgent.indexOf("Netscape/7") > -1) {
      webctOK=true; vistaOK=true; ugamailOK=true; portalOK=true; mydriveOK=false;
      browser="Netscape Navigator 7.x";

    } else if (navigator.userAgent.indexOf("AOL/7") > -1) {
      webctOK=true; vistaOK=false; ugamailOK=true; portalOK=false; mydriveOK=false;
	  message="Even though EITS does not officially support AOL Browser, we have verified that the AOL browser does work with UGAMail webmail and WebCT CE. That said, EITS recommends that you do not use the AOL Browser to access UGA's web-based applications, including the MyUGA Portal and MyDrive.";
      browser="AOL 7";

    } else if (navigator.userAgent.indexOf("Mozilla/4.7") > -1) {
      webctOK=true; vistaOK=false; ugamailOK=false; portalOK=false; mydriveOK=false;
	  message="While Netscape 4.7x is compatible with WebCT CE, we highly recommend that you upgrade to Netscape 7.x.";
      browser="Netscape Navigator 4.7x";

    } else if ((navigator.userAgent.indexOf("Mozilla") > -1) && (navigator.userAgent.indexOf("Gecko") > -1) ) { 
      if (navigator.userAgent.indexOf("rv:1.5") > -1) {
        webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
		message="";
        browser="Mozilla 1.5";
      } else if (navigator.userAgent.indexOf("rv:1.6") > -1) {
        webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
		message="";
        browser="Mozilla 1.6";
      } else if (navigator.userAgent.indexOf("rv:1.7") > -1) {
		if (navigator.userAgent.indexOf("Firefox/1") > -1) {
			webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
			message="";
       		browser="Firefox 1.x";
		} else {
			webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
			message="";
        	browser="Mozilla 1.7";
		}
      } else if (navigator.userAgent.indexOf("rv:1.8") > -1) {
		if (navigator.userAgent.indexOf("Firefox/1.5") > -1) {
			webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
			message="";
       		browser="Firefox 1.5";
		} else {
			webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
			message="";
        	browser="Mozilla 1.8";
		}
	  }
    } else {
		webctOK=false; vistaOK=false; ugamailOK=false; portalOK=false; mydriveOK=false;
		message="EITS does not support your browser, we recommend that you upgrade to IE 5.5 SP2 or later or Netscape 7.x to be able to use UGA's web-based applications.";
        browser="Unsupported Browser";	
	}
 
//Mac OS
  } else if ( (navigator.userAgent.indexOf("PowerPC") > -1) || (navigator.userAgent.indexOf("Macintosh") > -1)) {

    macFlag=true;
    osName="Macintosh OS";

    if ((navigator.userAgent.indexOf("MSIE") == -1) && ((navigator.userAgent.indexOf("Mac OS X") == -1) && (navigator.userAgent.indexOf("68k") > -1) || (navigator.userAgent.indexOf("68K") > -1))) {
      message="Please upgrade to Mac OS X.";
   
    } else if (navigator.userAgent.indexOf("MSIE 5") > -1) {
      webctOK=true; vistaOK=true; ugamailOK=true; portalOK=true; mydriveOK=false;
	  message="We highly recommend that you use a browser other than IE, even though it is compatible with some of our web-based applications, as Microsoft is no longer supporting IE on the Macintosh platform.";
      browser="Microsoft Internet Explorer 5.x";

    } else if (navigator.userAgent.indexOf("Netscape/6.2") > -1) {
      webctOK=true; vistaOK=false; ugamailOK=true; portalOK=false; mydriveOK=false;
	  //message="Your browser will work with the current version of WebCT Vista, but you will have to upgrade to Netscape 7.x to use WebCT Vista 3.0 when it becomes available.";
      browser="Netscape Navigator 6.2.x";

    } else if (navigator.userAgent.indexOf("Netscape/7") > -1) {
      webctOK=true; vistaOK=true; ugamailOK=true; portalOK=true; mydriveOK=false;
      browser="Netscape Navigator 7.x";

    } else if ((navigator.userAgent.indexOf("Mozilla") > -1) && (navigator.userAgent.indexOf("Gecko") > -1) ) { 
      if (navigator.userAgent.indexOf("rv:1.5") > -1) {
        webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
		message="";
        browser="Mozilla 1.5";
      } else if (navigator.userAgent.indexOf("rv:1.6") > -1) {
        webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
		message="";
        browser="Mozilla 1.6";
      } else if (navigator.userAgent.indexOf("rv:1.7") > -1) {
        if (navigator.userAgent.indexOf("Firefox/1") > -1) {
			webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
			message="";
       		browser="Firefox 1.x";
		} else {
			webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
			message="";
        	browser="Mozilla 1.7";
		} 
	  } else if (navigator.userAgent.indexOf("rv:1.8") > -1) {
		if (navigator.userAgent.indexOf("Firefox/1.5") > -1) {
			webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
			message="";
       		browser="Firefox 1.5";
		} else {
			webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
			message="";
        	browser="Mozilla 1.8";
		}
      } else if (navigator.userAgent.indexOf("Safari") > -1) {
        browser="Apple Safari";
        webctOK=false; vistaOK=false; ugamailOK=true; portalOK=false; mydriveOK=false;
		//message="Safari is only certified for use with WebCT Vista 3.0; the current version of WebCT Vista is 2.1.";
      }
    }

//Other OS's (*nix)
  } else {
  
    osName="*nix (Linux/Unix variants)";
	
  	if (navigator.userAgent.indexOf("Netscape/6.2") > -1) {
      webctOK=true; vistaOK=false; ugamailOK=true; portalOK=false; mydriveOK=false;
	  //message="Your browser will work with the current version of WebCT Vista, but you will have to upgrade to Netscape 7.x to use WebCT Vista 3.0 when it becomes available.";
      browser="Netscape Navigator 6.2.x";

    } else if (navigator.userAgent.indexOf("Netscape/7") > -1) {
      webctOK=true; vistaOK=true; ugamailOK=true; portalOK=true; mydriveOK=false;
      browser="Netscape Navigator 7.x";

	} else if (navigator.userAgent.indexOf("Mozilla/4.7") > -1) {
      webctOK=true; vistaOK=false; ugamailOK=false; portalOK=false; mydriveOK=false;
	  message="While Netscape 4.7x is compatible with WebCT CE, we highly recommend that you upgrade to Netscape 7.x.";
      browser="Netscape Navigator 4.7x";

    } else if ((navigator.userAgent.indexOf("Mozilla") > -1) && (navigator.userAgent.indexOf("Gecko") > -1) ) { 
      if (navigator.userAgent.indexOf("rv:1.5") > -1) {
        webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
		message="";
        browser="Mozilla 1.5";
      } else if (navigator.userAgent.indexOf("rv:1.6") > -1) {
        webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
		message="";
        browser="Mozilla 1.6";
      } else if (navigator.userAgent.indexOf("rv:1.7") > -1) {
        if (navigator.userAgent.indexOf("Firefox/1") > -1) {
			webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
			message="";
       		browser="Firefox 1.x";
		} else {
			webctOK=false; vistaOK=true; ugamailOK=true; portalOK=false; mydriveOK=false;
			message="";
        	browser="Mozilla 1.7";
		}
      }
	}
  }



//Detect version of Windows
  if (winFlag) {
    if (navigator.userAgent.indexOf("Windows NT 4.0") > -1) {
      osName="Windows NT 4.0";
    } else if (navigator.userAgent.indexOf("WinNT4") > -1) {
      osName="Windows NT 4.0";
    } else if ((navigator.userAgent.indexOf("Windows 98") > -1) || (navigator.userAgent.indexOf("Win98") > -1)) {
      if (navigator.userAgent.indexOf("Win 9x 4.90") > -1){
	  	osName="Windows ME";
	  } else {
	  	osName="Windows 98"; 
	  }
    } else if (navigator.userAgent.indexOf("Win98") > -1) {
      osName="Windows 98";
    } else if ((navigator.userAgent.indexOf("Windows NT 5.0") > -1) || (navigator.userAgent.indexOf("Windows 2000") > -1)) {
      osName="Windows 2000";
    } else if (navigator.userAgent.indexOf("Windows NT 5.1") > -1) {
      osName="Windows XP";
      if (navigator.userAgent.indexOf("SV1") > -1) {
		osName="Windows XP SP2";
        sp2message="<br />You appear to be running Service Pack 2 and pop-ups are blocked. Please follow <a href='windows/popup_ie6.html'>these instructions</a> for enabling pop-ups for UGA web services.\n";
      }
    } else if (navigator.userAgent.indexOf("Windows NT 6.0") > -1) {
	osName="Windows Vista";
    }
  }

//plug-in detection
function pluginDetect(){ 
  if (!winIEflag) {
    acrobatFlag = false;
    quicktimeFlag = false;
    flashFlag = false;
	realFlag = false;


    for(x=0;x<navigator.plugins.length;x++) {
      name = navigator.plugins[x].name;
      if (name.indexOf("QuickTime") > -1) { quicktimeFlag = true; }
      if (name.indexOf("Acrobat") > -1) { acrobatFlag = true; }
      if (name.indexOf("Flash") > -1) { flashFlag = true; }
	  if (name.indexOf("Real") > -1) { realFlag = true; }
	  
    }
 
 //QuickTime Plug-in Check  
    document.write("<tr><td align=right valign=top class=tdbrdr width=200><strong>QuickTime Plug-in Present:</strong></td><td valign=top class=tdbrdr width=400>");
    if(quicktimeFlag) {
      document.write("<span class=correct>&nbsp;<img src='images/answer_good.gif' alt='Yes'> The QuickTime Plug-in is installed.</span></td></tr>\n");
    } else {
      document.write("<span class=wrong>&nbsp;<img src='images/answer_bad.gif' alt='No'></span>\n");
      document.write("<span class=wrong>You should install a copy of Apple QuickTime to be able to view QuickTime content that might be found in your WebCT courses - <a target=_new href=\"http://www.apple.com/quicktime/\">http://www.apple.com/quicktime</a></span></td></tr>\n");
    }

 //Adobe Acrobat Reader Plug-in Check
    document.write("<tr><td align=right valign=top class=tdbrdr><strong>Acrobat Plug-in Present:</strong></td><td valign=top class=tdbrdr>");
    if(acrobatFlag) {
      document.write("<span class=correct>&nbsp;<img src='images/answer_good.gif' alt='Yes'> The Acrobat Plug-in is installed.</span></td></tr>\n");
    } else {
      document.write("<span class=wrong>&nbsp;<img src='images/answer_bad.gif' alt='No'></span>\n");
      document.write("<span class=wrong>You should install a copy of Adobe Acrobat Reader to be able to view PDF content that might be found in your WebCT courses - <a target=_new href=\"http://www.adobe.com/acrobat/\">http://www.adobe.com/acrobat/</a></span></td></tr>\n");
    }

//Shockwave Flash Plug-in Check
    document.write("<tr><td align=right valign=top class=tdbrdr><strong>Shockwave Flash Plug-in Present:</strong></td><td valign=top class=tdbrdr>");
    if(flashFlag) {
      document.write("<span class=correct>&nbsp;<img src='images/answer_good.gif' alt='Yes'> The Shockwave Flash Plug-in is installed.</span></td></tr>\n");
    } else {
      document.write("<span class=wrong>&nbsp;<img src='images/answer_bad.gif' alt='No'></span>\n");
      document.write("<span class=wrong>You should install a copy of the Shockwave Flash player to be able to view Flash content that might be found in your WebCT courses - <a target=_new href=\"http://www.macromedia.com/flash/\">http://www.macromedia.com/flash/</a></span></td></tr>\n");
    }

//RealPlayer Plug-in Check
    document.write("<tr><td align=right valign=top class=tdbrdr><strong>RealPlayer/RealOne Plug-in Present:</strong></td><td valign=top class=tdbrdr>");
    if(realFlag) {
      document.write("<span class=correct>&nbsp;<img src='images/answer_good.gif' alt='Yes'> The RealPlayer Plug-in is installed.</span></td></tr>\n");
    } else {
      document.write("<span class=wrong>&nbsp;<img src='images/answer_bad.gif' alt='No'></span>\n");
      document.write("<span class=wrong>You should install a copy of the RealPlayer to be able to view Real content that might be found in your WebCT courses - <a target=_new href=\"http://www.real.com\">http://www.real.com</a></span></td></tr>\n");
    }


//Complete Plug-in List for non-IE on Win situations
    document.write("<tr><td align=right valign=top class=tdbrdr><strong>Complete Plug-in List:</strong></td><td valign=top class=tdbrdr> ("+navigator.plugins.length+" total)<br>\n");
  
    for(x=0;x<navigator.plugins.length;x++) {
      document.write((x+1)+". "+navigator.plugins[x].name+"<br>\n");
    }
    document.write("</td></tr>\n");

  } else {

//IE on Windows Plug-in Check
//(Must be done differently due to ActiveX Controls)
 	
	iePluginDetect();

  }
}

//IE on Windows Plug-in Detect
function iePluginDetect(){	
// Here we write out the VBScript block for MSIE Windows
// Note that this will not execute on non-MSIE on Windows browsers
	if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
    	

		document.writeln('<scri' + 'pt language="VBScript">');

    	document.writeln('\'do a one-time test for a version of VBScript that can handle this code');
    	document.writeln('detectableWithVB = False');
    	document.writeln('If ScriptEngineMajorVersion >= 2 then');
    	document.writeln('  detectableWithVB = True');
    	document.writeln('End If');

//generic function for checking if ActiveX controls are installed
    	document.writeln('\'this next function will detect most plugins');
    	document.writeln('Function detectActiveXControl(activeXControlName)');
    	document.writeln('  on error resume next');
    	document.writeln('  detectActiveXControl = False');
    	document.writeln('  If detectableWithVB Then');
    	document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    	document.writeln('  End If');
    	document.writeln('End Function');


//QuickTime Specific check
	    document.writeln('\'and the following function handles QuickTime');
    
		document.writeln('Function detectQuickTimeActiveXControl()');
    	document.writeln('  on error resume next');
    	document.writeln('  detectQuickTimeActiveXControl = False');
    	document.writeln('  If detectableWithVB Then');
    	document.writeln('    detectQuickTimeActiveXControl = False');
    	document.writeln('    hasQuickTimeChecker = false');
    	document.writeln('    Set hasQuickTimeChecker = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1")');
    	document.writeln('    If IsObject(hasQuickTimeChecker) Then');
    	document.writeln('      If hasQuickTimeChecker.IsQuickTimeAvailable(0) Then ');
    	document.writeln('        detectQuickTimeActiveXControl = True');
    	document.writeln('      End If');
    	document.writeln('    End If');
    	document.writeln('  End If');
		document.writeln('	If detectQuickTimeActiveXControl Then');
		document.writeln('    Document.Write "<tr><td align=right valign=top class=tdbrdr width=200><strong>QuickTime Plug-in Present:</strong></td><td valign=top class=tdbrdr width=400><span class=correct>&nbsp;<img src=\'images/answer_good.gif\' alt=\'Yes\'> The QuickTime Plug-in is installed.</span></td></tr>"');
		document.writeln('	Else');
		document.writeln('    Document.Write "<tr><td align=right valign=top class=tdbrdr width=200><strong>QuickTime Plug-in Present:</strong></td><td valign=top class=tdbrdr width=400><span class=wrong>&nbsp;<img src=\'images/answer_bad.gif\' alt=\'No\'></span>"');
		document.writeln('	  Document.Write "<span class=wrong>You should install a copy of Apple QuickTime to be able to view QuickTime content that might be found in your WebCT courses - <a target=_new href=\'http://www.apple.com/quicktime/\'>http://www.apple.com/quicktime</a></span><</td></tr>"');
		document.writeln('  End If');
		document.writeln('End Function');
	
// calling detect function for QT
		document.writeln('detectQuickTimeActiveXControl()');

//Adobe Acrobat Reader Detect		
		document.writeln('  If detectActiveXControl("PDF.PdfCtrl.1") OR detectActiveXControl("PDF.PdfCtrl.5") OR detectActiveXControl("PDF.PdfCtrl.6") Then');
		document.writeln('  	Document.Write "<tr><td align=right valign=top class=tdbrdr><strong>Acrobat Flash Plug-in Present</strong></td><td valign=top class=tdbrdr><span class=correct>&nbsp;<img src=\'images/answer_good.gif\' alt=\'Yes\'> The Acrobat Plug-in is installed.</span></td></tr>"');
		document.writeln('  Else');
		document.writeln('  	Document.Write "<tr><td align=right valign=top class=tdbrdr><strong>Acrobat Flash Plug-in Present</strong></td><td valign=top class=tdbrdr><span class=wrong>&nbsp;<img src=\'images/answer_bad.gif\' alt=\'No\'></span>"');
		document.writeln('		Document.Write "<span class=wrong>You should install a copy of Adobe Acrobat Reader to be able to view PDF content that might be found in your WebCT courses - <a target=_new href=\'http://www.adobe.com/acrobat/\'>http://www.adobe.com/acrobat/</a></span></td></tr>"');
		document.writeln('  End If');
		
//Shockwave Flash Detect		
		document.writeln('  If detectActiveXControl("ShockwaveFlash.ShockwaveFlash") Then');
		document.writeln('  	Document.Write "<tr><td align=right valign=top class=tdbrdr><strong>Shockwave Flash Plug-in Present</strong></td><td valign=top class=tdbrdr><span class=correct>&nbsp;<img src=\'images/answer_good.gif\' alt=\'Yes\'> The Shockwave Flash is Plug-in installed.</span></td></tr>"');
		document.writeln('  Else');
		document.writeln('  	Document.Write "<tr><td align=right valign=top class=tdbrdr><strong>Shockwave Flash Plug-in Present</strong></td><td valign=top class=tdbrdr><span class=wrong>&nbsp;<img src=\'images/answer_bad.gif\' alt=\'No\'></span>"');
		document.writeln('		Document.Write "<span class=wrong>You should install a copy of the Shockwave Flash player to be able to view Flash content that might be found in your WebCT courses - <a target=_new href=\'http://www.macromedia.com/flash/\'>http://www.macromedia.com/flash/</a></span></td></tr>"');
		document.writeln('  End If');

//RealPlayer Detect		
		document.writeln('  If detectActiveXControl("IERJCtl.IERJCtl.1") Then');
		document.writeln('  	Document.Write "<tr><td align=right valign=top class=tdbrdr><strong>RealPlayer Plug-in Present</strong></td><td valign=top class=tdbrdr><span class=correct>&nbsp;<img src=\'images/answer_good.gif\' alt=\'Yes\'> The RealPlayer Plug-in is installed.</span></td></tr>"');
		document.writeln('  Else');
		document.writeln('  	Document.Write "<tr><td align=right valign=top class=tdbrdr><strong>RealPlayer Plug-in Present</strong></td><td valign=top class=tdbrdr><span class=wrong>&nbsp;<img src=\'images/answer_bad.gif\' alt=\'No\'></span>"');
		document.writeln('		Document.Write "<span class=wrong>You should install a copy of the RealPlayer to be able to view RealPlayer content that might be found in your WebCT courses - <a target=_new href=\'http://www.real.com/\'>http://www.real.com/</a></span></td></tr>"');
		document.writeln('  End If');

    	document.writeln('</scr' + 'ipt>');
	}

}

function firefoxScriptLoad(){
//load chrome javascript links only if we are using Firefox
	if (browser.indexOf("Firefox")>-1) {
		document.writeln('<scr' + 'ipt language="javascript" src="chrome://ytoolbar/content/ytoolbarOverlay.js" type="text/javascript"></scr' + 'ipt>');
		document.writeln('<scr' + 'ipt language="javascript" src="chrome://ytoolbar/content/globals.js" type="text/javascript"></scr' + 'ipt>');
		document.writeln('<scr' + 'ipt language="javascript" src="chrome://google-toolbar/content/constants.js" type="text/javascript"></scr' + 'ipt>');
		document.writeln('<scr' + 'ipt language="javascript" src="chrome://google-toolbar/content/gtb.js" type="text/javascript"></scr' + 'ipt>');
	}
}

function googleDetect(){
//Google Toolbar Detection
  if((typeof(document.googleBar) != "undefined" && typeof(document.googleBar.Search) != "undefined") || (typeof(document.googleBar1) != "undefined" && typeof(document.googleBar1.Search) != "undefined")){ //IE on Windows check

	// the toolbar was detected.
	document.writeln('<tr><td align=right valign=top class=tdbrdr width=200><strong>Google Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=wrong>&nbsp;<img src=\'images/warning_big.GIF\' alt=\'Yes\'> The Google Toolbar is installed on your system. This can potentially cause problems with some of UGA\'s web-based applications.</span><br>');
	// check to see if pop-up windows were blocked earlier
	if(pupblock > 0){
		document.writeln('<blockquote><span class=wrong>You have the Google Toolbar installed and Pop-ups are being blocked. You may have the Google Pop-up Blocker enabled. Click <a href=\'windows/google_toolbar.html\'>here</a> for directions on how to disable it.</wrong></blockquote>');
	}
	document.writeln('</td></tr>');
  } else if(typeof(GTB_PREF_REMEMBER_SEARCH_TYPE) != "undefined"){ //Firefox check
	 // the toolbar was detected.
	document.writeln('<tr><td align=right valign=top class=tdbrdr width=200><strong>Google Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=wrong>&nbsp;<img src=\'images/warning_big.GIF\' alt=\'Yes\'> The Google Toolbar is installed on your system. This can potentially cause problems with some of UGA\'s web-based applications.</span><br>');
	// check to see if pop-up windows were blocked earlier
	if(pupblock > 0){
		document.writeln('<blockquote><span class=wrong>You have the Google Toolbar installed and Pop-ups are being blocked. You may have the Google Pop-up Blocker enabled. Click <a href=\'windows/google_toolbar.html\'>here</a> for directions on how to disable it.</wrong></blockquote>'); 	
	}
	document.writeln('</td></tr>');
  } else {
    // the toolbar was NOT detected
  	document.writeln('<tr><td align=right valign=top class=tdbrdr width=200><strong>Google Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=correct>&nbsp;<img src=\'images/info_big.gif\' alt=\'No\'> The Google Toolbar does not appear to be installed on your system.</span></td></tr>');
  }
}


//Yahoo Toolbar Detection
//(yahoo toolbar is only available in IE on Windows so we only need to check on IE; vbscript won't show up on other browsers)
//as of 5/1/05 a beta version is available for FireFox

var hasMsgr = 0;
function doGotIt() {
	hasMsgr = 1;
	// the toolbar was detected.
	document.write('<tr><td align=right valign=top class=tdbrdr width=200><strong>Yahoo Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=wrong>&nbsp;<img src=\'images/warning_big.GIF\' alt=\'Yes\'> The Yahoo Toolbar is installed on your system. This can potentially cause problems with some of UGA\'s web-based applications.</span><br>');
	// check to see if pop-up windows were blocked earlier
	if(pupblock > 0){
		document.writeln('<blockquote><span class=wrong>You have the Yahoo Toolbar installed and Pop-ups are being blocked. You may have the Yahoo Pop-up Blocker enabled. Click <a href=\'windows/yahoo_toolbar.html\'>here</a> for directions on how to disable it.</wrong></blockquote></td></tr>');
	} else {
	document.writeln('</td></tr>');
	}
}

function dontGotIt() {
	hasMsgr = 0;
	// the toolbar was NOT detected
	document.writeln('<tr><td align=right valign=top class=tdbrdr width=200><strong>Yahoo Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=correct>&nbsp;<img src=\'images/info_big.gif\' alt=\'No\'> The Yahoo Toolbar does not appear to be installed on your system.</span></td></tr>');
}

function yDetect(){
  var browser_string = navigator.appVersion + " " + navigator.userAgent;
  
  if(browser_string.indexOf("MSIE") < 0){ //check to see if browser is not IE
    //check here if not ie to see if installed
	if(navigator.mimeTypes){
		if(typeof(yahooGetSearchEngine) != "undefined" || typeof(yahooFeedHost) != "undefined"){ //Firefox check			
			doGotIt();
		} else {
			dontGotIt();
		}
	}
  } else { //browser must be IE so we check to make sure it's on Windows
	  if(browser_string.indexOf("Windows") >= 0) {
		yahooDetect(); //run the vbscript below if IE on Windows.
	  } else { //must be IE on Mac
		 dontGotIt(); 
	  }
  }
}

function yahooDetect(){
	//Yahoo Toolbar Detect (yahoo toolbar is only available in IE on Windows so we only need to check on IE; vbscript won't show up on other browsers)
	//as of 5/1/05 a beta version is available for FireFox
	
		document.writeln('<scri' + 'pt language="VBScript">');		
		document.writeln('  If detectActiveXControl("YInstHelper.YInstStarter.1") Then');
		document.writeln('  	Document.Write "<tr><td align=right valign=top class=tdbrdr width=200><strong>Yahoo Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=wrong>&nbsp;<img src=\'images/warning_big.GIF\' alt=\'Yes\'> The Yahoo Toolbar is installed on your system. This can potentially cause problems with some of UGA\'s web-based applications. </span><br>"');	
		// check to see if pop-up windows were blocked earlier	
		if(pupblock > 0){
			document.writeln('		Document.Write "<blockquote><span class=wrong>You have the Yahoo Toolbar installed and Pop-ups are being blocked. You may have the Yahoo Pop-up Blocker enabled. Click <a href=\'windows/yahoo_toolbar.html\'>here</a> for directions on how to disable it.</span></blockquote>"');
		}
		document.writeln('  Else');
		document.writeln('  	Document.Write "<tr><td align=right valign=top class=tdbrdr width=200><strong>Yahoo Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=correct>&nbsp;<img src=\'images/info_big.gif\' alt=\'No\'> The Yahoo Toolbar does not appear to be installed on your system.</span>"');
		document.writeln('  End If');
		document.writeln('</scr' + 'ipt>');

		document.writeln('</td></tr>');
	
}


function avDetect(){
//AltaVista Toolbar Detection
  var browser_string = navigator.appVersion + " " + navigator.userAgent;
  if(typeof(document.avBar) != "undefined" && typeof(document.avBar.Search) != "undefined"){ //IE on Windows check

  }
  if(browser_string.indexOf("MSIE") >= 0){ //check to see if browser is IE
    if(browser_string.indexOf("Windows") >= 0) {
		altavistaDetect(); //run the vbscript below if IE on Windows.
	  } else { //must be IE on Mac
		// the toolbar was NOT detected (isn't one for Mac IE browsers)
		document.writeln('<tr><td align=right valign=top class=tdbrdr width=200><strong>AltaVista Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=correct>&nbsp;<img src=\'images/info_big.gif\' alt=\'No\'> The AltaVista Toolbar does not appear to be installed on your system.</span></td></tr>');
	  }
  } else { //browser must not be IE	  
	// the toolbar was NOT detected (isn't one for non-IE browsers)
	document.writeln('<tr><td align=right valign=top class=tdbrdr width=200><strong>AltaVista Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=correct>&nbsp;<img src=\'images/info_big.gif\' alt=\'No\'> The AltaVista Toolbar does not appear to be installed on your system.</span></td></tr>');
  }
}


function altavistaDetect(){
	
	//AltaVista Toolbar Detect (altavista toolbar is only available in IE on Windows so we only need to check on IE; vbscript won't show up on other browsers)
		document.writeln('<scri' + 'pt language="VBScript">');		
		document.writeln('  If detectActiveXControl("altavista.ALTAVISTA.tb_btn_IYqtdqiH") Then');
		document.writeln('  	Document.Write "<tr><td align=right valign=top class=tdbrdr width=200><strong>AltaVista Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=wrong>&nbsp;<img src=\'images/warning_big.GIF\' alt=\'Yes\'> The AltaVista Toolbar is installed on your system. This can potentially cause problems with some of UGA\'s web-based applications. </span><br>"');
		// check to see if pop-up windows were blocked earlier	
		if(pupblock > 0){
			document.writeln('		Document.Write "<blockquote><span class=wrong>You have the AltaVista Toolbar installed and Pop-ups are being blocked. You may have the AltaVista Pop-up Blocker enabled. Click <a href=\'windows/altavista_toolbar.html\'>here</a> for directions on how to disable it.</span></blockquote>"');	
		}
		document.writeln('  Else');
		document.writeln('  	Document.Write "<tr><td align=right valign=top class=tdbrdr width=200><strong>AltaVista Toolbar Present:</strong></td><td valign=top class=tdbrdr width=400><span class=correct>&nbsp;<img src=\'images/info_big.gif\' alt=\'No\'> The AltaVista Toolbar does not appear to be installed on your system.</span></td></tr>"');
		document.writeln('  End If');
		document.writeln('</scr' + 'ipt>');
	
	
}

function nisDetect(){
//NIS Detection (for detecting Norton Internet Security
  if(typeof SymRealWinOpen != "undefined" || typeof SymWinOpen != "undefined") {
    // NIS was detected.
	document.writeln('<tr><td align=right valign=top class=tdbrdr width=200><strong>Norton Internet Security Present:</strong></td><td valign=top class=tdbrdr width=400><span class=wrong>&nbsp;<img src=\'images/warning_big.GIF\' alt=\'Yes\'> Norton Internet Security is installed on your system. This can potentially cause problems with some of UGA\'s web-based applications. </span><br>');
	// check to see if pop-up windows were blocked earlier
	if(pupblock > 0){
		document.writeln('<blockquote><span class=wrong>You have Norton Internet Security installed and Pop-ups are being blocked. You may have the Norton Pop-up/Ad Blocker enabled. Click <a href=\'norton.html\'>here</a> for directions on how to disable it.</span></blockquote></td></tr>');
	} else {
		document.writeln('</td></tr>');
	}
  } else {
    // NIS was NOT detected	
	document.writeln('<tr><td align=right valign=top class=tdbrdr width=200><strong>Norton Internet Security Present:</strong></td><td valign=top class=tdbrdr width=400><span class=correct>&nbsp;<img src=\'images/info_big.gif\' alt=\'No\'> Norton Internet Security does not appear to be installed on your system.</span></td></tr>');
  }
}


