function deroule(element, hauteur)
{
document.getElementById(element).style.display = "block";
document.getElementById(element).style.position = "relative";

}
function enleve(element)
{
document.getElementById(element).style.display = "none";
}

var obj1 = null;
var obj1_b = true;
var obj2 = null;
var obj2_b = true;
var obj3 = null;
var obj3_b = true;
var obj4 = null;
var obj4_b = true;

function checkHover1() {
	if (obj1) {
	    temp = obj1;
        temp.css("background-image", "none");
	    obj1 = null;
	    obj1_b = false;
	    temp.find('ul').slideUp(100, function(){
	        obj1_b = true;});
	}
}

function checkHover2() {
	if (obj2) {
	temp = obj2;
	obj2 = null;
        temp.css("background-image", "none");
	obj2_b = false;
		$(temp).find('ul').slideUp(100, function(){
		    temp.css("background-image", "none");
		    obj2_b = true;});
	} //if
} //checkHover

function checkHover3() {
	if (obj3) {
	temp = obj3;
	obj3 = null;
        temp.css("background-image", "none");
	obj3_b = false;
		$(temp).find('ul').slideUp(100, function(){
		    temp.css("background-image", "none");
		    obj3_b = true;});
	} //if
} //checkHover

function checkHover4() {
	if (obj4) {
	temp = obj4;
	obj4 = null;
        temp.css("background-image", "none");
	obj4_b = false;
		$(temp).find('ul').slideUp(100, function(){
		    temp.css("background-image", "none");
		    obj4_b = true;});
	} //if
} //checkHover
$(document).ready(function() {

	$('#menu1').hover(function() {
	    if(obj1_b )
	    {
            $(this).find('ul').slideDown(100, function(){obj1_b = true;});
            $(this).css("background-image", "url(../image/page/menu-top.png)");
        }
            obj1 = null;
	},
	function() {
	if(obj1_b == true)
	{
	    obj1 = $(this);
		setTimeout(
			"checkHover1()",
			250); // si vous souhaitez retarder la disparition, c'est ici*/
			}

	});

	$('#menu2').hover(function() {
	    if(obj2_b)
	    {
            $(this).css("background-image", "url(../image/page/menu-top.png)");
            $(this).find('ul').slideDown(100);
        }
        obj2 = null;
	},
	function() {
	if(obj2_b == true)
	{
	    obj2 = $(this);
		setTimeout(
			"checkHover2()",
			250); // si vous souhaitez retarder la disparition, c'est ici*/
			}

	});


	$('#menu3').hover(function() {
	if(obj3_b)
	{
        $(this).css("background-image", "url(../image/page/menu-top.png)");
        $(this).find('ul').slideDown(100);
        }
    obj3 = null;
	},
	function() {
	if(obj3_b == true)
	{
	    obj3 = $(this);
		setTimeout(
			"checkHover3()",
			250); // si vous souhaitez retarder la disparition, c'est ici*/
			}

	});


	$('#menu4').hover(function() {
	if(obj4_b)
	{
        $(this).css("background-image", "url(../image/page/menu-top.png)");
        $(this).find('ul').slideDown(100);
        }
    obj4= null;
	},
	function() {
	if(obj4_b == true)
	{
	    obj4 = $(this);
		setTimeout(
			"checkHover4()",
			250); // si vous souhaitez retarder la disparition, c'est ici*/
			}

	});

});

