

function delay() {
  
  var cookieactive = 0;
  
  // get cookie
  // var greyboxExpire = GetCookie("greybox_expire");

  // get the time
  var thetime = new Date();
  thetime = thetime.getTime();
  
  // only view greybox if cookie
  //if(cookieactive == 1) {
  
    // if(thetime - greyboxExpire > 0) { 
      // window.setTimeout("MyFunction()",12500);  
    // } 
    
  // } else {
  
    window.setTimeout("MyFunction()",12500);  
  
  // }

}

function MyFunction() {
  var mytime = new Date();
  mytime = mytime.getTime() + 1000*60*60*24*    3    ; // Definierung des Zeitraums ohne Greybox: 3 Tage
  document.cookie = 'greybox_expire='+mytime+';'; 
  return GB_showCenter("Magic", "http://www.depasco.de/Zauberer-Anfrage-Bubble.html", 160, 235);
}


function GB_closeCurrentOpenNew(title,url,y,x) {
  GB_hide();self.GB_showCenter(url,url,y,x);
}




function getCookieVal (offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
        endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}


function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
        return getCookieVal (j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }
    return null;
}
