// JavaScript Document
var isIE6 = false, isIE7 = false,
 isFIREFOX2 = false, isFIREFOX = false,
 isNETSCAPE7 = false, isNETSCAPE = false,
 isOPERA9 = false, isOPERA = false,
 isUNKNOWN = false; 

var strChUserAgent = navigator.userAgent;
var intSplitStart = strChUserAgent.indexOf("(",0);
var intSplitEnd = strChUserAgent.indexOf(")",0);
var strChStart = strChUserAgent.substring(0,intSplitStart);
var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
var strChEnd = strChUserAgent.substring(strChEnd);

if(strChMid.indexOf("MSIE 7") != -1)
isIE7 = true;
else if(strChMid.indexOf("MSIE 6") != -1)
isIE6 = true;
else if(strChEnd.indexOf("Firefox/2") != -1)
isFIREFOX2 = true;
else if(strChEnd.indexOf("Firefox") != -1)
isFIREFOX = true;
else if(strChEnd.indexOf("Netscape/7") != -1)
isNETSCAPE7 = true;
else if(strChEnd.indexOf("Netscape") != -1)
isNETSCAPE = true;
else if(strChStart.indexOf("Opera/9") != -1)
isOPERA9 = true;
else if(strChStart.indexOf("Opera") != -1)
isOPERA = true;
else
isUNKNOWN = true;


Event.observe(window, 'load', function () {  

	c_name = "popupNL";
	c_start=document.cookie.indexOf(c_name + "=");
	
  	if (c_start==-1) //si cookie n’existe pas on affiche la popup
    	{ 
			$('shadow').style.width=screen.width+"px";
			$('shadow').style.height=(screen.height+600)+"px";
			//$('shadow').style.opacity = 0.6;
			//$('shadow').style.display = "block" ;
			$('encart_inscription').style.display = "block" ;
			$('encart_inscription').setOpacity(1);
			$('shadow').appear({from:0, to: 0.6 });
			//$('encart_inscription').appear({from:0, to: 1 });
			if (isIE6) {
			$('shadow').style.height = (parseInt(document.body.clientHeight) + 30) + "px";
			window.scrollTo(0,0)
		}

	}
});




function close_encart_inscription () 
{
	$('encart_inscription').style.display = "none";
	$('shadow').hide();
	var today = new Date(), expires = new Date();
    expires.setTime(today.getTime() + (15*24*60*60*1000));
	document.cookie = "popupNL=ok;expires="+expires.toGMTString();
}

function verifOverlay () 
{
	var today = new Date(), expires = new Date();
    expires.setTime(today.getTime() + (15*24*60*60*1000));
	document.cookie = "popupNL=ok;expires="+expires.toGMTString();
}
