// Script configuration variables:
	// Popup window options:
		// The URL to show in the popup window
		//var popupURL="http://www.travelfleamarket.com/index_popup.php";
		var popupURL="http://www.travelfleamarket.com/travel-poponexit.php";
		
		// 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=460;
			var popupWidth=325;
		
		// "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.travelfleamarket.com",
		"http://www.travelfleamarket.com/",
		"http://www.travelfleamarket.com/affiliate/",
		"http://www.travelfleamarket.com/ideserveafreevacation/",
		"http://www.travelfleamarket.com/admin/",
		"http://www.travelfleamarket.com/admin/admin/",
		"javascript:window.external.AddFavorite"
	);
	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;

function doPopup() {
	options = "scrollbars="+popupScrollbars+",location="+popupLocation;
	helpWindow = window.open(popupURL, "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() {
	if (!unloadNoticed && catchExtendedUnloads) {
		doPopup();
	}
}
