function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function setCookie(c_name,expiredays)
{
var exdate=new Date();
var rand_no= Math.random()
var currentTime = new Date();
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var seconds = currentTime.getSeconds();
var milliseconds = currentTime.getMilliseconds();
rand_no = rand_no * 1000;
rand_no = Math.ceil(rand_no);

var valueID = rand_no.toString() + month + day + year + hours + minutes + seconds + milliseconds;
OIID = valueID;

exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(valueID)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+";path=/";
}

function checkCookie(c_name)
{
var username=getCookie(c_name);
if (username!=null && username!="")
  {
   OIID = username;
   HRBZK = "J"; 

  //alert(username+'! '+document.referrer.replace(/&/g,"-") + " "+PageOI+" " +SectionOI+" "+LngOI );
  }
else
  {
	setCookie('idoistat',365);
	HRBZK = "N"; 
  }
}

var OIID;
var HRBZK;
var fullURL = parent.document.URL;
if (PageOI==null || PageOI==""){PageOI = fullURL.substring(fullURL.lastIndexOf("/")+1); fullURL = fullURL.substring(0,fullURL.lastIndexOf("/"));}
if (SectionOI==null || SectionOI==""){SectionOI = fullURL.substring(fullURL.lastIndexOf("/")+1); fullURL = fullURL.substring(0,fullURL.lastIndexOf("/"));}
if (LngOI==null || LngOI==""){LngOI = fullURL.substring(fullURL.lastIndexOf("/")+1);}

if (PageOI==null || PageOI==""){PageOI = document.title;}
if (PageOI==null || PageOI==""){PageOI = '-';}

if (SectionOI==null || SectionOI==""){SectionOI = '-';}
if (LngOI==null || LngOI==""){LngOI = '-';}


checkCookie('idoistat');

document.write(unescape("%3Cimg src='http://www.online-impact.eu/nl/website_statistieken_website/TrackV01.asp?cstmr="+ Cmstr +"&DmnOI=" + DmnOI + "&pgn=" + PageOI + "&lng=" + LngOI + "&sctn=" + SectionOI + "&oiid=" + OIID + "&zkpgn=" + ZkpPageOI + "&qref=" + document.referrer.replace(/&/g,"-") + "&hrbzk="+ HRBZK + "' width='1px' hight='1px' %3E"))

