var wlclosetime = 500; var wlcurrentmenu = 0; var wltimer = 0; function open_window_centred(win_url, win_name, win_w, win_h, styles) { var win_left = (screen.width - win_w) / 2; var win_top = (screen.height - win_h) / 2; var win_style = (styles == undefined)? '' : styles + ', '; win_style += 'width=' + win_w; win_style += ',height=' + win_h; win_style += ',left=' + win_left; win_style += ',top=' + win_top; var newwin = window.open(win_url, win_name, win_style); newwin.focus(); return; } function wlshowmenu(newmenu){ wlcancelclose(); if(wlcurrentmenu) wlcurrentmenu.style.display = 'none'; wlcurrentmenu = document.getElementById(newmenu); wlcurrentmenu.style.display = 'block'; wlcurrentmenu.style.visibility = 'visible'; } function wlclosefinal(){ wlcurrentmenu.style.display = 'none'; wlcurrentmenu.style.visibility = 'hidden'; } function wlclosemenu(newmenu){ wlcurrentmenu = document.getElementById(newmenu); wltimer = window.setTimeout(wlclosefinal, wlclosetime ); //alert(newmenu); } function wlcancelclose(){ window.clearTimeout(wltimer); wltimer= null; }