/********** DEBUT Redirection en fonction de la résolution *********/

function InitRedir() {
	// Indiquer ici la durée
	document.forms[0].elements[0].value=5;
	redir();
}
function redir() {
	if(document.forms[0].elements[0].value<0) {
		document.forms[0].elements[0].value=0;
	} else {
		document.forms[0].elements[0].value=document.forms[0].elements[0].value-1;
		if (document.forms[0].elements[0].value==0) 
			{	
				if (screen.width<=800) {window.location="accueil.php?r=800";}
				if (screen.width==1024) {window.location="accueil.php?r=1024";}			
				if (screen.width==1152) {window.location="accueil.php?r=1024";}			
				if (screen.width>1152) {window.location="accueil.php?r=1024p";}			
			}
		else setTimeout("redir()",1000);
	}
}

function redirection() {
	document.forms[0].elements[0].value=0;
	if (screen.width<800) {window.location="accueil.php?r=800";}
	if (screen.width==800) {window.location="accueil.php?r=800";}
	if (screen.width==1024) {window.location="accueil.php?r=1024";}			
	if (screen.width==1152) {window.location="accueil.php?r=1024";}			
	if (screen.width>1152) {window.location="accueil.php?r=1024p";}
}

/********** FIN Redirection en fonction de la résolution *********/

/********** DEBUT SCRIPT qui indique le nombre de visites du visiteur **********/

visitnd=1;
cook = document.cookie;
var VisitName;

function detectCookie() {

	plac2 = cook.indexOf("nbvisit=",0);
	if (plac2 <= -1) {
		visitnd = 1;
	} else {
		end2 = cook.indexOf(";",plac2)
		if (end2 <= -1) {
			visitnd = cook.substring(plac2+8,cook.length);
		} else {
			visitnd = cook.substring(plac2+8,end2);
		}
		visitnd ++;
	}
	CreateCookie();
}

dateExp = new Date(2020,11,11);
dateExp = dateExp.toGMTString();

function CreateCookie() {
	//document.cookie = 'visitor=' + VisitName + '; expires=' + dateExp + ';';
	document.cookie = 'nbvisit=' + visitnd + '; expires=' + dateExp + ';';
}

/********** FIN SCRIPT qui indique le nombre de visites du visiteur **********/
