/* standard browser checks */
var isIE=(document.all && navigator.userAgent.toLowerCase().indexOf('msie')!=-1? true : false);
var isOpera=(navigator.userAgent.toLowerCase().indexOf('opera')!=-1? true : false);
var isSafari=(document.getElementById && !isIE && !isOpera && navigator.userAgent.toLowerCase().indexOf('safari')!=-1? true :false)
var isFF=(document.getElementById && !isIE && !isOpera && !isSafari && navigator.userAgent.toLowerCase().indexOf('firefox')!=-1? true :false)
var isNS=isFF;
function vIE(){return (navigator.appName=='Microsoft Internet Explorer')? parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}
function vOpera(){return (isOpera)? parseFloat((new RegExp("Opera\/([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}
function vSafari(){return (isSafari)? parseFloat((new RegExp("Version\/([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}
function vFF(){return (isFF)? parseFloat((new RegExp("Firefox\/([0-9]{1,}[.0-9]{0,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}
var isIE6 = (isIE && vIE()==6? true : false)
var isIE7 = (isIE && vIE()==7? true : false)
var isIE8 = (isIE && vIE()==8? true : false)

/* platform/OS check */
var isWin=(navigator.platform.toLowerCase().indexOf('win')!=-1? true: false);
var isMac=(navigator.platform.toLowerCase().indexOf('mac')!=-1? true: false);
var sTemp="";


// used to add functions/actions to the onload event for a document
function addOnLoadAct(fNewOnLoad){
	// save the existing onload event(s)
	var fCurrentOnLoad = window.onload;
	// if the existing onload does not have a function ...
	if (typeof window.onload != 'function'){
		// give it this function
		window.onload = fNewOnLoad;
	}else{
		// else add the new function to the existing function
		window.onload = function(){
			fCurrentOnLoad();
			fNewOnLoad();
		}
	}
}


// required to simulate pseudo class hover in IE6
sfHover = function() {

	if (document.getElementById("navP")){
	var sfEls = document.getElementById("navP").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	}
}

var myWin='';
function openURL(sURL,sSettings){
	if(!myWin || myWin.closed){
		if(sSettings){
			myWin=window.open(sURL,'myWin',sSettings);
		}else{
			myWin=window.open(sURL,'myWin');
		}
	}else{
		myWin.location.href=sURL;
		myWin.focus();
	}
}


function setNavigation () {
	if(document.getElementById('navP')){
		sNavName='navP';
		addOnLoadAct(sfHover);
	}
	
	if(document.getElementById('navS')){
		sNavName='navS';
		addOnLoadAct(sfHover);
	}
	
	if(document.getElementById('navG')){
		sNavName='navG';
		addOnLoadAct(sfHover);
	}

}
