<!--
/*

  -------------------------------------------------------------------------------
 |  Copyright (C) 2005 Azalea Technology, LLC. All rights reserved.              |
 |-------------------------------------------------------------------------------|
 |  Unauthorized removal of this notice is considered a violation of the         |
 |  license agreement under which this Code may be used. This work is protected  |
 |  under United States copyright law and the similar law(s) of other countries  |
 |  under which such as work is afforded legal protection, and upon conviction   |
 |  of such a violation in a court of applicable jurisdiction, such person(s)    |
 |  may be subject to the maximum allowable penalty as permitted under such law. |
 |-------------------------------------------------------------------------------|
 |  You acknowledge and agree that information presented to you through this     |
 |  site (the "Web Site") is protected by all applicable copyrights, trademarks, |
 |  service marks, patents or other proprietary rights and laws, and by virtue   |
 |  of accessing the Web Site, except as expressly authorized by the Azalea      |
 |  Technology, LLC., you agree not to modify, rent, lease, loan, sell,          |
 |  distribute, store, or create derivative works based on the Web Site, in      |
 |  whole or in part.                                                            |
  ------------------------------------------------------------------------------- 
 |  Decrypting or otherwise decoding the following programming language code is  |
 |  strictly prohibited except as expressly authorized by Azalea Technology,     |
 |  LLC. Upon conviction of such a violation in a court of applicable            |
 |  jurisdiction, such person(s) may be subject to the maximum allowable penalty |
 |  as permitted under such law.                                                 |
  -------------------------------------------------------------------------------
          Module: browser.js
         Version: 1.0
		 Purpose: User agent (browser) function library

      Programmer: Benjamin Roberts
                  Azalea Technology, LLC.
                  P.O. Box 131150
                  Tyler, TX 75713-1150
                  broberts@azaleatech.com

         License: HGR General Contractors, L.P.
                  Single Domain (www.hgrgc.com); 10/24/2005
  -------------------------------------------------------------------------------
*/

var ua = new String(navigator.userAgent);
var browser = new Object();
browser.version    = parseFloat(navigator.appVersion);
browser.isNetscape = false;
browser.isMozillaBased = false;
browser.isExplorer = false;
browser.isOpera    = false;
browser.isFirebird = false;
browser.isFirefox  = false;
browser.isMozilla  = false;
browser.isUnknown  = false;
browser.OperaVersion = -1;

if(ua.match(/Mozilla/g)) browser.isMozillaBased = true;

if(ua.match(/MSIE/g)) browser.isExplorer = true;
else if(ua.match(/Netscape/g)) browser.isNetscape = true;
else if(ua.match(/Firebird/g)) browser.isFirebird = true;
else if(ua.match(/Firefox/g)) browser.isFirefox = true;
else if(ua.match(/Opera/g)) browser.isOpera = true;
else if(ua.match(/Mozilla/g)) browser.isMozilla = true;
else browser.isUnknown = true;

if(browser.isOpera){
	if(ua.match(/Opera 7/g)) browser.OperaVersion = 7;
	else if(ua.match(/Opera 6/g)) browser.OperaVersion = 6;
	else if(ua.match(/Opera 5/g)) browser.OperaVersion = 5;
	else if(ua.match(/Opera 4/g)) browser.OperaVersion = 4;
	else browser.OperaVersion = 0;
}

function getRealBrowserAppName(){
	var strName = "unknown";
	if(browser.isExplorer) strName = "Microsoft Internet Explorer";
	else if(browser.isNetscape) strName = "Netscape";
	else if(browser.isFirebird) strName = "Mozilla Firebird";
	else if(browser.isFirefox) strName = "Mozilla Firefox";
	else if(browser.isOpera) strName = "Opera";
	else if(browser.isMozilla) strName = "Mozilla";
	
	//if(navigator.appName.toLowerCase() != strName.toLowerCase()) strName += "#"+navigator.appName;
	return strName;	
}

// GET BROWSER INFORMATION
function getBrowserInfo(){
	var str = "";
	str += "Computer Information<p>"+str+"\n";
	str += "                    Description = " + writeLongStringOnMultipleLines(navigator.userAgent,50,34) + "<br>\n";
	str += "------------------------------------------------------------------------------------<br>\n";
	str += "                    Code Engine = " + navigator.appCodeName + "<br>\n";
	str += "            Code Engine Version = " + browser.version + "<br>\n";
	str += "               Application Name = " + writeLongStringOnMultipleLines(getRealBrowserAppName(),50,34) + "<br>\n";
	str += "                       Platform = " + navigator.platform + "<br>\n";
	str += "             Resolution Setting = " + screen.width + " x " + screen.height + "<br>\n";
	str += "                  Mozilla-based = " + (browser.isMozillaBased ? "Yes" : "No") + "<br>\n";

	return str;
}
	
//-->