var windowWidth = 1024;var windowHeight = 768;
function detectWindowSize() {	var myWidth = 0;	var myHeight = 0;	if( typeof( window.innerWidth ) == 'number' ) {		//Non-IE		myWidth = window.innerWidth;		myHeight = window.innerHeight;	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {		//IE 6+ in 'standards compliant mode'		myWidth = document.documentElement.clientWidth;		myHeight = document.documentElement.clientHeight;	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {		//IE 4 compatible		myWidth = document.body.clientWidth;		myHeight = document.body.clientHeight;	}	windowWidth = myWidth;	windowHeight = myHeight;}


function vertCenterContentWrapper() {
	// if the window is less than 640 pixels tall, then just let the contentWrapper sit at the top of the screen
	if (windowHeight <= 640) { return; }
	var sizeDifference = windowHeight - 640;
	var topPosition = Math.floor(sizeDifference / 2);
	topPosition += "px";
	document.getElementById("contentWrapper").style.top = topPosition;
}


function configExternalLinks() {
	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";
		}
	} 
}
