


function afficheMaxi(chemin)
{
i1 = new Image;
i1.src = chemin;
html = '<HTML><HEAD><title>Objectif Home</title></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER></BODY></HTML>';
popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
popupImage.document.open();
popupImage.document.write(html);
popupImage.document.close()
};





function chiffres(event) {

// Compatibilité IE / Firefox
		if(!event&&window.event) {
			event=window.event;
		}
		// IE
		if(event.keyCode < 48 || event.keyCode > 57) {
			event.returnValue = false;
			event.cancelBubble = true;
		}
		// DOM
		if(event.which < 48 || event.which > 57) {
			event.preventDefault();
			event.stopPropagation();
		}
	}




function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}



function change_site() {
var site = document.menu.popup.selectedIndex;
{
window.location.href =document.menu.popup.options[site].value;
}
}


function menu_show() {
    for (i=0;i<menu_show.arguments.length;i++) {
    document.getElementById(menu_show.arguments[i]).style.visibility='visible';}
}
function menu_hide() {
    for (i=0;i<menu_hide.arguments.length;i++) {
    document.getElementById(menu_hide.arguments[i]).style.visibility='hidden';}
}
function menu_msg(msg) {
    alert(msg);
}

function menuderoulant(cadre,selection){ 

eval(cadre+".location='"+selection.options[selection.selectedIndex].value+"'"); 

} 


function pop_it(the_form) {
   my_form = eval(the_form)
   window.open("rappel-home-staging.php", "popup", "height=300,width=400,menubar='no',toolbar='no',location='no',status='no',scrollbars='no'");
   my_form.target = "popup";
   my_form.submit();
}

		
	function Verif_rappel()
	{
		// Definition du motif a matcher
		var regex = new RegExp(/^(01|02|03|04|05|06|08)[0-9]{8}/gi);
		
		// Definition de la variable booleene match
		var match = false;
		
		// Test sur le motif
		if(regex.test(num_tel))
		{
			match = true;
		}
		  else
		{
			document.forms['formulaire_rappel'].telephone.focus();match = false;
		}
		
		// On renvoie match
		//if(match==true)	{ document.forms[0].submit(); 							return match;	}
		//else			{ alert("Le numéro de téléphone n'est pas valide !");	return false;	}
		return match;
	}

function Verif_contact()
	{
		

		if 		(document.forms['moncontact'].nom.value == "")	{ i=0;  alert("Le Champ 'Nom' est  obligatoire.");    document.forms['moncontact'].nom.focus(); return false;    }
		else if	(document.forms['moncontact'].message.value == "")	{ i=0;  alert("Le Champ 'Téléphone' est  obligatoire.");    document.forms['moncontact'].message.focus(); return false;    }		
		else  
		{ 		
				if(checkEmail(document.forms['moncontact'].email.value))	return true;
				else { alert("Vérifier la validité de votre 'Email'.");    document.forms['moncontact'].email.focus(); return false;    }
		}			

	}


function Verif_newsletter()
	{
		

				if(checkEmail(document.forms['manewsletter'].email.value))	return true;
				else { alert("Vérifier la validité de votre 'Email'.");    document.forms['manewsletter'].email.focus(); return false;    }

	}




function checkEmail(emailAddr) {
 // Cette fonction vérifie la bon format d'une adresse e-mail.
 // Comme :
 // user@domain.com ou user.perso@domain.com
 
 var i;
 
  if (emailAddr.length==0) {
  return false;
 }
 
 
 
 // Recherche de @
 i = emailAddr.indexOf("@");
 if (i == -1) {
  return false;
 }
 
 // Séparation du nom de l'utilisateur et du nom de domaine.
 var username = emailAddr.substring(0, i);
 var domain = emailAddr.substring(i + 1, emailAddr.length)
 
 // Recherche des espaces au début du nom de l'utilisateur.
 i = 0;
 while ((username.substring(i, i + 1) == " ") && (i < username.length)) {
  i++;
 }
 // Les enlève s'il en trouve.
 if (i > 0) {
  username = username.substring(i, username.length);
 }
 
 // Recherche d'espaces à la fin du nom de domaine.
 i = domain.length - 1;
 while ((domain.substring(i, i + 1) == " ") && (i >= 0)) {
  i--;
 }
 // Les enlève s'il en trouve.
 if (i < (domain.length - 1)) {
  domain = domain.substring(0, i + 1);
 }
 
 // Vérifie que le nom de l'utilisateur et du domaine ne soit pas vide.
 if ((username == "") || (domain == "")) {
  return false;
 }
 
 // Vérifie s'il n'y a pas de caractères interdits dans le nom de l'utilisateur.
 var ch;
 for (i = 0; i < username.length; i++) {
  ch = (username.substring(i, i + 1)).toLowerCase();
  if (!(((ch >= "a") && (ch <= "z")) || 
   ((ch >= "0") && (ch <= "9")) ||
   (ch == "_") || (ch == "-") || (ch == "."))) {
    return false;
  }
 }
 
 // Vérifie s'il n'y a pas de caractères interdits dans le nom de domaine
 for (i = 0; i < domain.length; i++) {
  ch = (domain.substring(i, i + 1)).toLowerCase();
  if (!(((ch >= "a") && (ch <= "z")) || 
   ((ch >= "0") && (ch <= "9")) ||
   (ch == "_") || (ch == "-") || (ch == "."))) {
    return false;
  }
 }
 
// Ajouter ci-dessous de nouveaux noms de domaine.
// Voir tous les noms de domaine sur http://www.toulouse-renaissance.net/c_outils/c-nom-domaine.htm
//
var aSuffix = new Array("com","net","int","aero","biz","museum","name","info","coop","pro","eu","edu","org","gov","mil","bj","dz","de","ad","be","ca","bf","bi","cm","cf","cg","cd","ci","dj","fr","ga","gp","gf","lu","mg","ml","ma","mq","mr","mc","nc","pf","re","pm","sn","ch","td","tf","tn");
 var bFoundSuffix = false;
 i = 0;
 while (i < aSuffix.length) {
  if (("." + aSuffix[i]) == domain.substring(domain.length - aSuffix[i].length - 1, domain.length)) {
   return true;
  }
  i++;
 }
 // Si le nom de domaine est inconnu  : return false
 return false;
 
} 
 
 
function emailOK(emailAddr) {
 if (!(checkEmail(emailAddr))) {
  return false;
 }
 else return true;
}


function ValidMail(mail_address)
{
	return mail_address.match(/^([\w]+)@([\w]+)\.([\w]+)$/);
}




function decomposer(chaine){
	var ma_liste = chaine.split("") ;
	for(i=0;i<ma_liste.length;i++){ 
	if(ma_liste[i]==' ')ma_liste[i]='';
	document.write('<img src="img/lettre_'+ma_liste[i]+'.gif">');
	};
}








