/* 
This script looks at all the anchor tags on a page, and if the url has "leavesite-main" in it, a pop-up window is displayed as part of the "leaving the site" functionality. It is called from:
- wrapper.cfm (which takes care of 95% of the pages on the site)
- all of the "incsmallwindow-..." (which do NOT use wrapper.cfm)

IMPORTANT: you must also call the init() function in the body of the page, for example, <body onLoad="init();">
*/
function init() {
	var links = document.getElementsByTagName('a');
	for (var i = links.length; i != 0; i--) 
	{
		var a = links[i-1];
		if (!a.href) continue;
		// Only do this if the link is to leavesite-main.cfm
		if (a.href.indexOf('leavesite-main.cfm') != -1 ) 
		{
			a.onclick = PopWin;
		}
	}
}

function PopWin(e) {
	if (!e) var e = window.event;
	//	alert(this.href);
	var a = e.target ? e.target : e.srcElement;
	var newwin = window.open(this.href ,'openlink','width=370,height=190,screenX=100,screenY=100,top=100,left=100,resizable=yes,toolbar=no,scrollbars=no')
	return !newwin;    
}