// Script configuration variables:
	// Popup window options:
		// The URL to show in the popup window
		var browserIsNetscape=(navigator.appName.indexOf("Microsoft")!=-1) ? false : true;
		if(browserIsNetscape==true){
			var popupURL="notifyUserNS.cfm";
		}else{
			var popupURL="notifyUser.cfm";
		}
		
		// The size of the popup window
			// set this to 1 if you want the window maximized, 0 otherwise
			var popupMaximized = 0;

			// if you don't want a maximized window, enter the size here, otherwise, just set it to any numerical value
			var popupHeight	= 450;
			var popupWidth	= 250;
		
		// "yes" if you want the new window to have scrollbars, otherwise "no"
		var popupScrollbars="no" 

		// "yes" if you want the new window to have the address bar, otherwise "no"
		var popupLocation="no"

	// What is considered internal?
	var internalBaseURLs = new Array(
		"http://www.artmolds.com/"
	);

	// Extended Unload Event:
	// Should I pop up a window when the user exits by manualy typing in an URL, choosing a bookmark, or hitting the back
	// button?
	// WARNING: browser security does not allow JavaScript to find out what the URL of the new page is. Therefore all such
	// events (typing URL, opening a bookmark or hitting back) will cause a popup, regardless if they will keep the user
	// on your page.
	var catchExtendedUnloads=1;

//
//
// You can and should let the things below live their own life, without your meddling litle fingers! ;)
//
//
var browserIsNetscape=(navigator.appName.indexOf("Microsoft")!=-1) ? false : true;
var unloadNoticed=0;

x=0;
function doPopup() {
	options = "scrollbars="+popupScrollbars+",location="+popupLocation;
	helpWindow = window.open(popupURL+"?userurl="+url, "NavBar", options);

	if (popupMaximized) {
		helpWindow.moveTo(0,0);
		helpWindow.resizeTo(screen.availWidth, screen.availHeight);
	} else {
		helpWindow.resizeTo(popupHeight, popupWidth);
	}

	unloadNoticed=1;
}

function doInitPopupEvents() {
	if (browserIsNetscape) {
		window.captureEvents(Event.CLICK);
		window.onclick=checklink;
	} else {
		document.onclick=checklink;
	}
}

// Returns zero if the link is found among the internalBaseURLs, else it returns non-zero
function isLinkExternal(url) {
	var s = String(url);
	var foundInternals=0;

	for ( var i = 0; i < internalBaseURLs.length; i++ ) {
		if (s.search(internalBaseURLs[i]) == 0) {
			foundInternals++;
		}
	}

	return !foundInternals;
}

function checklink(e) {
	if (!browserIsNetscape) {
		targetURL = window.event.srcElement.href;
	} else {
		targetURL = e.target.href;
	}

	// If the event carries a non-null targetURL with it, it means that the user is going away,
	// so let's check the click...
	if (targetURL && isLinkExternal(targetURL)) {
		doPopup();
	} else {
		unloadNoticed=1;
	}
}

function doCheckUnloading(url) {
	if (!unloadNoticed && catchExtendedUnloads) {
		doPopup(url);
	}
}

