// showHideDiv(divShow, divHide1, divHide2, ...)
function showHideDiv() {
  var argv = showHideDiv.arguments;
  var argc = argv.length;

  // Show/Hide le premier argument
  var divObj = document.getElementById(argv[0]);
  if (divObj.style.display == "none") {
      divObj.style.display = "block";
  } else {
      divObj.style.display = "none";
  }

  // Hide les autres
  for(var i=1; i<argc; i++) {
    var divObj = document.getElementById(argv[i]);
    divObj.style.display = "none";
  }
}

//----------------  fonctions ----------------
// Ouverture d'une nouvelle fenêtre en popup
function openPopup(popupPage,description) {
	var params = 'scrollbars=yes,resizable=yes,top='+((screen.availHeight/2)-300)+',left='+((screen.availWidth/2)-400)+',width=810,height=600'; 
	wMath = window.open(popupPage,description,params);
	wMath.focus();
}

// Ouverture d'une nouvelle fenêtre en popup avec le menu
function openWindow(popupPage,description) {
	var params = 'menubar=yes,Toolbar=yes,Locationbar=yes,scrollbars=yes,resizable=yes,top='+((screen.availHeight/2)-300)+',left='+((screen.availWidth/2)-400)+',width=800,height=600'; 
	wMath = window.open(popupPage,description,params);
	wMath.focus();
}

// Verification que a est bien de la forme xxx@xxx.xxx
function isEmailAdress(a)
{
  var i=0;
  i=a.indexOf('@',i);
  if (i==-1) return false;
  if (a.indexOf('@',i+1)!=-1){ return false;}
  if (a.indexOf('.',i+1)==-1){ return false;}
  
  return true;
}

// Vérification du type de browser
function checkBrowser(newLoc){
	var browserName=navigator.appName; 
	if (browserName!="Microsoft Internet Explorer"){ 
	 alert("Désolé mais ce site est actuellement optimisé pour un navigateur Internet Explorer.");
	}else{
		document.location=newLoc;
	}
}

