
function addToFavorites( anchor ) {//ajout de favoris
  if ( window.external ) {
    var titleFavori = anchor.getAttribute('title');
    var urlFavori = anchor.getAttribute('href');
    if ( ( titleFavori == null ) || ( titleFavori == '' ) ) {
      titleFavori = top.document.title;
      if ( ( titleFavori == null ) || ( titleFavori == '' ) ) {
        titleFavori = "Aviva";
      }
    }
    window.external.AddFavorite( urlFavori , titleFavori );
  }
  else {
    window.alert("Votre Navigateur ne prend pas en charge cette fonction ! Essayez la combinaison de touches Crtl+D");
  }
}

/* menu dynamique au passage de la souris */
function NavRollOver(oTd,name) {
  oTd.style.backgroundColor="#f2d400";
  document.getElementById(name).style.color="#1a4e9a";
}

function NavRollOut(oTd,name) {
  oTd.style.backgroundColor="#1a4e9a";
  document.getElementById(name).style.color="#ffffff";
}

function Menu_ShowHide(id) {
  var d = document.getElementById(id);
  for ( var i = 1; i<=10; i++ )
  {
    if ( document.getElementById('ShowHide'+i) ) {
      document.getElementById('ShowHide'+i).style.display = 'none';
    }
  }
  if ( d ) {
    d.style.display = 'block';
  }
}

function Menu_ShowHide4(id) {
	var d = document.getElementById(id);
	for (var i = 1; i<=7; i++){
		if (document.getElementById('idtabl'+i)) {document.getElementById('idtabl'+i).style.display='none';}
	}
	if (d) {d.style.display='block';}
}

function controleChampsLogin() {

  var form = null;
  var champs = null;
   
  form = document.forms['formPublicDigicodeKeyBoard'];

  //test du loginDigicode 
  champs = form.elements['loginDigicode'].value;
  if ( ( champs == null ) || ( champs == '' ) ) {
    alert('Attention ! le champ Identifiant n\'est pas rempli ');
    return false;
  }
     
  return true;
}

function testerRadio(radio) {
  var checkValue = '';

  for (var i=0; i<radio.length;i++) {
    if ( radio[i].checked ) {
      checkValue = radio[i].value;
    }
  }
  
  return checkValue;
}
