var HH_SiteWidth = 920;
var HH_BannerWidth = 618;
var HH_BannerHeight = 349;
if(navigator.appName == 'Netscape') var HH_BannerY = 150;
else var HH_BannerY = 150;
if(navigator.appName == 'Netscape') var HH_BannerX = 100;
else var HH_BannerX = 100;


function HH_Get_Cookie(name) {
	var start = document.cookie.indexOf(name+"=");
	var len = start+name.length+1;
	if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
	if (start == -1) return null;
	var end = document.cookie.indexOf(";",len);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len,end));
}


function HH_Set_Cookie(n,v,t){
	document.cookie = n + '=' + v + '; path=/; expires=Thu, 01 Jan 2500 00:00:01 GMT;'
	//document.cookie = n + '=' + v + '; path=/; expires='+t.toGMTString()+';'
};

function HH_Set_Cookie_(name,value,expires,path,domain,secure) {
	document.cookie = name + "=" +escape(value) +
		( (path) ? "; path=" + path : "") + 
		( (expires) ? "; expires="+expires.toGMTString() : "") +
		( (domain) ? "; domain=" + domain : "") +
		( (secure) ? "; secure" : "");
}

function HH_Delete_Cookie(n,v) {
	if (HH_Get_Cookie(n)) 
		document.cookie = n + '=' + v + '; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;'
}

var HH_MainUrl = 'mainpage.html';
var HH_Days = 100000; // valid two weeks from now

function HH_IsCookieEnabled() {
   if (document.all) return navigator.cookieEnabled;
   var HH_Today=new Date()
   HH_Today.setTime(HH_Today.getTime()+3600000);
   HH_Set_Cookie('HH_Testcookie',1,HH_Today);
   var HH_Tc = HH_Get_Cookie('HH_Testcookie');
   HH_Delete_Cookie('HH_Testcookie',1);
   return (HH_Tc);
}

function HH_ShowBanner(id) {
	if (!HH_BeenHere && HH_IsCookieEnabled()) {	
		HH_WriteBanner(id);
		//HH_RePosBanner();
		document.getElementById('HH_BannerLayer').style.display = 'block';
		HH_Set_Cookie('HH_BeenHere',1,HH_Expires_date,'/',document.domain);
	}
}

function HH_HideBanner(n) {
	if(n) HH_Delete_Cookie('HH_BeenHere',1);
	document.getElementById('HH_BannerLayer').style.display = 'none';
}

function HH_RePosBanner() {
	if(document.getElementById('HH_BannerLayer')) {
		if(navigator.appName == "Netscape"){
			HH_windowWidth = window.innerWidth;
		}else if(navigator.appName == "Microsoft Internet Explorer"){
			HH_windowWidth = document.documentElement.clientWidth;
		}else{
			HH_windowWidth = window.innerWidth;
		}
		
		HH_Offset = (HH_windowWidth-HH_SiteWidth)/2;
		HH_SiteOffset = (HH_SiteWidth-HH_BannerWidth)/2;
		obj = document.getElementById('HH_BannerLayer');
		obj.style.left = HH_Offset + HH_BannerX+'px';
		
	}
}

function HH_WriteBanner(id) {
	//var HH_Div=document.createElement("DIV");
	var HH_Div= $('hh_banner'); //document.createElement("DIV");
	HH_Div.setAttribute('id','HH_BannerLayer');
	HH_Div.style.position = 'absolute';
	HH_Div.style.left = HH_BannerX+'px';
	HH_Div.style.top = HH_BannerY+'px';
	HH_Div.style.display = 'block';
	HH_Div.style.zIndex = 1000000;
	//document.body.appendChild(HH_Div);
	
	var flashHtml = '';
	//flashHtml = $('hh_banner').innerHTML;//'<img src="/np_banner/rabosport.gif" width="'+HH_BannerWidth+'" height="'+HH_BannerHeight+'" border="0" alt="" usemap="#HH_Banner_Map"><map name="HH_Banner_Map"><area shape="rect" coords="170,342,260,363" href="http://www.ruigroknetpanel.nl/bestandenmap/ICCESOMAR_CODE_NL.pdf" target="_blank" alt="" /><area shape="rect" coords="122,294,197,328" href="javascript:HH_HideBanner();" alt="" /><area shape="rect" coords="24,295,100,328" href="javascript:HH_PopUp(\'np_banner/checker_'+id+'.html\', 270, 155);" alt="" /></map>';
	
	HH_RePosBanner();
		
	//document.getElementById('HH_BannerLayer').innerHTML = flashHtml;
}

function HH_PopUp(source, width, height) {
	xl = 0 //(screen.availWidth/2)-(width/2)
	tt = 0 //(screen.availHeight/2)-(height/2)
	picture=window.open(source,'showSearch','toolbar=no,scrolling=auto,resizable=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,width='+width+',height='+height+',left='+xl+',top='+tt);
	picture.focus();
	HH_HideBanner();
}


var HH_Today = new Date();
var HH_Zero_date = new Date(0,0,0);
HH_Today.setTime(HH_Today.getTime() - HH_Zero_date.getTime());

var HH_Todays_date = new Date(HH_Today.getYear(),HH_Today.getMonth(),HH_Today.getDate(),0,0,0);
//var HH_Expires_date = new Date(HH_Todays_date.getTime() + (HH_Days * 86400000));
var HH_Expires_date=new Date()
HH_Expires_date.setTime(HH_Expires_date.getTime()+3600000);
var HH_BeenHere = HH_Get_Cookie('HH_BeenHere');

