//
// home.js
//

// -------------------------------------------------------------
// cross-browser helper functions
// -------------------------------------------------------------

// Global variables
var suppressMenus	= false;
var isCSS 			= false;
var isW3C 			= false;
var isIE4 			= false;
var isNN4 			= false;
var isIE6 			= false;
var isGecko 		= false;
var isOpera 		= false;
var isDHTML 		= false;

// Add a BookMark
function addBookMark()
{
	if ( window.external ) 
		{
			window.external.AddFavorite( document.location.href,document.title );
		} 
		else 
		{
			alert( "Sorry, your browser doesn't support bookmarking this page...\n\nPlease try pressing Control + D instead" );
		}
}

// initialize upon load to let all browsers establish content objects
function Autoconfig()
{
    if( document && document.images )
    {
        isCSS		= (document.body && document.body.style) ? true : false;
        isW3C		= (isCSS && document.getElementById) ? true : false;
        isIE4		= (isCSS && document.all && readIEVer() >= 4.0) ? true : false;
        isNN4		= (document.layers) ? true : false;
        isGecko		= (isCSS && navigator && navigator.product && navigator.product == "Gecko");
        isOpera		= (isCSS && navigator.userAgent.indexOf( "Opera") != -1 );
		isIE6CSS	= (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
		isIE6		= ( isIE6CSS && readIEVer() >= 6.0 );
        isDHTML		= isCSS && ( isIE4 || isGecko || isOpera );

        if( suppressMenus )
        {
			// Netscape 6.2 puts the menus in the wrong place...
			// Safari, the menus don't go away... problem in ResetMenu
			isDHTML	= false;
        }
        else if( isOpera && readOperaVer() < 7 )
        {
			// Opera 6.x doesn't seem to like the DHTML...
			isDHTML	= false;
        }
		else if( isGecko && navigator.productSub <= 20011022 )
        {
			// Netscape 6.2 puts the menus in the wrong place...
			isDHTML	= false;
        }
		else if( isGecko && navigator.productSub == 20030107 )
        {
			var x = navigator.userAgent.indexOf( "AppleWebKit" );
			if( x > -1 )
			{
				// Tiger and newer versions of Safari ... 
				isDHTML = ( navigator.userAgent.substring( x + 12, x + 15 ) ) > 300;
			}
			else
			{
				// older versions of Safari ... the menus don't go away... problem in ResetMenu
				isDHTML	= false;
			}
        }
    
    } 
    
}


function readIEVer()
{
	var agent	= navigator.userAgent;
	var offset	= agent.indexOf( "MSIE" );
	if( offset < 0 )
	{
		return 0;
	}
	return parseFloat( agent.substring( offset + 5, agent.indexOf( ";", offset ) ) );
}

function readOperaVer()
{
	var agent	= navigator.userAgent;
	var offset	= agent.indexOf( "Opera" );
	if( offset < 0 )
	{
		return 0;
	}
	return parseFloat( agent.substring( offset + 6 ) );
}
// ----------------------------------------------------
// End Browser Sniffer Content
// ----------------------------------------------------
