/* PERMET LA VALIDATION D'UN FORMULAIRE EN APPUYANT SUR LA TOUCHE ENTER */
function getCodeValue($arg) {
	if (event.keyCode == 13) document.forms[$arg].submit();
}


/* LECTURE DU COOKIKE ACCESSIBILITE pour les racourcies */
var res1 = '';
var res2 = '';
var res3 = '';
var res4 = '';

function GetCookie (nom)
{
  var arg = nom + "=";
  var alen = arg.length;
  var i = 0;
  
  while (i < document.cookie.length) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg) {
      var endstr = document.cookie.indexOf (";", j);
      if (endstr == -1) endstr = document.cookie.length;
      chaine = unescape (document.cookie.substring(j, endstr));
      var reg=new RegExp("[:]+", "g");
      var tableau=chaine.split(reg);
      res1 = tableau[0];
      res2 = tableau[1];
      res3 = tableau[2];
      res4 = tableau[3];
    }
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
}
GetCookie('AVH');


/* DÉFINI LES RACCOURCIES CLAVIER POUR LES UTILISATEURS */
function getKey(keyStroke) {
  if (window.event.altKey) {
    var accessibilite = '';
    
		if (res1 != '' && res2 != '' && res3 != '' && res4 != '') { accessibilite = "?deficient="+res1+"&amp;tailleTexte="+res2+"&amp;colorTexte="+res3+"&amp;colorFond="+res4;	}
		var key = new Array();
		key['48'] = key['96'] = "http://www.avh.asso.fr/bicentenaire/index.php"+accessibilite;
		key['49'] = key['97'] = "#contentRub";
		key['50'] = key['98'] = "#menuSite";
		key['51'] = key['99'] = "#sousmenu";
    key['52'] = key['100'] = "http://www.avh.asso.fr/bicentenaire/plan/plan_site.php"+accessibilite;
		key['53'] = key['101'] = "#search";
		key['54'] = key['102'] = "#top";
	
		isNetscape=(document.layers);
		eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
		//alert(eventChooser);
    //if (eventChooser == 97) window.location = key['97'];
		//which = String.fromCharCode(eventChooser).toLowerCase();
		for (var i in key) if (eventChooser == i) window.location = key[i];
	}
}
document.onkeydown = getKey;
