function changemois(direction,mois,annee){
	killAjax()
	ret = function() {
		if(ajaxOk()){
			document.getElementById('calendrier').innerHTML=objAjax.responseText;
			cleanCal();
		}
	}
	callAjax('/script/ajax.php?what=calendrier&dir='+direction+'&mois='+mois+'&annee='+annee,ret,null);
}

function cleanCal(){
	var a = document.getElementById('calendrier').getElementsByTagName('td');
	for(i=0;i<a.length;i++){
		if(a[i].innerHTML=='' || a[i].innerHTML=='&nbsp;'){a[i].className='vide';}
	}
}

function addmailing(email){
	if(validMail(email)){
		killAjax();
		ret = function() {
			if(ajaxOk()){
				document.getElementById('liste').innerHTML = objAjax.responseText;
				cleanCal();
			}
		}
		callAjax('/script/ajax.php?what=mailing&courriel='+email,ret,null);
	}
	else{
		document.getElementById('mailing_courriel').focus();
		document.getElementById('mailing_courriel').select();
		alert('Veuillez entrer une adresse de courriel valide.');
	}
}

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);
			}
		}
	}
}

sfHover = function() {
    var sfEls = document.getElementById("sidebar").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);


