<!--
/*
  -------------------------------------------------------------------------------
 |  The content of this file constitutes Licensed Code.                          |
 |  Copyright (C) 2005-2007 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.                                                 |
  -------------------------------------------------------------------------------
         Purpose: Browser function library
      Programmer: Benjamin Roberts
                  Azalea Technology, LLC.
                  P.O. Box 131150
                  Tyler, TX 75713-1150
  -------------------------------------------------------------------------------
*/
// Create generic object
var dom_browser = new Object();

// Initialize boolean variables (properties of the "dom_browser" object) to indicate
// the current client's browser or user agent among the detected types
dom_browser.netscape = false;
dom_browser.ie = false;
dom_browser.safari = false;
dom_browser.opera = false;
dom_browser.firebird = false;
dom_browser.firefox = false;
dom_browser.mozilla = false;
dom_browser.unknown = false;
dom_browser.mozilla_based = false;

// Create a new string object
var ua = new String(navigator.userAgent);

// Determine the browser by the useragent string
if(ua.match(/MSIE/g)) dom_browser.ie = true;
else if(ua.match(/Netscape/g)) dom_browser.netscape = true;
else if(ua.match(/Safari/g)) dom_browser.safari = true;
else if(ua.match(/Firebird/g)) dom_browser.firebird = true;
else if(ua.match(/Firefox/g)) dom_browser.firefox = true;
else if(ua.match(/Opera/g)) dom_browser.opera = true;
else if(ua.match(/Mozilla/g)) dom_browser.mozilla = true;
else dom_browser.unknown = true;

// Check to see if browser is mozilla-based
if(ua.match(/Mozilla/g)) dom_browser.mozilla_based = true;

// Check general browser version number
dom_browser.version  = parseFloat(navigator.appVersion);

// Check Opera-specific version number
if(dom_browser.opera){
	if(ua.match(/Opera 7/g)) dom_browser.version = 7;
	else if(ua.match(/Opera 6/g)) dom_browser.version = 6;
	else if(ua.match(/Opera 5/g)) dom_browser.version = 5;
	else if(ua.match(/Opera 4/g)) dom_browser.version = 4;
	else dom_browser.version = 0;
}

dom_browser.get_browser_name = function(){
	var str_name = "unknown";

	if(dom_browser.ie) str_name = "Microsoft Internet Explorer";
	else if(dom_browser.netscape) str_name = "Netscape";
	else if(dom_browser.firebird) str_name = "Mozilla Firebird";
	else if(dom_browser.firefox) str_name = "Mozilla Firefox";
	else if(dom_browser.safari) str_name = "Safari";
	else if(dom_browser.opera) str_name = "Opera";
	else if(dom_browser.mozilla) str_name = "Mozilla";

	return str_name;
}

dom_browser.get_browser_info = function(){
	var str = "";
	str += "Computer Information<p></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(dom_browser.get_browser_name(),50,34) + "<br />\n";
	str += "                       Platform = " + navigator.platform + "<br />\n";
	str += "             Resolution Setting = " + screen.width + " x " + screen.height + "<br />\n";
	str += "                  Mozilla-based = " + (dom_browser.mozilla_based ? "Yes" : "No") + "<br />\n";

	return str;
}

//-->