var x0=2;

var x1=false;

var x2=420; // width;

var x3=300; // height;

var x4=null;

var x5='cmsn'; // cookieid;



function getws(x){

  if(x==0){ // lw;

    var ww=0;

    if(typeof window.innerWidth=='number'){

      var ww=window.innerWidth;

      if(window.scrollMaxY>0){

        ww-=17;

      }

    }else if(document.documentElement.clientWidth){

      ww=document.documentElement.clientWidth;

    }else if(document.body && document.body.clientWidth){

      ww=document.body.clientWidth;

    }

    var wl=0;

    if(navigator.appName.indexOf('Netscape')!=-1){

      wl=window.pageXOffset;

    }else if(document.documentElement && document.documentElement.scrollTop){

      wl=document.documentElement.scrollLeft;

    }else if(document.body?document.body:false){

      wl=document.body.scrollLeft;

    }

    wl=typeof wl=='number'?wl:0;

    return wl+ww;

  }else{ // th;

    var wh=0;

    if(typeof window.innerHeight=='number'){

      wh=window.innerHeight;

      if(window.scrollMaxX>0){

        wh-=17;

      }

    }else if(document.documentElement.clientHeight){

      wh=document.documentElement.clientHeight;

    }else if(typeof document.body.clientHeight=='number'){

      wh=document.body.clientHeight;

    }

    var wt=0;

    if(window.innerHeight){

      wt=window.pageYOffset;

    }else if(document.documentElement && document.documentElement.scrollTop){

      wt=document.documentElement.scrollTop;

    }else if(document.body?document.body:false){

      wt=document.body.scrollTop;

    }

    wt=typeof wt=='number'?wt:0;

    return wt+wh;

  }

}



function floating(){

  document.getElementById('div1').style.top=((getws(1))-x3)+'px';

  document.getElementById('div1').style.left=((getws(0))-(x2+15))+'px';

  x4=setTimeout('floating()',30);

}



function moving(d){

  var tmp=parseInt(document.getElementById('div2').style.top);

  if(d==1){

    if(tmp>0){

      tmp=tmp-x0;

      if(tmp<0){

        tmp=0;

      }

      document.getElementById('div2').style.top=tmp+'px';

      if(tmp==0){

      }else{

        setTimeout('moving('+d+')',30);

      }

    }

  }

  if(d==2){

    if(tmp<2000){

      tmp=tmp+x0;

      if(tmp>2000){

        tmp=2000;

      }

      document.getElementById('div2').style.top=tmp+'px';

      if(tmp!=2000){

        setTimeout('moving('+d+')',30);

      }

    }

  }

}



function gotourl(res,url){

  var tmp=new Date();

  tmp.setHours(tmp.getHours()+1);

  document.cookie=x5+'=1; expires='+tmp.toGMTString()+'; path=/';

  if(x1==false){

    if(url!=''){

      if(res=='0'){

        var tmp=window.open();

        if(!tmp){

          tmp=top;

        }

        tmp.location.href=url;

      }else{

top.location.href=url;

      }

    }

  }

  document.getElementById('div1').style.display='none';

  x1=true;

  clearTimeout(x4);

}



function runonce(){

  var tmp1=false;

  var ca=document.cookie.split(';');

  for(var i=0;i<ca.length;i++){
	
    var c=ca[i];

    while(c.charAt(0)==' '){

      c=c.substring(1,c.length);
	
    }

    if(c.indexOf(x5+'=')==0){

      tmp1=c.substring(x5+'='.length,c.length);

    }
	
  }

if(!tmp1){

    floating();

    moving(1);

}

}



function loaded(x){

  if(typeof window.onload!='function'){

    window.onload=x;

  }else{

    var tmp=window.onload;

    window.onload=function(){

      tmp();

      x();

    }

  }

}

function HidePopup()
	{
	var div1 = document.getElementById("div1");
	div1.className = "hide";
	
	var tmp=new Date();
	
	tmp.setHours(tmp.getHours()+1);
	
	document.cookie=x5+'=1; expires='+tmp.toGMTString()+'; path=/';
	}


document.write('<style type=\"text/css\">');

document.write('#div1,#div2{margin:0;padding:0;width:'+x2+'px;height:'+x3+'px; text-align: left;}*');

document.write('#div1{position:absolute;right:0px;bottom:0;overflow:hidden;z-index:5;}*');

document.write('#div2{position:relative;}');

document.write('#div3{cursor:pointer;}');

document.write('</style>');

document.write('<div id="div1"><div id="div2" style="top:'+x3+'px">');

document.write('<div style="background-image:url(\'http://www.gratissexadvertenties.com/banners_partners/bg_popupsexdating.gif\');width:420px;height:302px;background-repeat:no-repeat;"><div style="text-align: right; padding: 4px 6px 0 0;"><a href="javascript:;" onclick="HidePopup();"><img src="http://www.gratissexadvertenties.com/banners_partners/close.gif" alt="Close"></a></div>');

document.write('<div id="div3" onclick="gotourl(\'0\',\'http://www.snellesexdating.nl/s.asp?uid=&referer=gsapopup&p=1298&rndid=19\')"><img src="http://www.gratissexadvertenties.com/banners_partners/img_popupsexdating.jpg" border="0" width="200" height="150" style="margin-left:18px;margin-top:38px">');

document.write('<div style="margin-top:14px;margin-left:20px;height:86px;width:220px;overflow:hidden;"><font face="Verdana" size="2" color="#444444" style="font-size:10pt;"><b>Chantal</b><br>Geile vrouwen zoeken mannen voor een spannende sexdate. Klik hier</font></div>');

document.write('</div></div>');

document.write('</div></div>');



loaded(function(){setTimeout('runonce()',100);});

