﻿
function openAlertDialog() {
Dialog.alert({url: "info.html", options: {method: 'get'}}, 
            {className: "alphacube", width:540, okLabel: "OK"});
}

var timeout;
function openInfoDialog() {
Dialog.info("",
  {className: "alphacube",width:540,height:250, showProgress: false});
  timeout=10;
  setTimeout(infoTimeout, 1000)
}

function infoTimeout() {
  timeout--;
  if (timeout >0) {
  	Dialog.setInfoMessage("<span class='intro_message'>WERBUNG<br/><h2 class='intro_message' style='color:#17385B'><br />KINGDOMAIN.DE - WEBHOSTING</h2> <br /> </span><div style='text-align:left; margin:10px'><span style='font-size:18px; color:#F00;text-align:center;'><center>Webhosting schon ab 0,99 € mtl.! <br/><br /> <a style='font-size:26px;color:#F37D1F' href='http://www.kingdomain.de/' target='_blank' > ZUR WEBSEITE</a><br /><br/>( Öffnet in einem neuen Festner )</center></span><br style='clear:both'></div><br style='clear:both'/></div></div>Diese Nachricht schließt in " + timeout + " Sekunden ...")
    setTimeout(infoTimeout, 1000)
 }
 else
  Dialog.closeInfo()
}

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,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function checkCookie()
{
popup=getCookie('popup');
if (popup!=null && popup!="")
  {
openInfoDialog();//DIESES ZEILE LÖSCHEN FÜR 1x AM TAG
  }
  else 
  {
      setCookie('popup','popup',1);
      openInfoDialog();
  }
}

checkCookie();
