/*if ((navigator.appVersion.indexOf('Mac')!= -1)){ // Mac text adjust
	document.write('<link href="mac.css" rel="stylesheet" type="text/css">');
}
*/

if (document.layers){  // reloads window if Nav4x resized
  	origWidth = innerWidth;
  	origHeight = innerHeight;
}

function reloadPage(){
	if (innerWidth != origWidth ||
	innerHeight != origHeight)
	location.reload();
}

if (document.layers)onresize = reloadPage;


var timerID = null;
var timerOn = false;
var timecount = 1000;
var check = false;

var isDHTML = 0;
var isLayers = 0;//N4x
var isAll = 0;//IE4+
var isID = 0;//N6+,IE5+

if (document.getElementById){isID = 1; isDHTML = 1;}
else{
	if (document.all){isAll = 1; isDHTML = 1;}
	else{
		browserVersion = parseInt(navigator.appVersion);
		if((navigator.appName.indexOf('Netscape')!= -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
	}
}

function findDOM(objectID, withStyle){	// if accessing object's styles
	
	if (withStyle == 1){		
						if (isID){return(document.getElementById(objectID).style);
						}	
						else{
							if (isAll){return(document.all[objectID].style);}
							else{
								if (isLayers){return(document.layers[objectID]);}
							};
						}
	}

	else{		// if accessing object's other properties
			if (isID){return(document.getElementById(objectID));}
			else{
					if(isAll){return(document.all[objectID]);}
					else{
						if(isLayers){return(document.layers[objectID]);}
					};
			}
	}
}
	

function linkShow(objectID) {
		domStyle = findDOM(objectID,1);
		domStyle.visibility = "visible";
}	
	
function linkHide(objectID) {
		domStyle = findDOM(objectID,1);
		domStyle.visibility = "hidden";
}	

function hideAll() {
		linkHide('about');
		linkHide('personal');
		linkHide('corporate');
		linkHide('n4topnavcoach');
}	


function startTime() {
      
	   if (timerOn == false) {
              timerID=setTimeout( "hideAll()" , timecount);
              timerOn = true;
       }
}

function stopTime() {
       
	   if (timerOn) {
  	       
		    clearTimeout(timerID);
              timerID = null;
              timerOn = false;
	   }
}



var newWindow = null;

function closeWin() {
	if (newWindow != null) {
		if(!newWindow.closed)
			newWindow.close();
	}
}

function newWin(url, type, strWidth, strHeight) {
	
	closeWin();
	
	if (type == "fullScreen") {
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}
	
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "menu") tools = "resizable=yes,toolbar=no,location=no,menubar=yes,scrollbars=yes,width="+strWidth+",height="+strHeight+",left=0,top=0";
	if (type == "console") tools = "resizable=no,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	if (type == "console2") tools = "resizable=no,toolbar=no,location=no,scrollbars=yes,width="+strWidth+",height="+strHeight+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;