1//Dropdown menu 2var ddmenu={ 3 "outdelay":50, //milliseconds 4 'openspeed':600, //milliseconds 5 "chknavout":function(x) { 6 var a =x.prev(); 7 var ab=a.is(":hover")?"yes":"no"; 8 var xb=x.is(":hover")?"yes":"no"; 9 //console.log('chknavout:'+a.text()+'['+ab+']>nav='+x.attr('id')+'['+xb+']'); 10 if (!a.is(":hover") && !x.is(":hover")) { 11 x.removeClass('active').hide(); 12 } 13 }, 14 "ahover":function(a) { 15 var z = a.next(); 16 var xw = parseFloat(z.attr('w')); 17 var lv = z.attr('lv'); 18 var ml = parseInt(a.css('marginLeft')); 19 if (!z.hasClass('active')) { 20 $(".ddmenu nav[lv="+lv+"].active").hide().removeClass('active'); 21 z.css('width',xw+'px'); 22 switch (z.attr('dalign')) { 23 case "left": 24 var e = a.position().left+ml; 25 z.css('left',e+'px'); break; 26 case "center": 27 var e = a.position().left+ml+(a.width()/2)-(xw/2); 28 z.css('left',e+'px'); 29 break; 30 case "right": 31 var e = a.position().left+ml+a.width()-xw; 32 z.css('left',e+'px'); 33 break; 34 case "top": 35 z.css('top',a.position().top+'px'); 36 switch (z.attr('ddir')) { 37 case "left": 38 z.css('left','auto'); 39 z.css('right','100%'); 40 break; 41 case "right": 42 z.css('left','100%'); 43 break; 44 } 45 break; 46 } 47 z.stop(true).slideDown(ddmenu.openspeed); 48 z.addClass('active'); 49 } 50 }, 51 "setup":function() { 52 $(".ddmenu").each(function() { 53 var dd = $(this); 54 if ($(this).is(":visible") && !$(this).hasClass('ready')) { 55 $(this).find("a").each(function() { 56 var a = $(this); 57 var x = a.next(); 58 if (x.length>0 && x.prop('tagName')=="NAV") { //has hover menu 59 var lv = parseInt(x.attr('lv')); 60 //console.log('lv='+lv); 61 if (lv>1) { 62 var zh = "<nav id='tpnav'>"+x.html()+"</nav>"; 63 dd.append(zh); 64 var pa = x.parent().closest('nav'); 65 var pv = parseInt(pa.attr('lv')); 66 var pw = parseInt(pa.attr('w'))+1; 67 //console.log('xlv='+lv+',pv='+pv+',pw='+pw); 68 while (pv>1) { 69 pa = pa.parent().closest('nav'); 70 pv = parseInt(pa.attr('lv')); 71 //console.log('pv='+pv); 72 pw += parseInt(pa.attr('w'))+1; 73 } 74 var max = dd.width()-pw; 75 var z = $("#tpnav"); 76 //console.log('zw='+z.width()+',max='+max+',ddw='+dd.width()+',pw='+pw); 77 var zw = (max<z.width() && max>0)?max:z.width(); 78 x.attr("w",zw+1).attr("h",z.height()); 79 z.remove(); 80 } else { 81 x.attr("w",x.width()+1).attr("h",x.height()); 82 } 83 a.hover(function() { /*open*/ ddmenu.ahover($(this)); }); 84 a.mouseleave(function() { 85 setTimeout(function() { ddmenu.chknavout(x);},ddmenu.outdelay); 86 }); 87 x.mouseleave(function() { 88 setTimeout(function() { ddmenu.chknavout(x);},ddmenu.outdelay); 89 }); 90 } 91 }); 92 $(this).find("nav").css('visibility','visible').css('display','none'); 93 $(this).addClass('ready'); 94 } 95 }); 96 }, 97 "init":function() { 98 this.setup(); 99 /* $(".ddmenu").css({ 100 "right": "80px" 101 }); */ 102 $(window).resize(function() { 103 ddmenu.setup(); 104 $("body").removeClass('openesfpm'); 105 }); 106 } 107}; 108 109//Mobile Side Menu 110var esfpushm= { 111 "triggerjqs": "#btham,.esfpmask,.esfpushm a", 112 "init":function() { 113 $(".esfpushm>a").each(function() { 114 var nxt = $(this).next(); 115 if (nxt.length>0) { 116 if (nxt[0].tagName.toLowerCase()==="nav") { 117 $(this).removeAttr('href target').addClass('sub').attr('esfpnoc','yes'); 118 } 119 } 120 }); 121 $(".esfpushm>a.sub").click(function() { 122 $(this).siblings("a.open+nav").slideUp(); 123 $(this).siblings("a.open").removeClass('open'); 124 if ($(this).hasClass('open')) $(this).next('nav').slideUp(); 125 else $(this).next('nav').slideDown(); 126 $(this).toggleClass('open'); 127 }); 128 $(this.triggerjqs).click(function() { 129 if ($(this).attr('esfpnoc')!=="yes") $("body").toggleClass('openesfpm'); 130 }); 131 } 132};
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.