// JavaScript Document
function rollOvers(){
	if (!document.getElementById) return
	
	var imgOriginSrc;
	var MouseOverHappened;
	var oldtop;
	var imgTemp = new Array();
	var imgarr = document.getElementsByTagName('img');
	
	for (var i = 0; i < imgarr.length; i++) {
		//Attribut hsrc pour Rollovers
		if (imgarr[i].getAttribute('hsrc')) {
			imgTemp[i] = new Image();
			imgTemp[i].src = imgarr[i].getAttribute('hsrc');
			imgarr[i].onmouseover = function() {
				imgOriginSrc = this.getAttribute('src');			
				this.setAttribute('src',this.getAttribute('hsrc'));
				MouseOverHappened=true;
			}
			imgarr[i].onmouseout = function() {
				if(MouseOverHappened)
					this.setAttribute('src',imgOriginSrc);
			}
		}
	
		//Attribut csrc pour action de click comme boutons
		if (imgarr[i].getAttribute('csrc')) {
			imgTemp[i] = new Image();
			imgTemp[i].src = imgarr[i].getAttribute('csrc');
			imgarr[i].onmousedown = function() {
				imgOriginSrc = this.getAttribute('src');			
				this.setAttribute('src',this.getAttribute('csrc'));
				MouseOverHappened=true;
			}
			imgarr[i].onmouseup = function() {
				if(MouseOverHappened)
					this.setAttribute('src',imgOriginSrc);
			}
		}
	}
}

sfHover = function() {
	var sfEls = document.getElementById("menuFirst").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	
	
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



function addEmail(courriel){
	ret = function(){
		if(ajaxOk()){
			eval(objAjax.responseText);
			killAjax();
		}
	}
	callAjax('/ajax/addemail.php?email='+courriel,ret,null);
}

function addEmailEN(courriel){
	ret = function(){
		if(ajaxOk()){
			eval(objAjax.responseText);
			killAjax();
		}
	}
	callAjax('/ajax/addemailEN.php?email='+courriel,ret,null);
}



function envoiDemande(hndl){
	if(validForm(hndl)){
		callAjax('/script/demande.php',null,$('resultat'),hndl);
	}
}

function envoiDemandeEN(hndl){
	if(validForm(hndl)){
		callAjax('/script/demandeEN.php',null,$('resultat'),hndl);
	}
}






