var dcookie = document.cookie ;
var cookie_str = dcookie.toString();

if(!dcookie) {
	createCookie('init','1',1,true);	
}
function getCookieVal(offset)
{
  var endstr=document.cookie.indexOf (";", offset);
  if (endstr==-1) endstr=document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}
function LireCookie(nom)
{
  var arg=nom+"=";
  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;
}

function createCookie(name,value,days,timespan)
{
	defaultTime = days*24*60*60*1000 ;
	if (timespan)
	{
		defaultTime = 24*60*60*1000 ; 
	}
	if (days)
	{	var date = new Date();
		date.setTime(date.getTime()+(defaultTime));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


var splash_active = /splash_active=([0-9])/i ;
var matches_splash = cookie_str.match(splash_active) ;
var path_splash = document.URL;
if(splash_activation == 1) {
	if(LireCookie('splash_active')==null) {
		createCookie('splash_active',path_splash,1,true);
		if(LireCookie('splash_active')==null) {
		}
		else {
		document.location.href = '/splash.php' ;
		}
	}
}
