var splashpage={
  
  /**************************
   * START OF CONFIGURATION *
   **************************/

  // background overlay opacity
  opacity: 90,
  
  // short site url
  site: 'hermandecroo.be',
  
  // logo : should have 55px height
  logo: basepath+pathtotheme+'Images/Mainpage/volksfestijn.jpg',
  
  // font color
  fontcolor: '#ffffff',
  
  // shade color
  shadecolor: '#000',
  
  // ad width
  adwidth: 620,
  
  // ad height
  adheight: 380,

  // enable frequency control? (1=yes, 0=no)
  enablefrequency: 1,

  // display freqency: "sessiononly" or "x days" (string value).
  displayfrequency: "sessiononly",

  // cookie setting: ["cookie_name", "cookie_path"]
  cookiename: ["splashpagecookie", "path=/"],

  // auto hide after x seconds (Integer value, 0=no)?
  autohidetimer: 30,
  
  /************************
   * END OF CONFIGURATION *
   ************************/
   
  // Please don't alter any code below this line.

  launch:false,
  
  intro:function() {

	if (typeof(ord) == 'undefined' ) {
		ord = Math.random()*10000000000000000;
	}
	    
    // background overlay
    //document.write('<div id="splashshade" onclick="splashpage.closeit(); return false" style="position:absolute; top:0; left:0; width:100%; height:3000px; z-index:1000; background-color:'+splashpage.shadecolor+'; -moz-opacity: 0.'+splashpage.opacity+'; opacity:.'+splashpage.opacity+'; filter: alpha(opacity='+splashpage.opacity+');">')
	//document.write('</div>')
    
    document.write('<div id="splashshade" onclick="splashpage.closeit(); return false" style="z-index:10000000;position:absolute; top:0; left:0; width:100%; height:3000px; background-color:#000000; -moz-opacity: 0.85; opacity:.85; filter: alpha(opacity=85);">');
	document.write('<div style="padding: 26px; center center repeat-x;">');
			
	document.write('<\/div>');
	document.write('<\/div>');
	
    // start content area
		document.write('<div id="splashpage" style="position: absolute; z-index: 10001; color: white; top:50%;left:50%; width:'+splashpage.adwidth+'px; height:'+(splashpage.adheight + 76)+'px; text-align:left; margin-top: -'+Math.round(splashpage.adwidth / 2)+'px; margin-right: 0; margin-bottom: 0; margin-left: -'+Math.round(splashpage.adheight / 2 + 38)+'px;">')
  
  	// header with logo and link
  	document.write('<div id="splashpage-header" style="position: relative; height: 50px; margin-bottom: 20px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: '+splashpage.fontcolor+';">')
			document.write('<a href="#" style="position: absolute; bottom: 0; left: 0;" onclick="splashpage.closeit(); return false"><img border="0" src="'+splashpage.logo+'" /></a>')
			document.write('<span style="position: absolute; bottom: 10px; right: 0;"><a href="#" onclick="splashpage.closeit(); return false" style="color: #fff;">Ga verder naar '+splashpage.site+'.</a></span>')
		document.write('</div>')
    
    document.write('<div id="splashtag">'); 
	document.write('<script src="http://ad.be.doubleclick.net/adj/4064.jim/splash;tile=5;sz=640x480;ord=' + ord + '?" type="text/javascript"><\/script>');	
	document.write('<\/div>');
	document.write('<\/div>');
  },
  
  outro:function(){
    
    // stop content area
    document.write('</div>') 
     
  },

  setup:function(){
    
    this.splashpageref = document.getElementById("splashpage")
    this.splashshaderef = document.getElementById("splashshade")

    this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
    if (!/safari/i.test(navigator.userAgent)) //if not Safari, disable document scrollbars
    this.standardbody.style.overflow="hidden"
    this.moveuptimer=setInterval("window.scrollTo(0,0)", 50)
    if (parseInt(this.autohidetimer)>0)
    setTimeout("splashpage.closeit()", parseInt(this.autohidetimer)*1000)
  },

  closeit:function(){
    clearInterval(this.moveuptimer);
    this.splashpageref = document.getElementById("splashpage");
    this.splashshaderef = document.getElementById("splashshade");
	
	this.splashpageref.style.display = "none";
	this.standardbody.style.overflow="auto";
	this.splashshaderef.style.display="none";
		
	this.splashpageref.style.visibility="hidden";
	this.splashshaderef.style.visibility="hidden";
  },

  init:function(){
    
    // png fix
    if (!window.XMLHttpRequest) {
      this.pngfix()
    }
    
    
    
    	// init
    	if (this.enablefrequency==1){ //if frequency control turned on
    	  if (/sessiononly/i.test(this.displayfrequency)){ //if session only control
    	    if (this.getCookie(this.cookiename[0]+"_s")==null){ //if session cookie is empty
    	      this.setCookie(this.cookiename[0]+"_s", "loaded")
    	      this.launch=true
    	    }
    	  }
    	  else if (/day/i.test(this.displayfrequency)){ //if persistence control in days
    	    if (this.getCookie(this.cookiename[0])==null || parseInt(this.getCookie(this.cookiename[0]))!=parseInt(this.displayfrequency)){ //if persistent cookie is empty or admin has changed number of days to persist from that of the stored value (meaning, reset it)
    	      this.setCookie(this.cookiename[0], parseInt(this.displayfrequency), parseInt(this.displayfrequency))
    	      this.launch=true
    	    } 
    	  }
    	}
    	else //else if enablefrequency is off
    	{ 
    	  this.launch=true 
    	}
    
    
    
    
    
    
  },
  
  pngfix:function(){
    dotpos = this.logo.lastIndexOf(".")
    ext = this.logo.substring(dotpos + 1, this.logo.length);
    if(ext.toLowerCase() == "png") {
      this.logo = this.logo.substring(0,dotpos)+".gif";
    }
  },

  getCookie:function(Name){
    var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
    if (document.cookie.match(re)) //if cookie found
    return document.cookie.match(re)[0].split("=")[1] //return its value
    return null
  },

  setCookie:function(name, value, days){
    var expireDate = new Date()
    //set "expstring" to either an explicit date (past or future)
    if (typeof days!="undefined"){ //if set persistent cookie
      var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days))
      document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; "+splashpage.cookiename[1] //last portion sets cookie path
    }
    else //else if this is a session only cookie setting
    document.cookie = name+"="+value+"; "+splashpage.cookiename[1] //last portion sets cookie path
  }

}
