// Marque page et favoris 
function bookmarksite(title, url)
{
  if (document.all)
    window.external.AddFavorite(url, title);
  else if (window.sidebar)
    window.sidebar.addPanel(title, url, "")
}
// Alternative valide W3C _blank
function lien(monLien) {
window.open(monLien, '_blank');
return false;
}
// Popup centrer //
function PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
// Contact //
function ValiderContact()
{
	var errorMsg = "";
	if(document.formmail.votre_email.value.indexOf('@') == -1) {
		alert("Entrez une adresse email valable");
		document.formmail.votre_email.focus();
		return false;
	}
	
	if (document.formmail.nom.value==""){
		errorMsg += "\n\t- Entrez votre pseudo";	
	}
	
	if (document.formmail.message.value==""){
		errorMsg += "\n\t- Entrez un message";	
	}
	if (document.formmail.sujet.value==""){
		errorMsg += "\n\t- Entrez un sujet";	
	}
	if(document.getElementById("retour_code").innerHTML!="Code bon") {
		errorMsg += "\n\t- Le code du cryptogramme est érroné";
	}	
	if (errorMsg != ""){
		msg = "________________________________________________________________\n\n";
		msg += "Des erreurs ont été détectées.\n";
		msg += "________________________________________________________________\n\n";
		msg += "\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	
	return true;
}
function refreshcode() {
	captcha.location.href="captcha.php?code="+formmail.code.value;
}
// Galerie //
function gotonewpage(what) {
  value = what.options[what.selectedIndex].value;
  if (value == "") return;
  window.location.href = value;
}

var winhandle = null;

function popUp(aURL, aWidth, aHeight) {
  if ((winhandle != null) && (! winhandle.closed)){

    winhandle.document.images["arlesimage"].src=aURL;

    var isNN=(navigator.appName=="Netscape")?1:0;
    var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;

    if (isNN) {
      winhandle.innerHeight = aHeight + 20;
      winhandle.innerWidth  = aWidth + 20;
      winhandle.innerHeight = aHeight;
      winhandle.innerWidth  = aWidth;
    }
    else if (isIE) {
      winhandle.resizeTo(aWidth + 10, aHeight+29);
      dWidth = aWidth - winhandle.document.body.clientWidth;
      dHeight = aHeight - winhandle.document.body.clientHeight;
      winhandle.resizeBy(dWidth, dHeight);
    }
    else {
      winhandle.resizeTo(aWidth + 10, aHeight+29);
    }

  }
  else
  {
    winhandle=window.open("", "imagewin", 'width=' + aWidth + ', height=' + aHeight);

    with (winhandle.document){

      writeln('<html><head>');
      writeln('<title>Image<\/title>');
      writeln('<meta http-equiv="imagetoolbar" content="no">');
      writeln('<\/head>');
      writeln('<body bgcolor="#000000" topmargin="0" leftmargin="0" style="margin:0px;">');
      writeln('<img name="arlesimage" src="' + aURL + '" style="display:block">');
      writeln('<\/body><\/html>');
      close();
    }
  }

  winhandle.focus();

}