var menu_timeout = null; var menu_open = null; function setMenu(up) { window.menu = {"menu_A":{"show":["A"],"items":[{"url":up+"section/collages.html","name":"Collages","id":"46969"},{"url":up+"section/paintings.html","name":"Paintings","id":"A_"},{"url":up+"section/watercolors.html","name":"Watercolors","id":"W_"}]}};} function closeMenu() { if (menu_timeout != null) clearTimeout(menu_timeout); menu_timeout = null; menu_open = null; $('#menu').html(''); } function openMenuRow(id) { // What was clicked? if (this.id) { this.blur(); id = this.id; } else { $('#navigation a').each(function() { this.blur() }); } if (menu_open == id && id == 'menu_A') { closeMenu(); return false; } closeMenu(); // Show this row and its ancestors if (menu[id] == null) { //alert('menu[id] was null for '+id); return false; } var show = menu[id].show; for (i=0;i'; } else { html = html + 'link" hr' + 'ef="' + item.url + '">'; } html = html + item.name; html = html + ''; } html = html + ''; $('#menu').append(html); } //$('#menu #newest_row').hide(); //$('#menu #newest_row').fadeIn('fast'); $('#menu div.menu_item').hover( function() { $(this).addClass('menu_item_hover'); }, function() { $(this).removeClass('menu_item_hover'); } ); $('a.menu_item_open').click(openMenuRow); menu_timeout = setTimeout(closeMenu, 8000); menu_open = id; return false; } function openArtworkMenu() { var r = menu['menu_A']; if (r != null && r.items != null && r.items.length > 0) { if (r.items.length == 1 && r.items[0] != null && r.items[0].id == 'A') window.location = menu['menu_A'].items[0].url; else openMenuRow('menu_A'); } return false; }