$(document).ready(function(){
	$("ul.sf-menu").superfish({
		delay:300
	 });
	
	$('a.expand').click(function(){
		if($(this).next().is(':hidden')){
			$(this).next().show();
		} else {
			$(this).next().hide();	
		}
		//resizeLeftContent();
		return false;
	});
	
	
	//pour remplir de vert
	if ($('#col_gauche').height() < $('#col_droite').height()) {
		tmp = parseInt($('#col_droite').height() - $('#header_gauche').height());
		$('#col_gauche .txt_principal').attr('style','min-height: '+tmp+'px');
	}
	
	
	$('.expander').next().hide();
	$('.expander').each(function() {
		$(this).click(function() {
			if ($(this).next().css('display') == 'block'){
				$(this).removeClass('folder-open');
			}else{
				$(this).addClass('folder-open');
			}
			$(this).next().slideToggle("normal");
		});
	});
	
});

function resizeLeftContent(){
	
	rightContent = $('#col_droite').height();
	leftContent = $('#col_gauche').height();
	
	//console.log(leftContent);
	//console.log(rightContent);
	
	if(leftContent < rightContent){
		
		var decalage = 0;
		
		if ($('#highlight').height() != null) decalage = $('#highlight').height();	
		leftContentFixedHeight = rightContent - decalage - 45;
		$('.txt_principal').height(leftContentFixedHeight);
		
		
	} else if(leftContent >= rightContent){
		
		//$('#col_droite').height(leftContent);
		
	}
}

$(document).ready(function()
{	
    $("a.link").easyTooltip(
    {
        useElement: "next",
        clickRemove: true
    });
});
