

<!--
/******************************************
    Librairie
******************************************/
var vis = new Array();
var InternetExplorer= navigator.appName.indexOf ("Microsoft") !=-1; // verif du navigateur
var thewin = null;
var thewin2 = null;
var thewin3 = null;
if (!InternetExplorer) {
var origWidth = innerWidth;
var origHeight = innerHeight;
}

function datedebut()
    {
		window.open("calendar.asp?periodSource=info_date_debut","calendar","width=240,height=230,top=120,left=120");
	}
	
function datefin()
    {
		window.open("calendar.asp?periodSource=info_date_fin","calendar","width=240,height=230,top=120,left=120");
	}

function verifNomImageEtExt(thename){
	err = false;
	//if (thename.indexOf ('\\') !=-1 ) err = true;
	//if (thename.indexOf ('/') !=-1 ) err = true;
	//if (thename.indexOf (':') !=-1 ) err = true;
	if (thename.indexOf ('*') !=-1 ) err = true;
	if (thename.indexOf ('?') !=-1 ) err = true;
	if (thename.indexOf ('<') !=-1 ) err = true;
	if (thename.indexOf ('>') !=-1 ) err = true;
	if (thename.indexOf ('|') !=-1 ) err = true;

	if (err) {
		alert("Bad filename!\nIllegal characters : \\,/,:,*,?,<,>,|\n and don't forget extension");
		return false;
	}else{
		err = false;
		if (thename.indexOf ('.jpg') ==-1 && thename.indexOf ('.jpeg') ==-1 && thename.indexOf ('.gif') ==-1 && thename.indexOf ('.pdf') ==-1) err = true;
		if (err) {
			alert("Bad file type!\nIllegal file !");
			return false;
		}else{
			return true;
		}
	}
}

function sendUploadAdmin(thename){
	if (verifNomImageEtExt(thename)) {
		document.upload.submit();
	}
}
function swap_couche(couche, rtl) {
	triangle = MM_findObj('triangle' + couche);
	if (!(layer = MM_findObj('Layer' + couche))) return;
	if (vis[couche] == 'hide'){
		if (triangle) triangle.src = 'img_pack/deplierbas' + rtl + '.gif';
		layer.style.display = 'block';
		vis[couche] = 'show';
	} else {
		if (triangle) triangle.src = 'img_pack/deplierhaut' + rtl + '.gif';
		layer.style.display = 'none';
		vis[couche] = 'hide';
	}
}

function writeDate() {
	navvers = navigator.appVersion.substring(0,1);
	if (navvers > 3)
		navok = true;
	else
		navok = false;
	
	today = new Date;
	jour = today.getDay();
	numero = today.getDate();
	if (numero<10)
		numero = numero;
	mois = today.getMonth();
	if (navok)
		annee = today.getFullYear();
	else
		annee = today.getYear();
	TabJour = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	TabMois = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	messageDate = TabJour[jour] + ", " + TabMois[mois] + " " + numero + ", " +  annee;
	document.write( messageDate );
}

function openwindow(theurl,winname,theWidth,theHeight,theScroll){
if (thewin && !thewin.closed && thewin.name!=winname) {thewin.close();}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable=0";
thewin = window.open(theurl,winname,winfeatures);
thewin.document.close();
thewin.focus();
}

function openwindowzoom(theurl,winname,theWidth,theHeight,theScroll,therezize){
if (thewin && !thewin.closed && thewin.name!=winname) {thewin.close();}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable="+therezize;
thewin = window.open(theurl,winname,winfeatures);
thewin.document.close();
thewin.focus();
}

function openwindow2(theurl,winname,theWidth,theHeight,theScroll){
if (thewin2 && !thewin2.closed && thewin2.name!=winname) {thewin2.close();}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable=0";
thewin2 = window.open(theurl,winname,winfeatures);
thewin2.document.close();
thewin2.focus();
}

function zoom(urlFile,winname,theWidth,theHeight,theScroll,therezize){
	openwindowzoom("/admin/img_zoom.asp?theurl="+urlFile+"&w="+theWidth+"&h="+theHeight,winname,theWidth,theHeight,theScroll)
}

/**** Gestion des Rollovers ****/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImage2() { //v3.0
var i,j=0,x,a=MM_swapImage2.arguments;

for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null) {
   		x.src=a[i+2];
   		x.alt = a[i+1];
   		x.title = a[i+1];
   }
}

function showAll() {
	theMax=document.formulaire.length;
	for (i=0;i<theMax;i++) document.formulaire.elements[i].disabled=0;
}

function validArticleDestruction() {
	if (confirm("Please, confirm the destruction of the article.")) {
		document.formulaire.action="info_delete.asp";
		document.formulaire.submit();
	}
}

function insertArticle() {
	showAll();
	if (document.formulaire.info_titre.value != "") {
		document.formulaire.submit();
	} else {
		alert("Title is compulsory field !");
	}
}

function openLocalNews(theurl,winname,theWidth,theHeight,theScroll,therezize){
	if (thewin && !thewin.closed && thewin.name!=winname) {thewin.close();}
	winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable="+therezize;
	thewin = window.open(theurl,winname,winfeatures);
	if( thewin ) {
		thewin.document.close();
		thewin.focus();
	}
}
function openActuPreview(theurl,winname,theWidth,theHeight,theScroll,therezize){
	if (thewin && !thewin.closed && thewin.name!=winname) {thewin.close();}
	winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable="+therezize;
	thewin = window.open(theurl,winname,winfeatures);
	if( thewin ) {
		thewin.document.close();
		thewin.focus();
	}
}

function openMentions(theurl){
	winname = "mentions";
	theWidth = 370;
	theHeight = 480;
	theScroll = 1;
	therezize = 0;
	if (thewin2 && !thewin2.closed && thewin2.name!=winname) {thewin2.close();}
	winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable="+therezize;
	thewin2 = window.open(theurl,winname,winfeatures);
	if( thewin2 ) {
		thewin2.document.close();
		thewin2.focus();
	}
}

function openMentions2(theurl){
	winname = "mentions";
	theWidth = 370;
	theHeight = 315;
	theScroll = 1;
	therezize = 0;
	if (thewin2 && !thewin2.closed && thewin2.name!=winname) {thewin2.close();}
	winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable="+therezize;
	thewin2 = window.open(theurl,winname,winfeatures);
	if( thewin2 ) {
		thewin2.document.close();
		thewin2.focus();
	}
}

function openWarning(theurl){
	winname = "warning";
	theWidth = 370;
	theHeight = 350;
	theScroll = 1;
	therezize = 0;
	if (thewin3 && !thewin3.closed && thewin3.name!=winname) {thewin3.close();}
	winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable="+therezize;
	thewin3 = window.open(theurl,winname,winfeatures);
	if ( thewin3 ) {
		thewin3.document.close();
		thewin3.document.focus();
	}
}
function openWhereToClickBak(type,code_pays){
	openLocalNews(type+".asp?code_pays="+code_pays,"local","600","480","0","0");
}
function openWhereToClick(type,code_pays){
	var decoupe = type.split("/");
	
	type = decoupe[(decoupe.length)-1];
	code_lang= decoupe[1];
	openActuPreview("../news/actu_preview.asp?type="+type+"&code_pays="+code_pays+"&code_lang="+code_lang,"actu","550","400","0","0");

}


function validField(theFormName,selectedField,theMsg) {
	field = eval("document."+theFormName+"."+selectedField);
	str = field.value;
  	if  (str =="") {
        window.alert(theMsg);
    	field.focus();
    	field.select();
    	return false;
  	} else {
  		return true;
  	}
}

function validEmail(theFormName,selectedField,theMsg) {
	field = eval("document."+theFormName+"."+selectedField);
	str = field.value;
  	if (window.RegExp) {
    	var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    	var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
    	var reg1 = new RegExp(reg1str);
    	var reg2 = new RegExp(reg2str);
    	if (!(!reg1.test(str) && reg2.test(str))) {
     		window.alert(theMsg);
    		field.focus();
    		field.select();
    		return false;
    	}else{
    		return true;
    	}
  	} else {
    	serie=str.split(" ");
  		nb=serie.length;
  		newstr="";
  		for(i=0; i<nb;i++) {
  			newstr=newstr+serie[i];
  		}
  		if ( newstr =="" || newstr.indexOf("@")== -1 || newstr.indexOf(".")== -1 || newstr.indexOf(" ")!= -1) {
        	window.alert(theMsg);
        	field.focus();
        	field.select();
        	return false;
  		}else{
    		return true;
    	}
  	}
}

function validationFormContact(theFormName,msg,msgEmail) { 
	var field = eval("document."+theFormName+".SUBJECT");
	var field2 = eval("document."+theFormName+".SUBJECTNAME");
	for (i=0;i<field.length;i++){
		if (field[i].selected){field2.value=field[i].text}
	}
  if (validField(theFormName,'CIVILITE',msg)) {
  	field = eval("document."+theFormName+".CIVILITE");
  	field2= eval("document."+theFormName+".CIVILITENAME");
	for (i=0;i<field.length;i++){
		if (field[i].selected){field2.value=field[i].text}
	}
  	if (validField(theFormName,'PRENOM',msg)) {
  		if (validField(theFormName,'NOM',msg)) {
  			if (validField(theFormName,'ADRESSE',msg)) {
  				if (validField(theFormName,'CODEPOSTAL',msg)) {
  					if (validField(theFormName,'VILLE',msg)) {
  						if (validField(theFormName,'PAYS',msg)) {
  						
						field = eval("document."+theFormName+".PAYS");
  						field2= eval("document."+theFormName+".PAYSNAME");
						for (i=0;i<field.length;i++){
							if (field[i].selected){field2.value=field[i].text}
						}
  							if (validField(theFormName,'EMAIL',msg)) {
  								if (validEmail(theFormName,'EMAIL',msgEmail)) {
  									
  									if (validField(theFormName,'COMMENTS',msg)) {
  										eval("document."+theFormName+".submit()");
  									//	return true;
  									}
  									
  									
  								}
  							}
  						}
  					}
  				}
  			}
  		}
  	}
  }
//  return false;
}  


function validationFormNewsletter(theFormName,msg,msgEmail) { 
  if (validField(theFormName,'CIVILITE',msg)) {
  	field = eval("document."+theFormName+".CIVILITE");
  	field2= eval("document."+theFormName+".CIVILITENAME");
	for (i=0;i<field.length;i++){
		if (field[i].selected){field2.value=field[i].text}
	}
  	if (validField(theFormName,'PRENOM',msg)) {
  		if (validField(theFormName,'NOM',msg)) {
  			if (validField(theFormName,'ADRESSE',msg)) {
  				if (validField(theFormName,'CODEPOSTAL',msg)) {
  					if (validField(theFormName,'VILLE',msg)) {
  						if (validField(theFormName,'PAYS',msg)) {
  						
						field = eval("document."+theFormName+".PAYS");
  						field2= eval("document."+theFormName+".PAYSNAME");
						for (i=0;i<field.length;i++){
							if (field[i].selected){field2.value=field[i].text}
						}
  							if (validField(theFormName,'EMAIL',msg)) {
  								if (validEmail(theFormName,'EMAIL',msgEmail)) {
  									eval("document."+theFormName+".submit()");
  								//	return true;
  								}
  							}
  						}
  					}
  				}
  			}
  		}
  	}
  }
  //return false;
}  

function validationFormUnscuscribeNewsletter(theFormName,msg,msgEmail) { 

	if (validField(theFormName,'EMAIL',msg)) {
		if (validEmail(theFormName,'EMAIL',msgEmail)) {
			eval("document."+theFormName+".submit()");
		//	return true;
		}
	}

  //return false;
}  


function validationFormVisits(theFormName,msg,msgEmail) { 
  if (validField(theFormName,'CIVILITE',msg)) {
  	field = eval("document."+theFormName+".CIVILITE");
  	field2= eval("document."+theFormName+".CIVILITENAME");
	for (i=0;i<field.length;i++){
		if (field[i].selected){field2.value=field[i].text}
	}
  	if (validField(theFormName,'PRENOM',msg)) {
  		if (validField(theFormName,'NOM',msg)) {
  			if (validField(theFormName,'ADRESSE',msg)) {
  				if (validField(theFormName,'CODEPOSTAL',msg)) {
  					if (validField(theFormName,'VILLE',msg)) {
  						if (validField(theFormName,'PAYS',msg)) {
  						
						field = eval("document."+theFormName+".PAYS");
  						field2= eval("document."+theFormName+".PAYSNAME");
						for (i=0;i<field.length;i++){
							if (field[i].selected){field2.value=field[i].text}
						}
  							if (validField(theFormName,'EMAIL',msg)) {
  								if (validEmail(theFormName,'EMAIL',msgEmail)) {
  									if (validField(theFormName,'DATEREQUESTED',msg)) {
  										if (validField(theFormName,'TIMEREQUESTED',msg)) {
  											eval("document."+theFormName+".submit()");
  											//return true;
  										}
  									}
  								}
  							}
  						}
  					}
  				}
  			}
  		}
  	}
  }
  //return false;
}  

function insertUser() {
	showAll();
	if (document.formulaire.admin_user_email.value != "" ) {
		if (validEmail("formulaire",'admin_user_email',"Email not valid !")) {
			if ((document.formulaire.admin_user_login.value != "") && (document.formulaire.admin_user_pwd.value != "")) {
				document.formulaire.submit();
			} else {
				alert("Login and Password are compulsory fields !");
			}
		}
	}else{
		if ((document.formulaire.admin_user_login.value != "") && (document.formulaire.admin_user_pwd.value != "")) {
				document.formulaire.submit();
			} else {
				alert("Login and Password are compulsory fields !");
			}
	}
}

function updateFormulaireUser() {
	if (document.formulaire.form_user_email.value != "" ) {
		if (validEmail("formulaire",'form_user_email',"Email not valid !")) {
			if ( document.formulaire.form_user_texte.value != "" ) {
				document.formulaire.submit();
			} else {
				alert("Text are compulsory field !");
			}
		}
	}else{
		alert("Email are compulsory field !");
	}
}

//ouverture des popup utiise pour rare vintage
function popup(url, titre, features)
  {
  window.open(url, titre, features);
  }


//-->

