// JavaScript Document

$user_pop=false;
document.onmouseup=adPopunder;
function adPopunder() {
	if($user_pop==false) {
	    $user_pop=true;
		$cookie=navigator.cookieEnabled;
		if($cookie) {
			$popunder_true=adGetCookie("l2news_pop");
			if(!$popunder_true) {
				wind=window.open("http://l2rx.com","_blank","toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes");
				if(wind) {
					adSetCookie("l2news_pop",1,24);
					wind.blur();
				}
			}
		}
	}
}

function adSetCookie($Name,$Value,$EndH) {
	var exdate=new Date();
	$EndH=exdate.getHours()+$EndH;
	exdate.setHours($EndH);
	document.cookie=$Name+ "=" +escape($Value)+(($EndH==null) ? "" : ";expires="+exdate.toGMTString()+"; path=/;");
}

function adGetCookie($Name) {
	if (document.cookie.length>0){
		$Start=document.cookie.indexOf($Name + "=");
		if ($Start!=-1){
			$Start=$Start + $Name.length+1;$End=document.cookie.indexOf(";",$Start);
			if ($End==-1) $End=document.cookie.length;return unescape(document.cookie.substring($Start,$End));
		}
	}
	return "";
}
