	var stopPop;
	function getCookie(name){
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
		if (begin == -1)
		{
			begin = dc.indexOf(prefix);
			if (begin != 0) return null;
		}else{
			begin += 2;
		}
		var end = document.cookie.indexOf(";", begin);
		if (end == -1)
		{
			end = dc.length;
		}
		return unescape(dc.substring(begin + prefix.length, end));
	}//getCookie

	

	
	function newWindow()
	{
		
		if (!isOpenCasino) {
			if (ActionExit) {
				var memberCookie=getCookie("AusVegasRego");
				var existCookie=getCookie("AusVegas");
				
				//new Pop out================================================				
				if (getCookie('AvsSession')==null){					
					if (memberCookie==null) {					
												
						if(stopPop)
							nw=window.open("/promotions/pop_out/exit_popup_question.jsp?stopPop="+stopPop,"survey","Toolbar=no,location=no,directories=no,stat us=no, menubar=no, scrollbars=no,resizable=no,width=320,height=460");					
						else 
							nw=window.open("/promotions/pop_out/exit_popup_question.jsp","survey","Toolbar=no,location=no,directories=no,stat us=no, menubar=no, scrollbars=no,resizable=no,width=320,height=460");										
					}else{
						var result=confirm('Would you like *US$500 Free at our sister site, Lasseters Online Casino?');
						if (result) window.open('http://www.lasseters.com.au/default.jsp?stopPop=true','LassHome');										
					}//if
					var sessCookie="AvsSession=yes";
					document.cookie = sessCookie;	
				}
				//===========================================================
			}//if ActionExit
		}//if isOpenCasino

		//var sessCookie="LassSession=yes";
		//document.cookie = sessCookie;

		isOpenCasino=true;
	}//newWindow

	var ActionExit = 1;
	var isNav;
	var isOpenCasino=false;

	if (parseInt(navigator.appVersion) >= 4) {
		if (navigator.appName == "Netscape") {isNav = true;}
	}

	function Catchclick(PassVal) {
		ActionExit = 0;
		//if (isNav) { document.routeEvent(PassVal); }
		//setTimeout("ActionExit=1",500);
		document.cookie = "AvsSession=yes";
		return true;
	}
	
	
	function ExitWatch(func) {
		Leave0 = func;
		Leave1 = window.onunload;
		window.onunload = new Function ("Leave0();");
	}
	
	if (isNav)
		document.captureEvents(Event.CLICK | Event.UNLOAD | Event.LOAD | Event.ERROR);
	document.onclick = Catchclick;
	ExitWatch(newWindow);

	