function checkCookie(nomFichier) {

var cookie_ville = readCookie(nomFichier);

if (cookie_ville != "0" && cookie_ville != "") {
	// déjà visité page province
if (location.href.indexOf("global")==-1) {
	window.location.href = unescape(cookie_ville);
}
else { 
var expiryDate=new Date(2007,01,01);
SetCookie(nomFichier, "0", expiryDate, "/"); 
}
}

}

function readCookie(name){
	var nameEQ = name + "="; ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return '0';
}

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" : ""); 
}
