// Pour le Dropdown menu ... VOIR $(".dropmenu > li").adnMenu();



// Autres scripts :

function addmailing(email, lang){
	if(validMail(email.value)){
		killAjax();
		ret = function() {
			if(ajaxOk()){
				document.getElementById('liste').innerHTML = objAjax.responseText;
			}
		}
		callAjax('/script/ajax.php?what=mailing&courriel='+email.value+'&lang='+lang,ret,null);
	}
	else{
		email.focus();
		email.select();
		alert('Veuillez entrer une adresse de courriel valide.');
	}
}

function addcomment(lang, post){
	if(validForm(post)){
		killAjax();
		ret = function(){
			if(ajaxOk()){
				document.getElementById('comment_form').innerHTML = objAjax.responseText;
			}
		}
		callAjax('/script/ajax.php?what=comment&lang='+lang,ret,null,post);
	}
}

function changeSizeTxt(plus){
	if(document.getElementById("contenu") && document.getElementById("msize") && document.getElementById("psize")){
		var cH = (document.getElementById("contenu"));
		var mA = document.getElementById("msize");
		var pA = document.getElementById("psize");
		
		if(!cH.style.fontSize) cH.style.fontSize = "12px";
		var fSize = parseInt(cH.style.fontSize.replace("px",""));
		
		mA.className = "";
		pA.className = "";
		
		if(plus){
			if(fSize<17){
				fSize++;
				cH.style.fontSize = fSize+"px";
			}
		}else{
			if(fSize>10){
				fSize--;
				cH.style.fontSize = fSize+"px";
			}
		}
		
		if(fSize>=17) pA.className = "hidden";
		if(fSize<=10) mA.className = "hidden";
	}
	return false;
}

function printPage(){
	window.print();
	return false;
}


jQuery(document).ready(function(){
	jQuery("#albums a[rel='fancy']").fancybox({
		'titleShow'     : true,
		'titlePosition'	: 'float',
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'easingOut'     : 'easeInBack',
		'overlayOpacity': 0.7,
		'onComplete': function() {
			$("#fancybox-title").css({'top':'-10px', 'bottom':'auto'});
		}
	});
});


function envoiDemande(hndl){
	if(validForm(hndl)){
		callAjax('/ajax/addDemande.php',null,document.getElementById('divform'),hndl);
	}
}

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);
}


