function init(){
	
	$$('.external').addEvent('click', function(ev){
		window.open(this.href); new Event(ev).stop(); return; });

	if($('partenaires'))
		enableTooltips('partenaires');
	
	if($('right'))
		enableTooltips('right');
	
	if( document.getElementById('form-contact') ){
			document.getElementById('nom').onblur = function(){checkRequired('nom');}
			document.getElementById('prenom').onblur = function(){checkRequired('prenom');}
			document.getElementById('mail').onblur = function(){checkEmail('mail');}
			document.getElementById('message').onblur = function(){checkRequired('message');}
			document.getElementById('antispam').onblur = function(){checkRequired('antispam');}
			document.getElementById('form-contact').onsubmit = function(){
			checkRequired('nom');
			checkRequired('prenom');
			checkEmail('mail');
			checkRequired('message');
			checkRequired('antispam');
			if( valid=='1'){
				return true
			}else{
				alert('Veuillez remplir tous les champs du formulaire.');
				return false;
			}
		}
	}	
}

addEvent(window, 'load', init);

function filtre2(chaine,Elem) {
    strValidChars = chaine;
    ElemV = Elem.value.toUpperCase();
    var blnResult = true;
	for (i = 0; i < ElemV.length && blnResult==true; i++){
        strChar = ElemV.charAt(i);
        if (strValidChars.indexOf(strChar) <0) {
            blnResult = false;
            Elem.value = Elem.value.substr(0,i);          
        }             
    }
} 

function masqueSaisieDate(obj) {
		 var ch, chnum;
		 var ch_gauche, ch_droite;
		
		 ch = obj.value;
		 ch.toString();
		 chnum = ch.substring(ch.length-1, ch.length);
		 if (isNaN(chnum))
		 {
		 	ch = ch.substr(0, ch.length-1);
		 	obj.value = ch;
		 	return;
		 }
		 else
		 {
		 	if ( ( (ch.slice(2,3)) != ("/") ) && (ch.length >= 3) ){
			 	ch_gauche = ch.slice(0,2);
			 	ch_droite = ch.slice(2,4);
			 	if (ch_gauche > 31 || ch_gauche < 1){
			 		ch_gauche = "01";
			 	}
			 	obj.value = ch_gauche + "/" + ch_droite;
		 	}
		 	if (ch.length == 5){
		 		ch_gauche = ch.slice(0,3);
		 		ch_droite = ch.slice(3,5);
			 	if (ch_droite > 12 || ch_droite < 1){
			 		ch_droite = "01";
			 	}
			 	obj.value = ch_gauche + ch_droite;
		 	}
		 	if ( ( (ch.slice(5,6)) != ("/") ) && (ch.length >= 6) ){
			 	ch_gauche = ch.slice(0,5);
			 	ch_droite = ch.slice(5,9);
			 	obj.value = ch_gauche + "/" + ch_droite;
		 	}
		 	if(ch.length > 9){
			 	ch_gauche = ch.slice(0,6);
			 	ch_droite = ch.slice(6);
			 	if (ch_droite > 2100 || ch_droite < 1900){
			 		ch_droite = "2000";
			 		obj.value = ch_gauche + ch_droite;
			 	}
		 	}
		 	return;
		 	}	
	}


