2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
9 Ext.onReady(function(){
\r
13 function createMenu(name){
\r
14 var el = Ext.get(name+'-link');
\r
15 var tid = 0, menu, doc = Ext.getDoc();
\r
17 var handleOver = function(e, t){
\r
18 if(t != el.dom && t != menu.dom && !e.within(el) && !e.within(menu)){
\r
23 var hideMenu = function(){
\r
26 el.setStyle('text-decoration', '');
\r
27 doc.un('mouseover', handleOver);
\r
28 doc.un('mousedown', handleDown);
\r
32 var handleDown = function(e){
\r
33 if(!e.within(menu)){
\r
38 var showMenu = function(){
\r
43 menu = new Ext.Layer({shadow:'sides',hideMode: 'display'}, name+'-menu');
\r
45 menu.hideMenu = hideMenu;
\r
48 if(activeMenu && menu != activeMenu){
\r
49 activeMenu.hideMenu();
\r
53 if (!menu.isVisible()) {
\r
55 menu.alignTo(el, 'tl-bl?');
\r
57 el.setStyle('text-decoration', 'underline');
\r
59 doc.on('mouseover', handleOver, null, {buffer:150});
\r
60 doc.on('mousedown', handleDown);
\r
64 el.on('mouseover', function(e){
\r
66 tid = showMenu.defer(150);
\r
70 el.on('mouseout', function(e){
\r
71 if(tid && !e.within(el, true)){
\r
78 createMenu('products');
\r
79 createMenu('support');
\r
80 createMenu('store');
\r
83 Ext.getBody().on('click', function(e, t){
\r
87 var bd = t.next('div.expandable-body');
\r
88 bd.enableDisplayMode();
\r
89 var bdi = bd.first();
\r
90 var expanded = bd.isVisible();
\r
97 bdi.slideIn('l', {duration:.2, stopFx: true, easing:'easeOut'});
\r
100 t.update(!expanded ? 'Hide details' : 'Show details');
\r
102 }, null, {delegate:'a.expander'});
\r