var pu_url = "http://www.fuckzone.info/?ctr=pages&act=dirty_xxx";
var pu_reruntime = 6; //hours
var pu_width = 1000;
var pu_height = 1500;

function createCookie(b, e, f) {
	var d = 60 * 60 * 1000 * f;
	var a = new Date();
	a.setTime(a.getTime() + (d));
	var c = "; expires=" + a.toGMTString();
	document.cookie = b + "=" + e + c + "; path=/";
}

function getCookie(a) {
	var b = document.cookie.match("(^|;) ?" + a + "=([^;]*)(;|$)");
	if (b) {
		return (unescape(b[2]));
	}
	else {
		return null;
	}
}

function pu() {
	if (getCookie("pu_timeout") == 1) {
		return true;
	}

	createCookie("pu_timeout", 1, pu_reruntime);
	var b = "toolbar=0,statusbar=1,resizable=1,scrollbars=0,menubar=0,location=1,directories=0";

	if (navigator.userAgent.indexOf("Chrome") != -1) {
		b = "scrollbar=yes";
	}

	var a = window.open("about:blank", "", b + ",height=" + pu_width + ",width=" + pu_height);

	if (navigator.userAgent.indexOf("rv:2.") != -1) {
		a.puPop = function (c) {
			if (navigator.userAgent.indexOf("rv:2.") != -1) {
				this.window.open("about:blank").close();
			}
			this.document.location.href = c;
		};
		a.puPop(pu_url)
	}
	else {
		a.document.location.href = pu_url;
	}

	if (navigator.userAgent.indexOf("MSIE") == -1) {
		setTimeout(window.focus);
		window.focus();
	}

	if (a) {
		a.blur();
	}
	else {
		done_pu = null; ifSP2 = false;
		if (typeof (pu_window) == "undefined") {
			pu_window = false;
		}
		if (window.SymRealWinOpen) {
			open = SymRealWinOpen;
		}
		if (window.NS_ActualOpen) {
			open = NS_ActualOpen;
		}

		ifSP2 = (navigator.userAgent.indexOf("SV1") != -1);

		if (!ifSP2) {
			doPu();
		}
		else {
			if (window.Event) {
				document.captureEvents(Event.CLICK);
			}
			document.onclick = doClickedPu;
		}

		self.focus();
		doClickedPu();
	}
}

function doPu() {
	if (!pu_window) {
		done_pu = open(pu_url, "", "toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");

		if (done_pu) {
			pu_window = true; 
			self.focus()
		}
	}
}

function doClickedPu() {
	if (!pu_window) {
		if (!ifSP2) {
			done_pu = open(pu_url, "", "toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
			self.focus();

			if (done_pu) {
				pu_window = true;
			}
		}
	}

	if (!pu_window) {
		if (window.Event) {
			document.captureEvents(Event.CLICK);
		}

		document.onclick = doPu; 
		self.focus();
	}
}

function initPu() {
	if (document.attachEvent) {
		document.attachEvent("onclick", pu);
	}
	else if (document.addEventListener) {
		document.addEventListener("click", pu, false);
	}

	return true;
}

initPu();
