$(document).ready(  

function()

 {
var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;


function MenuDeroulant_open()
{  
MenuDeroulant_canceltimer();
MenuDeroulant_close();
ddmenuitem = $(this).find('ul').css('visibility', 'visible');
}

function MenuDeroulant_close()
{ if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function MenuDeroulant_timer()

{  closetimer = window.setTimeout(MenuDeroulant_close, timeout);}

function MenuDeroulant_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  $('#MenuDeroulant > li').bind('mouseover', MenuDeroulant_open)
   $('#MenuDeroulant > li').bind('mouseout',  MenuDeroulant_timer)});

document.onclick = MenuDeroulant_close;




function MenuDeroulant2_open()
{  
MenuDeroulant2_canceltimer();
MenuDeroulant2_close();
ddmenuitem = $(this).find('ul').css('visibility', 'visible');
}

function MenuDeroulant2_close()
{ if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function MenuDeroulant2_timer()

{  closetimer = window.setTimeout(MenuDeroulant2_close, timeout);}

function MenuDeroulant2_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  $('#MenuDeroulant2 > li').bind('mouseover', MenuDeroulant2_open)
   $('#MenuDeroulant2 > li').bind('mouseout',  MenuDeroulant2_timer)});

document.onclick = MenuDeroulant2_close;


});


