//-----------------------------------------------------------------------------
// global javascript
//-----------------------------------------------------------------------------
// Use of this code is governed in accordance with the terms and conditions of
// the agreement executed between the Client and Tag New Media. It is intended
// for use on the NPI site only.
//
// © Copyright Tag New Media 2006. All Rights Reserved. 
//-----------------------------------------------------------------------------

window.name = "opener";

//put anything here that you want to run on onLoad for every page
function OnPageLoad() {
	return true;
}

function WindowWidth() {
	var frameWidth = 800;
	
	if (self.innerWidth) {
		frameWidth = self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientWidth) {
		frameWidth = document.documentElement.clientWidth;
	} else if (document.body) {
		frameWidth = document.body.clientWidth;
	}
	
	return frameWidth;
}

function LoginPopup() {
	var popupWidth = 170;
	var offset = 200;
	var left = (WindowWidth() - popupWidth) / 2 + offset;
	
	document.getElementById('login-popup').style.left = left + 'px';
	document.getElementById('login-popup').style.visibility = 'visible';

	return false;
}

function LoginPopupClose() {
	document.getElementById('login-popup').style.visibility = 'hidden';
	return false;
}

function NospamMailAddress(address, contactName) {
	var emailHost = "npi.net";
	var emailAddress = address + "@" + emailHost;

	if (contactName == '') {
		contactName = emailAddress;
	}

  document.write("<a href=\"" + "mail" + "to:" + emailAddress + "\">" + contactName + "</a>");
}