$('ul:last li.active').qtip({
   content: 'This is an active list element',
   show: 'mouseover',
   hide: 'mouseout'
})



function efface_bandeau() {
document.getElementById('bandeau_message').style.display = "none";
}

function bordure_champ_on(variable){
var id_champ = variable;
window.document.getElementById(id_champ).style.background = "#fff6b8";
window.document.getElementById(id_champ).style.border = "1px solid #FFCF4A";
}
function bordure_champ_off(variable){
var id_champ = variable;
window.document.getElementById(id_champ).style.background = "#DEDEDE";
window.document.getElementById(id_champ).style.border = "1px solid #cccccc";
}

function zone_on(variable){
window.document.getElementById(variable).style.color = "red";
}

function zone_off(variable){
window.document.getElementById(variable).style.color = "#A2A2A2";
}

function zone_sous_menu_on(variable){
window.document.getElementById(variable).style.display = "block";
}

function zone_sous_menu_off(variable){
window.document.getElementById(variable).style.display = "none";
}


function validateForm_contact() {
	var errors = '';

	if (window.document.getElementById(1).value.length<2){ errors +="Veuillez saisir votre nom et prénom.\n"; window.document.getElementById(1).style.background = "#FFA0A2";}

	if (window.document.getElementById(2).value.length<2){ errors +="Veuillez saisir votre E-Mail.\n";window.document.getElementById(2).style.background = "#FFA0A2"; }
	else
	{
	var verim = 0;
	for (i=1; i<window.document.getElementById(2).value.length -4; i++) {
	if (window.document.getElementById(2).value.charAt(i) == "@") {
	verim = 1;}}
	if ( verim == 0) { errors +="Votre E-Mail n'est pas valide.\n";window.document.getElementById(2).style.background = "#FFA0A2"; }
	}

	if (window.document.getElementById(3).value.length<2){ errors +="Veuillez saisir votre numéro de téléphone.\n";window.document.getElementById(3).style.background = "#FFA0A2"; }
	if (window.document.getElementById(4).value.length<2){ errors +="Veuillez saisir le sujet.\n";window.document.getElementById(4).style.background = "#FFA0A2"; }
	if (window.document.getElementById(5).value.length<5){ errors +="Veuillez saisir votre commentaire.\n";window.document.getElementById(5).style.background = "#FFA0A2"; }
	if ( errors != "")
	{
	alert(errors);
	}

	document.returnValue = (errors == '');

}

function validateForm_preinscription() {
	var errors = '';

	if (window.document.getElementById(1).value.length<2){ errors +="Veuillez saisir votre nom.\n"; window.document.getElementById(1).style.background = "#FFA0A2";}
	if (window.document.getElementById(2).value.length<2){ errors +="Veuillez saisir votre prénom.\n"; window.document.getElementById(2).style.background = "#FFA0A2";}
	if (window.document.getElementById(3).value.length<4){ errors +="Veuillez saisir votre adresse.\n"; window.document.getElementById(3).style.background = "#FFA0A2";}
	if (window.document.getElementById(4).value.length<4){ errors +="Veuillez saisir votre code postal.\n"; window.document.getElementById(4).style.background = "#FFA0A2";}
	if (window.document.getElementById(5).value.length<4){ errors +="Veuillez saisir votre code ville.\n"; window.document.getElementById(5).style.background = "#FFA0A2";}
	if (window.document.getElementById(6).value.length<4){ errors +="Veuillez saisir le numéro de téléphone N°1.\n"; window.document.getElementById(6).style.background = "#FFA0A2";}
	if (window.document.getElementById(7).value.length<4){ errors +="Veuillez saisir le numéro de téléphone N°2.\n"; window.document.getElementById(7).style.background = "#FFA0A2";}
	if (window.document.getElementById(8).value.length<4){ errors +="Veuillez saisir votre E-Mail.\n"; window.document.getElementById(8).style.background = "#FFA0A2";}
	if (window.document.getElementById(11).value.length<4){ errors +="Veuillez saisir votre date de naissance.\n"; window.document.getElementById(11).style.background = "#FFA0A2";}
	if (window.document.getElementById(10).value.length<4){ errors +="Veuillez saisir votre nationalité.\n"; window.document.getElementById(10).style.background = "#FFA0A2";}
	if (window.document.getElementById(12).value.length<4){ errors +="Veuillez saisir votre niveau d'études.\n"; window.document.getElementById(12).style.background = "#FFA0A2";}
	if (window.document.getElementById(13).value.length<4){ errors +="Veuillez saisir les diplomes obtenus.\n"; window.document.getElementById(13).style.background = "#FFA0A2";}

	if (window.document.getElementById(30).value.length<4){ errors +="Veuillez ajouter votre CV.\n"; window.document.getElementById(30).style.background = "#FFA0A2";}
	if (window.document.getElementById(31).value.length<4){ errors +="Veuillez ajouter votre lettre de motivation.\n"; window.document.getElementById(31).style.background = "#FFA0A2";}

	if ( errors != "")
	{
	alert(errors);
	}

	document.returnValue = (errors == '');
}

function validateForm_identification() {
	var errors = '';

	if (window.document.getElementById(21).value.length<2){ errors +="Veuillez saisir votre identifiant.\n"; window.document.getElementById(21).style.background = "#FFA0A2";}
	if (window.document.getElementById(22).value.length<2){ errors +="Veuillez saisir votre mot de passe.\n"; window.document.getElementById(22).style.background = "#FFA0A2";}

	if ( errors != "")
	{
	alert(errors);
	}

	document.returnValue = (errors == '');
}

//GESTION DE LA REMISE DES CERTIFICATS--------------------------------
function selection_session_certificat(){
var recup_session = document.getElementById('selection_date_certificat').value;
$('#zone_remise_certificat').load('moteur/affiche_remise_certificat.php?ajax=oui&session_certificat='+recup_session).fadeIn("slow");
}

function localisation_avlis(){
initialize()
}

function initialize() {

          var optionsCarte = {
               zoom: 16,
               center: new google.maps.LatLng(48.878786,2.35234),
               mapTypeId: google.maps.MapTypeId.ROADMAP
          };
          var maCarte = new google.maps.Map(document.getElementById("EmplacementDeMaCarte"), optionsCarte);
          var optionsMarqueur = {
               position: maCarte.getCenter(),
               map: maCarte
          }
          var marqueur = new google.maps.Marker(optionsMarqueur);
//           var optionsInfoBulle = {
//                content: "<span style='font-family: Verdana'><b style='color:red;'>AVLIS</b><br><span style=';font-size:12px;'>12 RUE BOSSUET 75010 PARIS</span></span>"
//           }
          var infoBulle = new google.maps.InfoWindow(optionsInfoBulle);
          infoBulle.open(maCarte, marqueur);
}

function gestion_trombinoscope(){
var info_periode = window.document.getElementById('retourne_la_periode').value ;
var info_le_groupe  = window.document.getElementById('retourne_le_groupe').value ;

$('#zone_trombinoscope').fadeOut('slow').load('moteur/module_trombinoscope.php?ajax=1&la_periode='+info_periode+'&le_groupe='+info_le_groupe).fadeIn("slow");
}

function gestion_cours(){
var info_matiere = window.document.getElementById('affiche_matiere').value ;

$('#zone_cours').fadeOut('slow').load('moteur/module_cours.php?ajax=1&la_matiere='+info_matiere).fadeIn("slow");
}






