
function openfullscreenWindow(theURL,winName) {
	var scx=screen.width-10;	
	var scy=screen.height-75;
	features='width='+scx+',height='+scy+'screenX=0,screenY=0,top=0,left=0,scrollbars=yes';
	window.open(theURL,winName,features);
}


function JpGetCookie(Navnpaacookie){
	
	if (document.cookie.length > 0) {
	
		begin = document.cookie.indexOf(Navnpaacookie+"="); 

		if (begin == -1) {
			return false;
		}else{
			return true;
		}
	}
	return false; 
}

function JpSetCookie(Navnpaacookie, value, expiredays){
	
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = Navnpaacookie + "=" + escape(value) + 
	((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString())+"; path=/";
}

function JpCheckCookie(){

//	when popup is inactive - return here
	return true;	

	if(JpGetCookie('jppopup')){
		if(!JpGetCookie('extra_cookie')){
			if (document.location != 'http://www.jp.dk/') {
				if (document.location != 'http://www.jp.dk/forside/') {
					window.open('http://www2.jp.dk/avissalg/prov_popup.asp?referer=jp','','scrollbars=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, Resizable=yes, width=540, height=550, top=50, left=100');
					JpSetCookie('extra_cookie', "true", 3);
				}
			}		
		}
	} else {
		JpSetCookie('jppopup', "true", 3);
	}
}

