function popunder2()
{
//	alert("ok "+window.location);
		win2=window.open("/via/siteunder/index.asp","Magazine_gratuit","top=0,left=0,resizable=yes, status=no, directories=no, addressbar=no, toolbar=no, scrollbars=yes, menubar=no, location=no, statusbar=no,width=1000,height=600");
		win2.blur();
		window.focus();
}

function popunder()
{
//	alert("ok "+window.location);

	cookieActive    = GetActiveCookie();
	cookieDesactive    = GetDesactiveCookie();
	if(cookieActive || cookieDesactive) 
	{
//			alert("cookie said present");
	}
	else
	{	
//		alert("cookie said non present");
		
		date=new Date;
  		date.setHours(date.getHours()+24);
		
		lecookie=getCookie("siteunder");
//		alert("lecookie="+lecookie);

		if(lecookie!=null)
		{
//		alert("lecookie="+lecookie);	
//			alert("cookie fr present");
		}
		else
		{
//			alert("cookie fr non present");
			ecrire_cookie("siteunder",0,date);
		
		win2=window.open("/via/siteunder/index.asp","Magazine_gratuit","top=0,left=0,resizable=yes, status=no, directories=no, addressbar=no, toolbar=no, scrollbars=yes, menubar=no, location=no, statusbar=no,width=1000,height=600")
		win2.blur()
		window.focus()
		}
	}
}

function ecrire_cookie(nom, valeur, expires) {
  document.cookie=nom+"="+escape(valeur)+
  ((expires==null) ? "" : ("; expires="+expires.toGMTString()));
}

function arguments_cookie(offset){
  var endstr=document.cookie.indexOf (";", offset);
  if (endstr==-1) endstr=document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr)); 
}

function lire_cookie(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 arguments_cookies(j);
    i=document.cookie.indexOf(" ",i)+1;
    if (i==0) break;
  }
  return null; 
}

function getCookie(sName) {
        var oRegex = new RegExp("(?:; )?" + sName + "=([^;]*);?");
 
        if (oRegex.test(document.cookie)) {
                return decodeURIComponent(RegExp["$1"]);
        } else {
                return null;
        }
}

function verfi_cookie()
{
/*	lecookie=getCookie(txt);
	if(lecookie!=null)
		{
//		alert("lecookie="+lecookie);	


		}
		else
		{
			alert("cookie fr present");
		}
		*/
//		lecookie=getCookie("siteunder");
//		alert("lecookie="+lecookie);
alert("cookie fr present");
}

