// Vérifie la version du navigateur ///
function checkBrowser()
{	
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie55=((this.ver.indexOf("MSIE 5.5")>-1 || this.ie6) && this.dom)?1:0;
	this.ie5=((this.ver.indexOf("MSIE 5")>-1 || this.ie5 || this.ie6) && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.ie4plus=(this.ie6 || this.ie5 || this.ie4);
	this.ie5plus=(this.ie6 || this.ie5)
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5);
	return this;
}

bw = new checkBrowser();
if (!document.getElementById) 
{
	document.getElementById = getObjectById;
}
// Fin --> Vérifie la version du navigateur ///
// Récupère l'élément ID passé en paramètre ///
function getObjectById(ID) 
{
	var obj;
	if (bw.dom)
		return document.getElementById(ID);
	else if (bw.ie4)
		return document.all(ID);
	else if (bw.ns4)
		return eval('document.' + ID);
}
function getObjectByIdParent(ID) 
{
	var obj;
	if (bw.dom)
		return parent.document.getElementById(ID);
	else if (bw.ie4)
		return parent.document.all(ID);
	else if (bw.ns4)
		return eval('parent.document.' + ID);
}
// Fin ---> Récupère l'élément ID passé en paramètre ///
// Permet de faire le roll-up sur les menus ///
function change(element,sens){
	var lClass;
	var lnSup = getObjectById(element);
	lClass = "puce_" + sens;
	lnSup.className = lClass;
}
// Fin --> Permet de faire le roll-up sur les menus ///
// Vérification du mail
function checkMail(email)
{
	var x = email;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) return true;
	else return false;
}
// Fin de la vérification du mail
// de envoicontact.cfm, valide le formulaire ///
function validation (form)
	
	{var OK = 1;
	if (form.Nom.value.length == 0)
	   {
	    alert("Merci d'indiquer votre nom");
	    OK=0;
	    return;
	   }
	if (form.Societe.value.length == 0)
	   {
	    alert("Merci d'indiquer votre sociÃ©tÃ©");
	    OK=0;
	    return;
	   }
	if (form.Adresse.value.length == 0)
	   {
	    alert("Merci d'indiquer votre adresse");
	    OK=0;
	    return;
	   }
	if (form.CP.value.length == 0)
	   {
	    alert("Merci d'indiquer votre code postal");
	    OK=0;
	    return;
	   }
	if (form.Ville.value.length == 0)
	   {
	    alert("Merci d'indiquer la ville de votre entreprise");
	    OK=0;
	    return;
	   }
	if (form.Tel.value.length == 0)
	   {
	    alert("Merci d'indiquer votre numÃ©ro de tÃ©lÃ©phone");
	    OK=0;
	    return;
	   }
	if (form.Email.value.length == 0)
	   {
	    alert("Merci d'indiquer votre email");
	    OK=0;
	    return;
	   }
	else {
		if (!checkMail(form.Email.value))
		{
			alert("une erreur s'est glissée dans votre email !");
			OK=0;
			return false;
		}
	}
	if (OK == 1)
	   {
		form.submit();
//alert("bon");
	   }
}
// fin --> de envoicontact.cfm, valide le formulaire ///
// de la page inscription.cfm, envoi le formulaire vers autreStage ///
function AutreStage(form) {
form.action = "Pages/AutreStages.cfm";
form.submit();
}
// fin ---> de la page inscription.cfm, envoi le formulaire vers autreStage ///
// Ouvre une fenêtre pop-up ///
function Produit(page,large,haut)
{
	wnd = window.open(
	page,
		"Formation",
		"toolbar=no,location=no,status=no,resizeable=no," +
		"width=" + large + ",scrollbars=yes,height=" + haut +",top=20,left=20"
	);
	// si ce n'est pas Internet Explorer 3, remettre la fen&ecirc;tre devant
	if (navigator.appVersion.indexOf("MSIE 3")<0) wnd.focus();
}
// fin --> Ouvre une fenêtre pop-up ///
// suppression d'un stage ///
function A_Supprimer(id,ParDom)
{
Reponse = confirm("Voulez-vous vraiement supprimer ce stage ?");
if (Reponse == true) window.location.href="programmes.cfm?ASupprimer=oui&ParDom="+ParDom+"&id=" + id;
}
// fin --> suppression d'un stage ///
// Ouverture d'u pop-up
function programme(page,large,haut)
{
	wnd = window.open(
	page,
		"Formation",
		"toolbar=no,location=no,status=no,resizeable=no," +
		"width=" + large + ",scrollbars=yes,height=" + haut +",top=20,left=20"
	);

	// si ce n'est pas Internet Explorer 3, remettre la fen&ecirc;tre devant
	if (navigator.appVersion.indexOf("MSIE 3")<0) wnd.focus();
}
// fin --> Ouverture d'u pop-up

