// exitpopup.js - version 1.0
// created by Ron Sneh on 27/10/2010

$(document).ready(function(){
	$("#logoutFunc").click(function(){
		exit=false;
		$.ajax({
			url:"/lp/back2play.php",
			type:"POST",
			dataType:"html",
			data: "ql="+ide,
			success: function(e){
				go('logout', false, '/main.php');
				return true;
			},
			error: function(e){
				go('logout', false, '/main.php');
				return true;
			}
		});
		return false;
	});
	$(document).click(function(){
		exit=false;
		var setexitTrue = function(){
			exit=true;
		};
		setTimeout(setexitTrue, 4000);
	});
	$(".HeaderMemberBox").click(function(){
		exit=false;
	});
	$(document).keydown(function(event) {
		if (event.keyCode == 116 || event.keyCode == 13) {
			exit=false;
		}
	});
	$(window).unload(function(){
		if (exit) {
			if (navigator.appName.indexOf("Microsoft") != -1) {
				wb = window.open("http://www.888ladies.com/lp/back2play.php", "testwindow", "width=557,height=245,top=200,left=200");
			} else {
				window.open("http://www.888ladies.com/lp/back2play.php","mywindow","width=557,height=245,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0,top=200,left=200");
			}
		}
	});
});
