$(document).ready( function() {
	DD_roundies.addRule('#middle', '10px', true);
	DD_roundies.addRule('#menu', '5px', true);
});

var expDays = 1; 

function marqueestart()
{
	document.write('<marquee direction="right" scrollamount="3" onmouseover="this.scrollAmount=0" onmouseout="this.scrollAmount=3">');
}

function marqueeend()
{
	document.write('</marquee>');
}

function visibilite(thingId)
{
 var i;
 var targetElement;
 targetElement = document.getElementById("divid" + thingId) ;
 if ( targetElement.style.display == "none")
     targetElement.style.display = "" ;
 else
     targetElement.style.display = "none" ;
}


function Searchit (requete)
{
	window.location.href='/search/'+this.requete.value.replace(' ','-')+'.html'; 
	return false;
}

function goto(id)
{
	(new Image()).src="/goto.php?id="+id;
	return true;
}
	
function ScanCookie(variable)
   {
    cook = document.cookie;
    variable += "=";
    place = cook.indexOf(variable,0);
    if (place <= -1)
        return("0" );
    else
       {
        end = cook.indexOf(";",place)
        if (end <= -1) return(unescape(cook.substring(place+variable.length,cook.length)));
        else return(unescape(cook.substring(place+variable.length,end)));
       }
   }
function CreationCookie(nom,valeur,permanent)
   {
    if(permanent)
       {
        dateExp = new Date(2020,11,11);
        dateExp = dateExp.toGMTString();
            ifpermanent = '; expires=' + dateExp + ';';
       }
    else
        ifpermanent = '';
    document.cookie = nom + '=' + escape(valeur) + ifpermanent;
   }
if(ScanCookie("dejapopup" )==0)
   {
    // var msg="ATTENTION : SITE PORNOGRAPHIQUE RESERVE AUX MAJEURS DE PLUS DE 18 ANS\n\nCe site Internet est réservé à un public majeur et averti et est conforme à toutes les réglementations en vigueur. Il contient des textes, des photos et des vidéos classées X qui peuvent être choquantes pour certaines sensibilités.\n\nCLIQUEZ SUR OK POUR CONTINUER,ANNULER POUR QUITTER..\n\n"
    // if(confirm(msg))
        // CreationCookie("dejapopup","oui",false)
    // else
        // window.location.replace('http://www.google.fr');
  }
 
function GetCookie (name) {  
	var arg = name + "=";  
	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 SetCookie (name, value) {  

	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false; 
 
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
	}

function DeleteCookie (name) {  
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);  
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
	}

var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function amt(){
	var count = GetCookie('count')
	if(count == null) {
		SetCookie('count','1')
		return 1
		}
	else {
		var newcount = parseInt(count) + 1;
		DeleteCookie('count')
		SetCookie('count',newcount,exp)
		return count
		}
	}

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
	}

function bookmarksite(title, url){
	if (document.all)
	window.external.AddFavorite(url, title);
	else if (window.sidebar)
	window.sidebar.addPanel(title, url, "")
}

function checkCount() {
	var count = GetCookie('count');
	if (count == null) {
		count=1;
		SetCookie('count', count, exp);
		
		var mwidth=screen.availHeight;
		var mheight=screen.availWidth;
		
		if (window.showModelessDialog) //si c est ie5 ou compatible IE5
		{

		window.showModelessDialog('http://www.eurolive.com/?id=48781&langue=fr&e=0&tracker=asexeunder&w=0&buying=1','',"help:0;resizable:1;dialogHeight: 400px; dialogWidth: 700px; edge:1 ; scrollbars:1 ; status:1 ; maximize:yes ; minimize:yes ; menubar:1 ")
		//window.showModelessDialog('http://www.allopass.com/check/red.php4?CA=X295713Z28U6B7','',"help:0;resizable:1;dialogHeight: 400px; dialogWidth: 700px; edge:1 ; scrollbars:1 ; status:1 ; maximize:yes ; minimize:yes ; menubar:1 ")
		
		// window.focus()
     	 window.focus();
		
        }
    else
        {
		var mheight=screen.Height;
		var mwidth=screen.Width;
		popunder = window.open('http://www.eurolive.com/?id=48781&langue=fr&e=0&tracker=asexeunder&w=0&buying=1','_blank','center=yes,toolbar=1,location=1,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,menuBar=1,width='+mwidth+',height='+mheight+'')
		//popunder = window.open('http://www.allopass.com/check/red.php4?CA=X295713Z28U6B7','_blank','center=yes,toolbar=1,location=1,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,menuBar=1,width='+mwidth+',height='+mheight+'')

     popunder.blur()
     window.focus(); //suprimer cette ligne pour faire un popup, suprimer uniqument le comentaire pour garder une popunder
		}
	 
		}
	else {
		count++;
		SetCookie('count', count, exp);
		}
	}
	
	document.onclick = checkCount;

