1var subnav = new Array(); 2Element.extend( 3{ 4 doActive: function () { 5 this.className+=' hover'; 6 }, 7 doDeactive: function () { 8 this.className=this.className.replace(new RegExp(" hover\\b"), ""); 9 }, 10 11 hide: function(timeout) 12 { 13 this.status = 'hide'; 14 clearTimeout (this.timeout); 15 if (timeout) 16 { 17 this.timeout = setTimeout (this.animation.bind(this), timeout); 18 }else{ 19 this.animation(); 20 } 21 }, 22 23 show: function(timeout) 24 { 25 this.status = 'show'; 26 clearTimeout (this.timeout); 27 if (timeout) 28 { 29 this.timeout = setTimeout (this.animation.bind(this), timeout); 30 }else{ 31 this.animation(); 32 } 33 }, 34 animation: function() { 35 36 if ((this.status == 'hide' && this.style.left != 'auto') || (this.status == 'show' && this.style.left == 'auto' && !this.hidding)) return; 37 this.setStyle('overflow', 'hidden'); 38 if (this.status == 'show') { 39 this.hidding = 0; 40 this.hideAll(); 41 } 42 if (this.status == 'hide') 43 { 44 this.hidding = 1; 45 this.myFx2.stop(); 46 if (this.parent._id) this.myFx2.start(this.offsetWidth,0); 47 else this.myFx2.start(this.offsetHeight,0); 48 } else { 49 this.setStyle('left', 'auto'); 50 this.myFx2.stop(); 51 if (this.parent._id) this.myFx2.start(0,this.menuwidth); 52 else this.myFx2.start(0,this.menuheight); 53 } 54 }, 55 init: function() { 56 this.menuwidth = this.clientWidth; 57 this.menuheight = this.clientHeight; 58 if (this.parent._id) 59 { 60 this.myFx2 = new Fx.Style(this, 'width', {duration: 350}); 61 this.myFx2.set(0); 62 }else{ 63 this.myFx2 = new Fx.Style(this, 'height', {duration: 350}); 64 this.myFx2.set(0); 65 } 66 this.setStyle('left', '-999em'); 67 animationComplete = function(){ 68 if (this.status == 'hide') 69 { 70 this.setStyle('left', '-999em'); 71 this.hidding = 0; 72 } 73 this.setStyle('overflow', ''); 74 } 75 this.myFx2.addEvent ('onComplete', animationComplete.bind(this)); 76 }, 77 hideAll: function() { 78 for(var i=0;i<subnav.length; i++) { 79 if (!this.isChild(subnav[i])) 80 { 81 subnav[i].hide(0); 82 } 83 } 84 }, 85 isChild: function(_obj) { 86 obj = this; 87 while (obj.parent) 88 { 89 if (obj._id == _obj._id) return true; 90 obj = obj.parent; 91 } 92 return false; 93 } 94}); 95var MooMenu = new Class({ 96 initialize: function(element) 97 { 98 $A($(element).childNodes).each(function(el) 99 { 100 if(el.nodeName.toLowerCase() == 'li') 101 { 102 $A($(el).childNodes).each(function(el2) 103 { 104 if(el2.nodeName.toLowerCase() == 'ul') 105 { 106 $(el2)._id = subnav.length+1; 107 $(el2).parent = $(element); 108 subnav.push ($(el2)); 109 el2.init(); 110 el.addEvent('mouseover', function() 111 { 112 el.doActive(); 113 el2.show(0); 114 return false; 115 }); 116 el.addEvent('mouseout', function() 117 { 118 el.doDeactive(); 119 el2.hide(20); 120 }); 121 new MooMenu(el2); 122 el.hasSub = 1; 123 } 124 }); 125 if (!el.hasSub) 126 { 127 el.addEvent('mouseover', function() 128 { 129 el.doActive(); 130 return false; 131 }); 132 el.addEvent('mouseout', function() 133 { 134 el.doDeactive(); 135 }); 136 } 137 } 138 }); 139 return this; 140 } 141}); 142window.addEvent('domready',function() {new MooMenu($('menusys_moo'))});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.