﻿var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open() {
    jsddm_canceltimer();
    jsddm_close();
    ddmenuitem = $(this).find('ul').css('visibility', 'visible');
}

function jsddm_close()
{ if (ddmenuitem) ddmenuitem.css('visibility', 'hidden'); }

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;

function orderddm_open() {
    orderddm_canceltimer();
    orderddm_close();
    ddmenuitem = $(this).find('ul').css('visibility', 'visible');
}

function orderddm_close()
{ if (ddmenuitem) ddmenuitem.css('visibility', 'hidden'); }

function orderddm_timer()
{ closetimer = window.setTimeout(orderddm_close, timeout); }

function orderddm_canceltimer() {
    if (closetimer) {
        window.clearTimeout(closetimer);
        closetimer = null;
    }
}

$(document).ready(function() {
    $('#orderddm > li').bind('mouseover', orderddm_open)
    $('#orderddm > li').bind('mouseout', orderddm_timer)
});

document.onclick = orderddm_close;

function profileddm_open() {
    profileddm_canceltimer();
    profileddm_close();
    ddmenuitem = $(this).find('ul').css('visibility', 'visible');
}

function profileddm_close()
{ if (ddmenuitem) ddmenuitem.css('visibility', 'hidden'); }

function profileddm_timer()
{ closetimer = window.setTimeout(profileddm_close, timeout); }

function profileddm_canceltimer() {
    if (closetimer) {
        window.clearTimeout(closetimer);
        closetimer = null;
    }
}

$(document).ready(function() {
    $('#profileddm > li').bind('mouseover', orderddm_open)
    $('#profileddm > li').bind('mouseout', orderddm_timer)
});

document.onclick = profileddm_close;


