/*
 * Require jQuery JavaScript Library v1.3.2+
 * http://jquery.com/
 *
 * Copyright © 2010 MBA Multimédia (www.mba-multimedia.com)
 * 
 *
 */

$(function(){
		
	$("#header .menuprim").hover (openPanes,closePanes);
	//closePanes();
	//$("#header .menuprim a").focus (openPanes);
	
	closeEspaceClients ();
	
	$("#espace-clients input").focus (openEspaceClients);
	
	$("#espace-clients").mouseenter (openEspaceClients);
	$("#btn-espace-clients").click (closeEspaceClients);
	
	
	if ($(".onglets").length){
		$(".onglets .tabs").tabs (".pane", {effect:'fade'});
	}
	
	if ($("#diaporama").length){
		if($(".slide").length > 1){
			diaporama();
		}
		$('#slidesContainer a.image').lightBox({fixedNavigation:true});
	}
	
	
	
});

function focusIn () {
	$(this).addClass('focus');
}
function focusOut () {
	$(this).removeClass('focus');
}
function openEspaceClients () {
	$("#espace-clients").animate ({ top:'0px' }, 100);
}

function closeEspaceClients () {
	$("#espace-clients").animate ({ top:'-40px' }, 500);
}

function openPanes () {
	var h = $("#header .panes ul").outerHeight();
	$("#header .menuprim").css({ height:44+h });
	$("#header .panes").stop().animate({ height:h }, 150);
}

function closePanes () {
	$("#header .panes").stop().animate({ height:0 }, 300, function () { 
		$("#header .menuprim").css({ height:44 }); 
		//$(".focus").removeClass('focus');
	});
}
