function handleClose(){
	var input_box=true;
	if (isBrowserClosed()){
		alert('Before you go did you know you can get a 20% discount automatically?\nYou can find the link on the bottom right of the home page');
		/*var input_box=confirm("Before you go did you know you can get a 20% discount automatically? You can find the link on the  Click ok to receive the discount and fill the form again or cancel to continue");
	
		if (input_box==true){ 
			// Output when OK is clicked
			window.open ("http://www.4urentals.com/prices.php?quote=1","_blank","status=1"); 
		}*/
	}

}

function isBrowserClosed(){
	var browserWindowWidth = 0;
	var browserWindowHeight = 0;

	// gets the width and height of the browser window
	if (parseInt(navigator.appVersion) > 3){
		if (navigator.appName == "Netscape"){
			browserWindowWidth = window.innerWidth;
			browserWindowHeight = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft") !=- 1){
			browserWindowWidth = top.window.document.body.offsetWidth;
			browserWindowHeight = top.window.document.body.offsetHeight;
		}
	}
	// checks if the X button was closed
	// if event.clientY < 0, then click was on the browser menu area
	// if event.screenX > (browserWindowWidth - 25), the X button was clicked
	// use screenX if working with multiple frames
	return (event.clientY < 0 && event.screenX > (browserWindowWidth - 25)) ? true : false;
}

