var admin_menu_dropdown = { init: function() { $("div#admin_menu").children("ul:first").css("display","none"); $("div#admin_menu").width("24px"); $("img#admin_menu_icon").css("margin","4px 4px 4px 2px"); $("div#admin_menu").hover( function(){admin_menu_dropdown.expand()}, function(){admin_menu_dropdown.collapse_defered()} ); $(document).keydown( function(event) { if (event.ctrlKey && event.altKey && event.shiftKey) { admin_menu_dropdown.toggle(); } } ); }, collapse_TimerID: 0, collapse_defered: function() { clearTimeout(this.collapse_TimerID); if (this.is_collapsed) return; this.collapse_TimerID = setTimeout("admin_menu_dropdown.collapse()",2000); }, collapse: function() { clearTimeout(this.collapse_TimerID); if (!this.is_ready) return; this.is_ready=false; $("div#admin_menu").children("ul:first").hide("slow", function(){$("div#admin_menu").width("24px");setTimeout("admin_menu_dropdown.is_ready=true;admin_menu_dropdown.is_collapsed=true;",100)}); }, expand: function() { clearTimeout(this.collapse_TimerID); if (!this.is_collapsed) return; if (!this.is_ready) return; this.is_ready=false; $("div#admin_menu").width("100%"); $("div#admin_menu").children("ul:first").show("slow", function(){setTimeout("admin_menu_dropdown.is_ready=true;admin_menu_dropdown.is_collapsed=false;",100)}); }, toggle: function() { if (!this.is_hidden) { $(document).ready(function(){$("div#admin_menu").hide("slow")}); $("body").css("margin-top","0px"); this.is_hidden = true; } else { $(document).ready(function(){$("div#admin_menu").width("24px");$("div#admin_menu").show()}); $("body").css("margin-top","20px"); this.is_hidden = false; } }, is_ready: true, is_collapsed: true, is_hidden: false }; if (Drupal.jsEnabled) { $(document).ready(admin_menu_dropdown.init); }