/*---------------------------------------------------------------*/
/* JS pour le menu déroulant principal							 */
/*---------------------------------------------------------------*/
var obj = null;

function checkHover() {
	if (obj) {
		obj.find('.sMenu').fadeOut('fast');	
	} //if
} //checkHover

$(document).ready(function()
	{
	$('div.main_menu > ul > li:last').addClass('last');

	$('#Nav > li').hover(function()
		{
		if (obj)
			{
			obj.find('ul').fadeOut('fast');
			obj = null;
			} //if
		$(this).find('ul').fadeIn('fast');
		}, function() {
			obj = $(this);
			setTimeout(
			"checkHover()",
			0); // si vous souhaitez retarder la disparition, c'est ici
	});
});

/*--------------------------------------------------------------*/
/*	"Ajouter aux favoris"										*/
/*--------------------------------------------------------------*/
function addToFavorites(href, title)
	{
	if(navigator.appName=='Microsoft Internet Explorer')
		window.external.AddFavorite(href,title);
	else
		window.sidebar.addPanel(title,href,"");
	}

/*--------------------------------------------------------------*/
/*	Ouverture de POP-PUP										*/
/*--------------------------------------------------------------*/
function popup(href, taillex, tailley)
	{
	if(taillex!=undefined) x=taillex; else x=650;
	if(tailley!=undefined) y=tailley; else y=650;

	//alert(x+'+'+y);

	pop = window.open(href, x+'x'+y, 'top='+(((screen.height)/2)-(y/2))+', left='+(((screen.width)/2)-(x/2))+', toolbar=no, scrollbars=yes, menu=no, width='+x+', height='+y);
	pop.focus();
	}

 function update_list(layout_id, uri, node_id, selected)
 {
 	var empty = '<option>- - -</option>' ; ;
 
 	if (node_id == 0)
 	{
 		$(layout_id).html(empty) ;
 	}
 	else
 	{
	 	$.ajax({
			url: uri + node_id + '/(selected)/' + selected,
			success: function(result){
				$(layout_id).html(result) ;
     		},
     		error: function() {
     			$(layout_id).html(empty) ;
     		}
		}) ;
	}
 }