// EXIT ACTION
window.onbeforeunload = unloadMess;
document.onmousemove = getMouseXY;

var mousex = 0;
var mousey = 0;
//The text between the quotes is the text that will appear on popup window.
var ExitActionText = "Are you sure you want to leave?  Check this out!";

function random_100() {
	var ran_formatted = Math.floor( Math.random()*100 );
	return ran_formatted;
}

function unloadMess() {
	if (mousey<10 && mousex > 400) {
		//Exit Action redirect to this url.
		window.location = "http://galleries.mrskin.com/galleries/gallery.html?nats=MTk3NDI6Mzox,0,0,0,6&content=jessica_alba";
		return ExitActionText;
	}
}

function getMouseXY(e) {
	if (!e) e = window.event;
	if (e) {
		if (e.pageX || e.pageY) {
			mousex = e.pageX;
			mousey = e.pageY;
		} else if (e.clientX || e.clientY) {
			mousex = e.clientX + document.body.scrollLeft;
			mousey = e.clientY + document.body.scrollTop;
		}  
	}
}

// AUTO RESIZE
top.window.moveTo(0,0);
top.window.moveTo(0,0);
if (document.all) {
	top.window.resizeTo(screen.availWidth,screen.availHeight);
	
} else if (document.layers||document.getElementById) {
	if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
		top.window.outerHeight = screen.availHeight;
		top.window.outerWidth = screen.availWidth;
	}
}

