
/* Régi menü js
$(document).ready(function() {
	
	$("ul#topnav li").hover(function() { //Hover over event on list item
		$(this).css({ 'background' : '#909090; color:#fff;'}); //Add background color + image on hovered list item
		$(this).find("span").show(); //Show the subnav
	} , function() { //on hover out...
		$(this).css({ 'background' : 'none'}); //Ditch the background
		$(this).find("span").hide(); //Hide the subnav
	});
	
});
*/

$(function() {
	$("#jsddm li ul").hover(function() {
		$(this).prev().addClass("active");	
	}, function() {
		$(this).prev().attr("class", "");
	})
});


var timeout    = 10;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open()
{  jsddm_canceltimer();
   jsddm_close();
   ddmenuitem = $(this).find('ul').css('display', 'block');
   //ddmenuitem = $(this).find('ul').slideDown(200);
}

function jsddm_close()
{  
	if(ddmenuitem) ddmenuitem.css('display', 'none');
	//if(ddmenuitem) ddmenuitem.slideUp(50);
}

function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  $('#jsddm > li').bind('mouseover', jsddm_open)
   $('#jsddm > li').bind('mouseout',  jsddm_timer)});

document.onclick = jsddm_close;

