	// Start special code for exit popup

	/*
	 * Globals
	 *
	 */
	 
	 var gbLeaving = true;	// Global flag to see if user clicked on an internal site link
	 var gbExitPopupFlag = true; // Global flag	to turn on/off exit popup
	 var gstrExitUrl = '/sharedIncludes/exitpop/exitpop.jsp';

	/*
	 * Purpose: Throw popup on site exit. Check global var to see if user came from the current domain. This will 
	 *	prevent a popup if the user clicks refresh, back, or forward button. Check global flag 'gbExitPopupFlag' 
	 *	to check if feature is even turned on.
	 */
	function exitPop(url) {
		
		if (gbLeaving && gbExitPopupFlag) 
		{
		//session.setAttribute("FORMSUBMIT", "yes");
			mywin = window.openWin(url,'exitPop','toolbar=yes,width=520,height=380,directories=no,status=yes,scrollbars=no,resizable=no,menubar=no,location=yes,left=50,top=50');
			gbExitPopupFlag = false; // we only want it to popup a maximum of one time
		}
	}

	/*
	 * Purpose: Set flag to false to prevent popup exit if user clicks on internal link
	 */
	function setLeavingFlagToFalse() { gbLeaving = false; }


	/*
	 * Purpose: Set gbLeaving flag to false on form submit event
	 */
	function initForm() {

		window.document.form.onsubmit = setLeavingFlagToFalse;
	}
	
	// End special code for exit popup

function openWin(page, name, details) {
	newWin = window.open(page, name, details);
	if (window.focus) { newWin.focus() }
}
