
function verifMail(a){
testm = false ;
 for (var j=1 ; j<(a.length) ; j++) {
  if (a.charAt(j)=='@') {
   if (j<(a.length-4)){
    for (var k=j ; k<(a.length-2) ; k++) {
     if (a.charAt(k)=='.') testm = true;
    }
   }
  }
 }
return testm ;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function applyClass(oElement,sCSSClass)

{
     oElement.className = sCSSClass;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function setPointer(theRow, thePointerColor)
{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
        return false;
    }
 
    var row_cells_cnt = theRow.cells.length;
    
    for (var c = 0; c < row_cells_cnt; c++) {
        theRow.cells[c].bgColor = thePointerColor;        
    }
 
    return true;
}

function valid_search(form) {
  if (form.recherche.value == ""){
    alert("Veuillez saisir une recherche.")
	form.recherche.focus();
	return false }
	return true
}
function valid_mail(form) {
  if (form.email.value == ""){
    alert("Veuillez saisir une adresse mail.")
	form.email.focus();
	return false }
  if (verifMail(form.email.value)==false){
    alert("Le format de l'adresse mail n'est pas correct...")
	form.email.focus();
	return false }
	return true
}

// POUR MENUS
function AfficheCalqueBlock(calque,type,id){
	if (type==1){
		makeRequest("menu_infos.php?id_menu="+id,majcontenu);
		} 
	else { 
		
		document.getElementById("corps").className="opacity100";
		}
	}

// POUR REPAS
function AfficheCalqueBlock2(type,id){
	if (type==1){ 
		makeRequest("menu_infos_famille.php?id_famille="+id,majcontenu2);
	}else {  
		document.getElementById("corps").className="opacity100";
	}
}

// POUR BOISSONS
function AfficheCalqueBlock3(type,id){
	if (type==1){ 
		makeRequest("infos_boisson.php?id_famille="+id,majcontenu3);
	}else {  
		document.getElementById("corps").className="opacity100";
	}
}

