//
// home.js
//

// -------------------------------------------------------------
// cross-browser helper functions
// -------------------------------------------------------------

// Global variables
var isCSS 				= false;
var isW3C 				= false;
var isIE4 				= false;
var isNN4 				= false;
var isIE6 				= false;
var isGecko 			= false;
var isOpera 			= false;
var isDHTML 			= false;
var suppressMenus	= false;
var legacyMode		= false;
var timerID				= null;
var subtimerID		= null;

// 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 || ( isOpera && readOperaVer() < 7 ) || ( isGecko && navigator.productSub <= 20011022 ) || ( isGecko && navigator.productSub == 20030107 ) )
        {
					isDHTML	= false;
        }     
    } 
    
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('hotjava')==-1));
    var is_nav4 = (is_nav && (is_major == 4));
    if (is_nav4) // && (is_minor <= 4.8)) || (is_minor <= 4.7)) )
    {
    	window.location='http://www.southcorp.com.au/netscape/netscape.htm';
    }
    
    //if(isNN4)
    //{
    //	window.location='http://www.southcorp.com.au/';
    //}    
}


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 ) );
}


function Bandwidth()
{
	if( readIEVer() < 5.0 || isOpera || navigator.appVersion.toLowerCase().indexOf("win") == -1 )
	{
		return "NA";
	}
	
	document.body.addBehavior ("#default#clientCaps");
	
	if ( typeof( document.body.connectionType) != "undefined"  ) 
	{
		if ( document.body.connectionType == "modem" )
		{
			return "Modem";
		}
		return "Lan";
	}

}


// -------------------------------------------------------------
// end of home.js
// -------------------------------------------------------------
