
	// redirection pour virer la top url du .tk ou autres frames
if (self!=top) top.location.href=self.location.href;// preload
	// boutons de toggle des modules
	moduleopenimg = new Image();
	moduleopenimg.src = "images/template/defaut/open.gif";
	// fond des modules fermés
	rolloverimg = new Image();
	rolloverimg.src = "images/template/defaut/top_menu_on.gif";

	function swap(num, type)
	{
		var ie=document.all
		var ns6=document.getElementById&&!document.all
		if (ns6)
		{
			if (type == 'on') document.getElementById.entete.style.background = "url(images/template/defaut/top_menu_on.gif)";
			else  document.getElementById.entete.style.background = "url(images/template/defaut/top_menu_out.gif)";
		}
		else if (ie)
		{
			var entete = document.all['menu'+num];
			if (type == 'on') entete.style.background = "url(images/template/defaut/top_menu_on.gif)";
			else entete.style.background = "url(images/template/defaut/top_menu_out.gif)";
		}
	}
function VerificationEmail(elm)
{
	if (elm.value.indexOf("@") != "-1" && elm.value.indexOf(".") != "-1" && elm.value != "") return true;
	return false;
}

function VerificationFormulaire()
{
	if (VerificationEmail(document.newsletter.adrmail) == false)
	{
		alert("Email non Valide.");
		document.newsletter.adrmail.focus();
		return false;
	}
	return true;
}
var pathname=location.pathname;
var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var date_exp = new Date();
date_exp.setTime(date_exp.getTime()+(365*24*3600*1000));

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

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 oc(max){
	var a = 1;
	while (a <= max){
		var valeur=GetCookie("_"+a);
		if (valeur == "hide") menu(a);
		a++;
	}
}function menu(num) {
	var ie=document.all
	var ns6=document.getElementById&&!document.all
	if (ns6) {
		if (document.getElementById.entete.style.display == "none"){
			document.getElementById.entete.style.display = "";
		}
		else if (document.getElementById.entete.style.display == ""){
			document.getElementById.entete.style.display = "none";
		}
	}
	else if (ie){
		var entete = document.all['smenu'+num];
		if (entete.style.display == "none"){
			entete.style.display = "";
			document.all['b'+num].src = "images/template/defaut/close.gif";
			SetCookie("_"+num,"show",date_exp,myDomain);
		}
		else if (entete.style.display == ""){
			entete.style.display = "none";
			document.all['b'+num].src = "images/template/defaut/open.gif";
			SetCookie("_"+num,"hide",date_exp,myDomain);
		}
	}
}
function confirmSubmit(message)
{
var agree=confirm(message);
if (agree)
	return true ;
else
	return false ;
}
function preview_img(){
if(document.form.fichier.value == "") alert("Veuillez sélectionner une image.");
else {
	innerHTML=window.open("","innerHTML","height=200,width=300,resizable=1");
	innerHTML.document.write('<html><body><center><table height="100%" width="100%"><tr><td align="center" valign="middle">');
	nav=navigator.appName.substring(0,3);
	if(nav=="Net"){
		innerHTML.document.write('<img name="apercu" src="file:///'+document.form.fichier.value+'">') ;
	}
	else {
		innerHTML.document.write('<img name="apercu" src="'+document.form.fichier.value+'">') ;
	}
	innerHTML.document.write('<br><br><form><input type="button" value="Fermer" onClick="parent.close()"></form></td></tr></table></center></body></html>');
	innerHTML.document.close();
} 
}