
/* ______________________[ Gestion effet transparence menu principal et hack hover ]________________________ */
function menuHover(menu){
	menu.getElements('li').each( function( li ){
		var ul = li.getElement('ul');
		if (ul) {
		
			var fx = new Fx.Styles(ul, {
				duration: 200,
				wait: false
			});
			fx.set({'opacity': 0});

			li.addEvents({
				'mouseenter': function(){
					li.addClass("hover");
					fx.stop();
					fx.start({
						'opacity': 1
					});
				},
				'mouseleave': function(){
					li.removeClass("hover");
					fx.stop();
					fx.start({
						'opacity': 0
					});
				}
			});
		}
	});
}
/* ______________________[ 06 | Ajout de la page courante aux favoris ]________________________ */

/* Mettre la page courante en favoris MSIE and Firefox */
function addBookmark(btn) {
		if (btn) {
			var operaStr = "� Ctrl + T � pour ajouter aux favoris.";
			if (document.all && navigator.userAgent.indexOf("Opera") == -1) {
				btn.onclick = function(){
					window.external.AddFavorite(document.location, document.title);
				}
			}
			else 
				if (navigator.userAgent.indexOf("Firefox") != -1) {
					btn.onclick = function(){
						window.sidebar.addPanel(document.title, document.location, "");
					}
				}
				else 
					if (navigator.userAgent.indexOf("Opera") != -1) {
						btn.title = operaStr;
						window.status = operaStr;
					}
		}

}


/* __/* ______________________[ 02 | Gestion de la taille du texte d�un article ]________________________ */
function fontSize(cibletxt) {
	if ($("Tplus") && $("Tmoins")) {
		$("Tplus").onclick=function() {	
			var sizestr=cibletxt.style.fontSize.substring(0,cibletxt.style.fontSize.length-2);
			var sizeinter=cibletxt.style.lineHeight.substring(0,cibletxt.style.lineHeight.length-2);
			sizestr=sizestr!=""?parseInt(sizestr):12;
			cibletxt.style.fontSize=sizestr+1+"px";
		}
		$("Tmoins").onclick=function() {
			var sizestr=cibletxt.style.fontSize.substring(0,cibletxt.style.fontSize.length-2);
			var sizeinter=cibletxt.style.lineHeight.substring(0,cibletxt.style.lineHeight.length-2);
			sizestr=sizestr!=""?parseInt(sizestr):12;
			cibletxt.style.fontSize=sizestr-1+"px";
		}
	}
}


/* ______________________[ 08 | Lancement des scripts ]________________________ */

window.addEvent('domready', function(){
	
	menuHover($('NavigationPrincipale'));
	addBookmark($('favoris'));
	fontSize($('ColContenu'));
	
	/* IE 5-6 background flicker fix */
	try {
		document.execCommand('BackgroundImageCache', false, true);
	}
	catch(e){ 
	}
});


