window.onbeforeunload = exitConfirmation; // call exitConfirmation function

//fix error from using RESTART button under IE, causes second popUp and does not work afterwards 072208
var confirmation = true;

function exitConfirmation()
{
	if(confirmation == true)
	{
		var returnMSG = "";
		returnMSG += "    -----------------------------------------------------\n\n";
		returnMSG += "     YOU ARE ABOUT TO LEAVE THE VISUAL PLANNER!\n\n";
		returnMSG += "    -----------------------------------------------------";
		return returnMSG;
	}
}


///////////////////////////////////////////////	
function reloadPlanner()
{
	confirmation = false;
	window.location.reload();
}
///////////////////////////////////////////////	


//Popup function for Help, Walls and Search functions
///////////////////////////////////////////////	
function launchPopup(URL, ht, wd, scroll)
{
	var posLeft = (screen.width/2) - (wd/2);
	var posTop = (screen.height/2) - (ht/2);
	popupWindow = window.open(URL,'Help','height='+ht+',width='+wd+',top='+posTop+',left='+posLeft+',toolbar=No,location=No,scrollbars='+scroll+',status=No,resizable=yes,fullscreen=No');
	if(!popupWindow)
	{
		alert("Please turn off your popup blocker to view this feature.");
	}
} 
///////////////////////////////////////////////
// Launches shopping cart in _parent window of iframe
function launchShoppingCart(URL)
{
	confirmation = false;
	window.parent.location.href = URL;
}
///////////////////////////////////////////////////////////////////////////////