
//
// pour le menu, si utilisation jQuery, bug sur IE7 au rollout
//
sfHover = function() {
	var sfEls = document.getElementById("navigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" hover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" hover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


$(document).ready(function(){	
	//
	// pour le menu, version jQuery
	//
	/*
	$("#navigation li").hover(
		function() {
			$(this).addClass('hover');
		},
		function() {
			$(this).removeClass('hover');
		}
	);
	*/
	//
	// pour le sitemap
	//
	$("#sitemap a").each(function(i){
		var nb_ul = $("ul", $(this).parent()).length;
		if( nb_ul > 0 ) {
			var ul = $("ul", $(this).parent());
			$(this).parent().append('<span></span>');
			var span = $("span", $(this).parent());
			span.addClass("collapsed");
			span.click(function(){
				ul.toggle();
				span.toggleClass("expanded");
				span.toggleClass("collapsed");
			});
		}
	});


});

// perform JavaScript after the document is scriptable. 
$(function() { 
    // setup ul.tabs to work as tabs for each div directly under div.panes 
    $("ul.tabs").tabs("div.panes > div"); 
});

function closeMap () {
	$("#sitemap ul").each(function(i){
		$(this).hide();
	});
	$("#sitemap li span").each(function(i){
		$(this).attr("class", "collapsed");
	});
}
function openMap () {
	$("#sitemap ul").each(function(i){
		$(this).show();
	});
	$("#sitemap li span").each(function(i){
		$(this).attr("class", "expanded");
	});
}
