//Splash Page script- http://www.dynamicdrive.com/
//Created: August 17th, 2007'

var nombre = Math.floor(Math.random()*2)+1;

var varBlocFR = '<div style="width:450px; float:left; background:#999999 url(Images/splash/fond_splash_g.jpg) no-repeat bottom;">';
varBlocFR+= '<p align="center"><img src="Images/splash/logo_webdeco_splash_petit.jpg" width="150" height="48" alt="webdeco.be" /></p>';
varBlocFR+= '<p style="padding:0 20px">Bienvenue sur Webdeco.be, le portail de r&eacute;f&eacute;rence de la D&eacute;coration Belge.<br />';
varBlocFR+= '<br />Vous aimez plut&ocirc;t le style...</p>';
varBlocFR+= '<div align="center"><table width="380" border="0" align="center" cellpadding="0" cellspacing="0">';
varBlocFR+= '<tr>';
varBlocFR+= '<td height="30" align="center" valign="middle"><p><a href="/classic-fr.htm" style="color:#6269b1; text-decoration:none;">CLASSIC</a></p></td>';
varBlocFR+= '<td align="center" valign="middle">&nbsp;</td>';
varBlocFR+= '<td align="center" valign="middle"><a href="/design-fr.htm" style="color:#686878; text-decoration:none;">DESIGN</a></td>';
varBlocFR+= '</tr>';
varBlocFR+= '<tr>';
varBlocFR+= '<td align="center" valign="middle"><a href="/getlinksplash.asp?id=1"><img src="/getimgsplash.asp?id=1" width="135" height="180" border="0" /></a></td>';
varBlocFR+= '<td align="center" valign="middle">OU</td>';
varBlocFR+= '<td align="center" valign="middle"><a href="/getlinksplash.asp?id=2"><img src="/getimgsplash.asp?id=2" width="135" height="180" border="0" /></a></td>';
varBlocFR+= '</tr>';
varBlocFR+= '</table></div>';
varBlocFR+= '<br /><br />';
varBlocFR+= '</div>';
varBlocFR+= '<div style="margin:5px 0 0 0;">';
varBlocFR+= '<p style="font-size:10px"><a href="/pros-fr.htm" style="text-decoration:none; color:#fff">Professionnel de la déco et intéressé par la version <span style="color:#f00; ">B2B</span> de Webdeco.be? Cliquez ici!</a></p>';
varBlocFR+= '</div>';

var varBlocNL = '<div style="width:450px; float:left; background:#999999 url(Images/splash/fond_splash_g.jpg) no-repeat bottom;">';
varBlocNL+= '<p align="center"><img src="Images/splash/logo_webdeco_splash_petit.jpg" width="150" height="48" alt="webdeco.be" /></p>';
varBlocNL+= '<p style="padding:0 20px">Welkom op Webdeco.be, de referentie-portaal voor de Belgische Decoratie.<br />';
varBlocNL+= '<br />Een liefhebber van... </p>';
varBlocNL+= '<div align="center"><table width="380" border="0" align="center" cellpadding="0" cellspacing="0">';
varBlocNL+= '<tr>';
varBlocNL+= '<td height="30" align="center" valign="middle"><p><a href="/classic-nl.htm" style="color:#6269b1; text-decoration:none;">CLASSIC</a></p></td>';
varBlocNL+= '<td align="center" valign="middle">&nbsp;</td>';
varBlocNL+= '<td align="center" valign="middle"><a href="/design-nl.htm" style="color:#686878; text-decoration:none;">DESIGN</a></td>';
varBlocNL+= '</tr>';
varBlocNL+= '<tr>';
varBlocNL+= '<td align="center" valign="middle"><a href="/getlinksplash.asp?id=3"><img src="/getimgsplash.asp?id=3" width="135" height="180" border="0" /></a></td>';
varBlocNL+= '<td align="center" valign="middle">OF</td>';
varBlocNL+= '<td align="center" valign="middle"><a href="/getlinksplash.asp?id=4"><img src="/getimgsplash.asp?id=4" width="135" height="180" border="0" /></a></td>';
varBlocNL+= '</tr>';
varBlocNL+= '</table></div>';
varBlocNL+= '<br /><br />';
varBlocNL+= '</div>';
varBlocNL+= '<div style="margin:5px 0 0 0;">';
varBlocNL+= '<p style="font-size:10px"><a href="/pros-nl.htm" style="text-decoration:none; color:#fff">Bent u professioneel bezig met decoratie en geinteresseerd in onze <span style="color:#f00; ">B2B</span> versie? Klik hier</a></p>';
varBlocNL+= '</div>';

var splashTML = '<div style="background: url(images/splash/pix.png) repeat; width:100%; height:100%; position: absolute; top: 0; left:0; padding: 5px; color: white; font: bold 16px Verdana;">';
splashTML+= '<div style="position: absolute; left:'+((screen.availWidth/2)-500)+'px; top:'+((screen.availHeight/2)-360)+'px; width:1000px;text-align:center; font-family:Verdana, Geneva, sans-serif; font-size:12px; float:left">';

splashTML+= '<div style=" margin:20px 20px 20px 20px; width:450px; float:left;">';

if (nombre==1){
	splashTML+= varBlocFR;
}else{
	splashTML+= varBlocNL;
}

splashTML+= '</div>'; 

splashTML+= '<div style=" margin:150px 20px 20px 20px; width:450px; float:left;">';

if (nombre==1){
	splashTML+= varBlocNL;
}else{
	splashTML+= varBlocFR;
}

splashTML+= '</div>';

splashTML+= '<div style="clear:left"></div>';
splashTML+= '<div style=" text-align:right; margin:80px 30px 20px 10px; float:left"><a href="javascript:splashpage.closeit()" style="text-decoration:underline; color:#FFF">Fermer</a></div>';
splashTML+= '</div>';
splashTML+= '</div>';


var splashpage={
// Splash Page Script Activation (1=enabled, 0=completely disabled!)
splashenabled: 1,

//1) URL to file on your server to display as the splashpage
splashpageurl: "http://www.webdeco.be/classic-fr.htm",

//2) Enable frequency control? (1=yes, 0=no)
enablefrequency: 1,

//3) display freqency: "sessiononly" or "x days" (string value). Only applicable if 3) above is enabled
displayfrequency: "5 days",

//4) HTML for the header bar portion of the Splash Page
// Make sure to create a link that calls "javascript:splashpage.closeit()")
// An IE bug means you should not right align any image within the bar, but instead use "position:absolute" and the "right" attribute

defineheader: splashTML,

//5) cookie setting: ["cookie_name", "cookie_path"]
cookiename: ["splashpagecookie", "path=/"],

//6) Auto hide Splash Page after x seconds (Integer value, 0=no)?
autohidetimer: 30,

////No need to edit beyond here//////////////////////////////////

launch:false,
browserdetectstr: (window.opera&&window.getSelection) || (!window.opera && window.XMLHttpRequest), //current browser detect string to limit the script to be run in (Opera9 and other "modern" browsers)

output:function(){
	document.write('<div id="slashpage" style="position: absolute; z-index: 100000; color: white; background-color:#f00">') //Main splashpage container
	document.write(this.defineheader) //header portion of splashpage
	document.write('<iframe name="splashpage-iframe" src="about:blank" style="margin:0; padding:0; width:100%; height: 100%"></iframe>') //iframe
	document.write('<br />&nbsp;</div>')
	this.splashpageref=document.getElementById("slashpage")
	this.splashiframeref=window.frames["splashpage-iframe"]
	this.splashiframeref.location.replace(this.splashpageurl) //Load desired URL into splashpage iframe
	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.splashpageref.style.left=0
	this.splashpageref.style.top=0
	this.splashpageref.style.width="100%"
	this.splashpageref.style.height="100%"
	this.moveuptimer=setInterval("window.scrollTo(0,0)", 50)
},

closeit:function(){
	clearInterval(this.moveuptimer)
	this.splashpageref.style.display="none"
	this.splashiframeref.location.replace("about:blank")
	this.standardbody.style.overflow="auto"
},

init:function(){
	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
	if (this.launch){
		this.output()
		if (parseInt(this.autohidetimer)>0)
			setTimeout("splashpage.closeit()", parseInt(this.autohidetimer)*1000)
	}
},

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
}

}

if (splashpage.browserdetectstr && splashpage.splashenabled==1)
	splashpage.init()
