PageSourceSearch

https://tacroom.nl/wp-content/themes/one-page-express/assets/js/drop_menu_selection.js?ver=1.3.60

js tacroom.nl collected 2026-10-08 05:58:20 UTC 49,435 bytes, 1,616 lines download raw bytes

1/* 
2Copyright (C) 2017 Horea Radu
3Licensed under the terms of the GPL3 license.
4*/
5
6(function ($) {
7  function bindEffect(name, params) {
8    var menu = $("ul.fm2_" + name);
9    var uls = menu.find("ul");
10    var timeout;
11
12    function getBrowser() {
13      // jquery code//
14      var ua = navigator.userAgent.toLowerCase();
15      var match =
16        /(chrome)[ \/]([\w.]+)/.exec(ua) ||
17        /(webkit)[ \/]([\w.]+)/.exec(ua) ||
18        /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
19        /(msie) ([\w.]+)/.exec(ua) ||
20        (ua.indexOf("compatible") < 0 &&
21          /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)) ||
22        [];
23      var ver = match[2] || "0";
24      var fi = ver.indexOf(".");
25      var fi2 = ver.indexOf(".", fi);
26      if (fi2 != -1) {
27        ver = parseFloat(ver.substring(0, fi2));
28      }
29      return {
30        name: match[1] || "",
31        version: ver,
32      };
33    }
34
35    function mouseLeft(el) {
36      if (!window.PIE || !PIE.Element) return;
37      var pie = PIE.Element.getInstance(el[0]);
38      if (pie) {
39        pie.mouseLeft(true);
40      }
41    }
42
43    function mouseEntered(el) {
44      if (!window.PIE || !PIE.Element) return;
45      var pie = PIE.Element.getInstance(el[0]);
46      if (pie) {
47        pie.mouseEntered(true);
48      }
49    }
50
51    function getEffectForLevel(level) {
52      switch (level) {
53        case 0:
54          return params["effectSub"];
55          break;
56        default:
57          return params["effectRest"];
58          break;
59      }
60    }
61
62    function showMenu(liItem, callback) {
63      var self = liItem;
64      if (!callback) callback = function () {};
65      if ($(self).find("ul").data("hideTimeout")) {
66        clearTimeout($(self).find("ul").data("hideTimeout"));
67      }
68      var level = getButtonLevel(self);
69      var effectObj = getEffectForLevel(level);
70      if (!effectObj) {
71        effectObj = {
72          name: "none",
73        };
74      }
75      var effectOpts = {
76        duration: effectObj.duration * 1,
77        easing: effectObj.easing,
78        direction: effectObj.direction,
79      };
80      var checkIfVisible = true;
81      var submenu = $(self).find(">ul");
82      if (submenu.length == 0) {
83        if ($(self).children(".ui-effects-wrapper").length > 0) {
84          checkIfVisible = false;
85          submenu = $(self).find(".ui-effects-wrapper >ul");
86        }
87      }
88      if (checkIfVisible && submenu.is(":visible")) {
89        return;
90      }
91      var browser = getBrowser();
92      var isIE7 = browser.name == "msie" && browser.version == 7;
93      if (isIE7) {
94        effectObj.name = "none";
95        submenu.children("li").css("float", "left");
96        if (params["menuType"] == "tabbed" && level == 0) {
97          submenu.width(menu.outerWidth());
98        }
99      }
100      switch (effectObj.name) {
101        case "none":
102          submenu.show();
103          break;
104        case "bounce":
105          if ($(self).parent().is(":animated")) {
106            return;
107          }
108        case "blind":
109        case "explode":
110        case "clip":
111        case "drop":
112        case "fold":
113        case "slide":
114          if ($(self).find("ul").is(":animated")) {
115            $(self).find("ul").removeAttr("style");
116          }
117          if (submenu.data("hideTimeout")) {
118            clearTimeout(submenu.data("hideTimeout"));
119            submenu.removeData("hideTimeout");
120          }
121          $(self).siblings().find("ul").stop(false, true);
122          window.setTimeout(function () {
123            if (submenu.css("display") != "none" && !submenu.is(":animated")) {
124              return;
125            }
126            submenu.stop(false, true);
127            if (effectObj.useFade !== "false") {
128              submenu
129                .fadeIn({
130                  duration: effectOpts.duration * 2,
131                  queue: false,
132                })
133                .css("display", "none");
134            }
135
136            if (
137              effectOpts.direction === "left" &&
138              submenu.closest("[data-direction=right]").length
139            ) {
140              effectOpts.direction = "right";
141            }
142
143            submenu.show(effectObj.name, effectOpts, function () {
144              if (effectObj.name == "fold") {
145                $(this).css({
146                  position: "",
147                  left: "",
148                  top: "",
149                  right: "",
150                  bottom: "",
151                });
152              }
153            });
154          }, 5);
155          break;
156        case "fade":
157          uls.stop(true, true);
158          submenu.show(effectObj.name, effectOpts);
159          break;
160        default:
161          uls.stop(true, false);
162          window.setTimeout(function () {
163            submenu.show(effectObj.name, effectOpts);
164          }, 5);
165      }
166    }
167
168    function hideMenu(liItem, callback) {
169      var self = liItem;
170      if (!callback) callback = function () {};
171      var level = getButtonLevel(self);
172      var effectObj = getEffectForLevel(level);
173      if (!effectObj) {
174        effectObj = {
175          name: "none",
176        };
177      }
178      var effectOpts = {
179        duration: effectObj.duration * 1,
180        easing: effectObj.easing,
181        direction: effectObj.direction,
182      };
183      var browser = getBrowser();
184      var isIE7 = browser.name == "msie" && browser.version == 7;
185      if (isIE7) {
186        effectObj.name = "none";
187      }
188      var submenu = $(self).find("ul");
189      if (submenu.length == 0) {
190        if ($(self).children(".ui-effects-wrapper").length > 0) {
191          submenu = $(self).find(".ui-effects-wrapper >ul");
192        }
193      }
194      switch (effectObj.name) {
195        case "none":
196          submenu.hide();
197          callback();
198          break;
199        case "bounce":
200          if ($(self).parent().is(":animated")) {
201            return;
202          }
203        case "blind":
204        case "explode":
205        case "clip":
206        case "drop":
207        case "fold":
208        case "slide":
209          submenu.stop(false, true);
210          if (submenu.data("hideTimeout")) {
211            clearTimeout(submenu.data("hideTimeout"));
212          }
213          var timeout = window.setTimeout(function () {
214            submenu.stop(false, true);
215            submenu.find("ul").hide();
216            if (effectObj.useFade !== "false") {
217              submenu.fadeOut({
218                duration: effectOpts.duration * 1.4,
219                queue: false,
220              });
221            }
222            submenu.hide(effectObj.name, effectOpts, function () {
223              $(this).removeAttr("style");
224              $(this).find("ul").removeAttr("style").hide();
225              callback();
226            });
227          }, 100);
228          submenu.data("hideTimeout", timeout);
229          break;
230        case "fade":
231          uls.stop(true, true);
232          $(self)
233            .find("ul")
234            .hide(effectObj.name, effectOpts, function () {
235              callback();
236            });
237          break;
238        default:
239          uls.stop(true, false);
240          if (submenu.data("hideTimeout")) {
241            clearTimeout($(self).find("ul").data("hideTimeout"));
242          }
243          var timeout = window.setTimeout(function () {
244            submenu.hide(effectObj.name, effectOpts, function () {
245              callback();
246            });
247          }, 100);
248          submenu.data("hideTimeout", timeout);
249      }
250    }
251
252    $(menu)
253      .find("li")
254      .mouseenter(function (ev) {
255        ev.preventDefault();
256        ev.stopImmediatePropagation();
257        var self = this;
258        clearTimeout(timeout);
259        try {
260          $(this)
261            .siblings()
262            .each(function () {
263              hideMenu($(this));
264            });
265        } catch (e) {}
266        showMenu($(self));
267        $(self)
268          .find("li")
269          .each(function () {
270            $(this).removeClass("hover");
271            mouseLeft($(this).children("a"));
272          });
273        $(self)
274          .siblings("li")
275          .each(function () {
276            var liItem = $(this);
277            mouseLeft($(this).children("a"), function () {
278              liItem
279                .parent()
280                .find(".hover")
281                .each(function () {
282                  $(this).removeClass("hover");
283                  mouseLeft($(this).children("a"));
284                });
285            });
286            $(this).removeClass("hover");
287          });
288        mouseEntered($(self).children("a"));
289        $(self).addClass("hover");
290        $(self)
291          .parents("li")
292          .each(function () {
293            mouseEntered($(this).children("a"));
294            $(this).addClass("hover");
295          });
296      })
297      .mouseleave(function (ev) {
298        var self = this;
299        if ($(self).find("> ul").length) {
300          clearTimeout(timeout);
301          timeout = window.setTimeout(function () {
302            hideMenu($(self), function () {
303              $(self)
304                .find("li")
305                .addBack()
306                .each(function () {
307                  $(this).removeClass("hover");
308                  mouseLeft($(this).children("a"));
309                });
310            });
311          }, 200);
312        } else {
313          clearTimeout(timeout);
314          timeout = window.setTimeout(function () {
315            $(self).removeClass("hover");
316            mouseLeft($(self).children("a"));
317          }, 0);
318        }
319      });
320  }
321
322  function unbindEffect(name) {
323    var menu = $("ul.fm2_" + name);
324    $(menu).find("li").unbind("mouseenter");
325    $(menu).find("li").unbind("mouseleave");
326  }
327
328  function getButtonLevel(selectedNode) {
329    try {
330      var upULSNo = 0;
331      while (
332        selectedNode &&
333        selectedNode[0].className != undefined &&
334        selectedNode[0].className.toLowerCase().indexOf("fm") < 0
335      ) {
336        if (
337          selectedNode[0].tagName &&
338          selectedNode[0].tagName.toLowerCase() == "ul"
339        ) {
340          upULSNo++;
341        }
342        selectedNode = $(selectedNode).parent();
343      }
344    } catch (e) {}
345    return upULSNo;
346  }
347
348  function destroy() {
349    window.flexiCssMenus = {};
350  }
351
352  function addParentSelected(liElem) {
353    var parentUl = liElem.parent();
354    if (parentUl[0].tagName && parentUl[0].tagName.toLowerCase() == "ul") {
355      var parentLi = parentUl.parent();
356      if (parentLi[0].tagName && parentLi[0].tagName.toLowerCase() == "li") {
357        parentLi.add(parentLi.children("a")).addClass("sel");
358        addParentSelected(parentLi);
359      }
360    }
361  }
362
363  function checkForButtonSelect(menu, location) {
364    var selected = false;
365    location = location.replace(window.location.search, "");
366    menu.find(".sel").removeClass("sel");
367    menu
368      .find("a")
369      .unbind("click.menuitem")
370      .bind("click.menuitem", function (event) {
371        setTimeout(function () {
372          checkForButtonSelect(menu, window.location + "");
373        }, 100);
374      });
375    if (window.location.hash) {
376      var hash = window.location.hash;
377      _hashItem = menu.find('a[href="' + hash + '"]');
378      if (_hashItem.length > 0) {
379        _hashItem.eq(0).closest("li").addBack().addClass("sel");
380        return;
381      } else {
382        _fullHashItem = menu.find('a[href="' + location + '"]');
383        if (_fullHashItem.length > 0) {
384          _fullHashItem.eq(0).closest("li").addBack().addClass("sel");
385          return;
386        }
387      }
388    }
389    // other type
390    url = (window.location + "").split("#")[0].replace(/\/$/, "");
391    _url = location.split("#")[0].replace(/\/$/, "");
392    var item = menu.find(
393      'a[href="' +
394        url +
395        '"],a[href="' +
396        url +
397        '/"],a[href="' +
398        _url +
399        '"],a[href="' +
400        _url +
401        '/"]'
402    );
403    if (item.length) {
404      item.eq(0).closest("li").addBack().addClass("sel");
405    }
406  }
407
408  function addSelectedClass(name) {
409    var currentPage = window.location.href;
410    var menu = $("ul.fm2_" + name);
411    checkForButtonSelect(menu, currentPage);
412  }
413
414  function alignMenu(name, options) {
415    if (!options || !options["align"] || options["align"] == "left") {
416      return;
417    }
418    var align = options["align"];
419    var menu = $("ul.fm2_" + name);
420    var container = menu.parent();
421    switch (align) {
422      case "center":
423        var containerWidth = $(container).outerWidth(true, false);
424        $(container).css({
425          float: "none",
426          width: containerWidth + "px",
427          "margin-left": "auto",
428          "margin-right": "auto",
429        });
430        break;
431      case "right":
432        if ($(container).css("float") == "left") {
433          $(container).css({
434            float: "right",
435          });
436        }
437    }
438  }
439
440  if (!window.flexiCssMenus) window.flexiCssMenus = {};
441  window.flexiCssMenus.bindEffect = bindEffect;
442  window.flexiCssMenus.addSelectedClass = addSelectedClass;
443  window.flexiCssMenus.unbindEffect = unbindEffect;
444  window.flexiCssMenus.alignMenu = alignMenu;
445})(jQuery);
446(function ($) {
447  //css menus touch devices//
448  var CSSMenus;
449  if (!CSSMenus) {
450    CSSMenus = new Object();
451  }
452  // Set the user aggent into our own variable.
453  CSSMenus.UserAgent = navigator.userAgent.toLowerCase();
454  /*
455   *	IsMobile() - Returns true if this is a mobile device.
456   */
457  CSSMenus.IsMobile = function (viewportWidth, maxWidth) {
458    if (window.navMenuForceDesktop) {
459      return false;
460    }
461
462    var deviceMatch =
463      /iphone|ipod|android|blackberry|mini|windows\sce|windows\sphone|iemobile|palm|webos|series60|symbianos|meego/i.test(
464        CSSMenus.UserAgent
465      );
466    var sizeMatch;
467    var isLTIE9 =
468      window.flexiCssMenus.browser.name == "msie" &&
469      window.flexiCssMenus.browser.version < 9;
470    if (window.matchMedia && !isLTIE9) {
471      sizeMatch = window.matchMedia("(max-width:" + maxWidth + "px)").matches;
472    } else {
473      sizeMatch = viewportWidth < maxWidth;
474    }
475    //console.log('mobile match ' + deviceMatch + " .. " + sizeMatch)
476    return deviceMatch || sizeMatch;
477  };
478  /*
479   *	IsTablet() - Return true if this is a tablet device.
480   */
481  CSSMenus.IsTablet = function (viewportWidth, minWidth, maxWidth) {
482    if (window.navMenuForceDesktop) {
483      return false;
484    }
485
486    var UA = CSSMenus.UserAgent;
487    var is_touch_device = "ontouchstart" in document.documentElement;
488    /*if (UA.indexOf("android") != -1 && UA.indexOf("mobile") == -1)
489        	return true;
490        */
491    var deviceMatch = /ipad|Win64|tablet/i.test(UA);
492    var sizeMatch;
493    var isLTIE9 =
494      window.flexiCssMenus.browser.name == "msie" &&
495      window.flexiCssMenus.browser.version < 9;
496    if (!isLTIE9 && window.matchMedia) {
497      sizeMatch = window.matchMedia(
498        "(max-width:" +
499          maxWidth +
500          "px) and (min-width:" +
501          (minWidth + 1) +
502          "px)"
503      ).matches;
504      //console.log('tablet match ' + sizeMatch + " -- " + "(max-width:" + (maxWidth-1) + "px) and (min-width:" + minWidth + "px)");
505    } else {
506      sizeMatch = viewportWidth < maxWidth && viewportWidth >= minWidth;
507    }
508    //alert('device match ' + deviceMatch + ".. " + sizeMatch+ " .. touch device " + is_touch_device);
509    return is_touch_device && (deviceMatch || sizeMatch);
510  };
511  CSSMenus.IsAppleProduct = function () {
512    return /iphone|ipod|ipad/i.test(CSSMenus.UserAgent);
513  };
514
515  function xtdCSSMenuInit(Name, options) {
516    // If this is a mobile device we want to show one of our menus
517    // either the one for small devices or for devices with higher resolution.
518    var viewportWidth = window.flexiCssMenus.correctedViewportW();
519    //console.log(viewportWidth + " .. " + options.mobileMaxWidth + " > " + CSSMenus.IsTablet(viewportWidth, options.mobileMaxWidth, options.tabletMaxWidth));
520    var mobileCheck = CSSMenus.IsMobile(viewportWidth, options.mobileMaxWidth);
521    var isMobileDevice = options.enableMobile && mobileCheck;
522    var tabletCheck = CSSMenus.IsTablet(
523      viewportWidth,
524      options.mobileMaxWidth,
525      options.tabletMaxWidth
526    );
527    var isTabletDevice =
528      (options.enableTablet && tabletCheck) ||
529      (!options.enableMobile && mobileCheck);
530    //alert('mobile device ' + isMobileDevice + " .. tablet device " + isTabletDevice);
531
532    $("#" + Name + "_container > ul")
533      .children("li")
534      .each(function () {
535        if (this.getBoundingClientRect().left + 400 > window.innerWidth) {
536          $(this).attr("data-direction", "right");
537        } else {
538          $(this).removeAttr("data-direction");
539        }
540      });
541
542    if (isMobileDevice || isTabletDevice) {
543      try {
544        if (isTabletDevice) {
545          $("#" + Name + "_container").show();
546          $("#fm2_" + Name + "_mobile_button").hide();
547
548          window.addEventListener(
549            "touchstart",
550            function setHasTouch() {
551              xtdSetTabletBehavior("#" + Name + "_container", options);
552              window.removeEventListener("touchstart", setHasTouch);
553            },
554            false
555          );
556
557          flexiCssMenus.alignMenu(Name, options);
558
559          CSSMenus.flexiCSSMenus_currentLevel = -1;
560          CSSMenus.flexiCSSMenus_currentButton = null;
561          $("#" + Name + "_container")
562            .find("li.hover")
563            .removeClass("hover");
564          $("#" + Name + "_container")
565            .find("ul.sub-menu")
566            .hide();
567
568          return false;
569        } else {
570          var BtnParent = $("body");
571          var Menu = new XTDMobileMenu(Name);
572          // Initialize the menu
573          Menu.Init(options);
574          Menu.Create(BtnParent);
575          $("#" + Name + "_container").hide();
576          $("#fm2_" + Name + "_mobile_button").css("display", "block");
577        }
578      } catch (e) {
579        // Something went wrong.
580        //console.error(e);
581        return false;
582      }
583      // The banner was succesus fully been created.
584      return true;
585    } else {
586      $("#" + Name + "_container").show();
587      $("#fm2_" + Name + "_mobile_button").hide();
588    }
589    // Something wrong happened.
590    return false;
591  }
592
593  /*
594   *	***	Tablet menu section. It binds the events for mouseenter and click for each button
595   *	***	which has a submenu.
596   *
597   *	xtdSetTabletBehavior() - set tablet behaviour
598   *
599   *	@param: elem - the jquery object representing the menu to modify.
600   *	@param: options - object with settings for the close button
601   */
602  function xtdSetTabletBehavior(elem, options) {
603    var children = $(elem).children();
604    for (var i = 0; i < children.length; i++) {
605      if (children[i].tagName && children[i].tagName.toLowerCase() == "li") {
606        if (children[i].className.toLowerCase().indexOf("fm_close") == -1) {
607          children
608            .eq(i)
609            .bind("touchend", flexiCSSMenus_clickHandlerForTouchDevices);
610          children.eq(i).bind("mouseover", function () {
611            CSSMenus.flexiCSSMenus_currentButton = null;
612          });
613        } else {
614          children
615            .eq(i)
616            .bind("touchend", flexiCSSMenus_clickHandlerForCloseButton);
617        }
618      }
619      if (
620        children[i].tagName &&
621        children[i].tagName.toLowerCase() == "ul" &&
622        flexiCSSMenus_getButtonLevel($(children[i])) > 0 &&
623        options.tabletCloseBtnEnable != false
624      ) {
625        var closeLabel;
626        if (options.tabletCloseBtnLabel) {
627          closeLabel = options.tabletCloseBtnLabel;
628        } else {
629          closeLabel = "Close";
630        }
631        var liHtml =
632          "<a href='#' data-name='close-button' target='_self'><font class='leaf'>" +
633          closeLabel +
634          "</font></a>";
635        var closeLI = $("<li/>").addClass("FM_CLOSE").html(liHtml);
636        if (children.eq(i).find('[data-name="close-button"]').length === 0) {
637          children.eq(i).append(closeLI);
638        }
639      }
640      xtdSetTabletBehavior(children.get(i), options);
641    }
642  }
643
644  function xtdUnsetTabletBehavior(elem) {
645    var children = $(elem).children();
646    for (var i = 0; i < children.length; i++) {
647      children.eq(i).unbind("click");
648      xtdUnsetTabletBehavior(children.get(i));
649    }
650  }
651
652  CSSMenus.flexiCSSMenus_currentButton = undefined;
653  CSSMenus.flexiCSSMenus_currentLevel = -1;
654
655  /*
656   *	If it's ipad, remove the mouseover event.
657   */
658  function flexiCSSMenus_mouseEnterHandlerForIpad(event) {}
659
660  /*
661   *	Method which is called when somebody clicks on a option.
662   */
663  function flexiCSSMenus_clickHandlerForTouchDevices(event) {
664    var submenu = $(this).find("ul").eq(0);
665    var hasSubmenu = submenu.length > 0;
666    var isCurrentButton =
667      CSSMenus.flexiCSSMenus_currentButton &&
668      jQuery(CSSMenus.flexiCSSMenus_currentButton).is(this);
669
670    event.stopPropagation();
671
672    // is double tapped or has no submenu
673    if (isCurrentButton || !hasSubmenu) {
674      console.log("I am here");
675      var buttons = $(this).parentsUntil("ul.fm2_drop_mainmenu").filter("li");
676
677      buttons.each(function () {
678        flexiCSSMenus_deselectButton($(this));
679      });
680
681      CSSMenus.flexiCSSMenus_currentButton = undefined;
682      CSSMenus.flexiCSSMenus_currentLevel = 0;
683
684      return;
685    }
686
687    // continue to submenus
688    event.preventDefault();
689    var node, level;
690    try {
691      level = flexiCSSMenus_getButtonLevel($(this));
692    } catch (e) {
693      alert("error 2");
694    }
695    if (level > CSSMenus.flexiCSSMenus_currentLevel) {
696      CSSMenus.flexiCSSMenus_currentButton = $(this);
697      if (level > 0) {
698        node = CSSMenus.flexiCSSMenus_currentButton.parent();
699        while (
700          level > CSSMenus.flexiCSSMenus_currentLevel &&
701          node.get(0).className.toLowerCase().indexOf("fm") < 0
702        ) {
703          if (
704            node.get(0).tagName &&
705            node.get(0).tagName.toLowerCase() == "li"
706          ) {
707            flexiCSSMenus_selectButton($(node));
708            CSSMenus.flexiCSSMenus_currentLevel--;
709          }
710          node = node.parent();
711        }
712      }
713      flexiCSSMenus_selectButton($(CSSMenus.flexiCSSMenus_currentButton));
714      CSSMenus.flexiCSSMenus_currentLevel = level;
715
716      return;
717    }
718    if (level == CSSMenus.flexiCSSMenus_currentLevel) {
719      try {
720        flexiCSSMenus_deselectButton(CSSMenus.flexiCSSMenus_currentButton);
721        CSSMenus.flexiCSSMenus_currentButton = $(this);
722        CSSMenus.flexiCSSMenus_currentLevel = level;
723        flexiCSSMenus_selectButton($(CSSMenus.flexiCSSMenus_currentButton));
724      } catch (e) {}
725      return;
726    }
727    if (level < CSSMenus.flexiCSSMenus_currentLevel) {
728      //flexiCSSMenus_deselectButton(CSSMenus.flexiCSSMenus_currentButton);
729      while (level < CSSMenus.flexiCSSMenus_currentLevel) {
730        CSSMenus.flexiCSSMenus_currentButton =
731          CSSMenus.flexiCSSMenus_currentButton.parent();
732        if (
733          CSSMenus.flexiCSSMenus_currentButton.get(0).tagName &&
734          CSSMenus.flexiCSSMenus_currentButton.get(0).tagName.toLowerCase() ==
735            "li"
736        ) {
737          flexiCSSMenus_deselectButton(CSSMenus.flexiCSSMenus_currentButton);
738          CSSMenus.flexiCSSMenus_currentLevel--;
739        }
740      }
741      CSSMenus.flexiCSSMenus_currentButton = $(this);
742      CSSMenus.flexiCSSMenus_currentLevel = level;
743      flexiCSSMenus_selectButton($(CSSMenus.flexiCSSMenus_currentButton));
744
745      return;
746    }
747  }
748
749  /*
750   *	Set behaviour for close button
751   */
752  function flexiCSSMenus_clickHandlerForCloseButton(event) {
753    var parentNode = $(this).parent().parent();
754    if (event.stopPropagation) event.stopPropagation();
755    event.preventDefault();
756    flexiCSSMenus_deselectButton(parentNode);
757    try {
758      var level = flexiCSSMenus_getButtonLevel(parentNode);
759    } catch (e) {
760      //console.error(e);
761    }
762    if (level > 0) {
763      CSSMenus.flexiCSSMenus_currentButton = parentNode.parent().parent();
764    } else {
765      CSSMenus.flexiCSSMenus_currentButton = undefined;
766    }
767    CSSMenus.flexiCSSMenus_currentLevel = level - 1;
768  }
769
770  /*
771   *	Removes the "hovered" class and sets the "current level" and "current selected button"
772   *	to the correct values
773   */
774  function flexiCSSMenus_deselectButton(button) {
775    try {
776      if (button && button.length) {
777        button.removeClass(".hover");
778        button.find("a").removeAttr("class");
779        var submenu = button.find("ul").eq(0);
780
781        if (submenu.length > 0) {
782          button.removeAttr("class");
783          hideSubmenu(submenu);
784          var hovered = submenu.find(".hover").eq(0);
785          if (hovered.length > 0) {
786            flexiCSSMenus_deselectButton(hovered);
787          }
788          submenu.find("li").css("position", "relative");
789        }
790      }
791    } catch (e) {
792      // console.error(e);
793    }
794  }
795
796  function flexiCSSMenus_selectButton(button) {
797    try {
798      var submenu = button.find("ul");
799      submenu.eq(0).css("z-index", "1");
800      if (submenu.length > 0) {
801        button.addClass("hover");
802        showSubmenu(submenu.eq(0));
803        var lis = submenu.eq(0).find("li");
804        for (var i = 0; i < lis.length; i++) {
805          lis.eq(i).css("position", "relative");
806        }
807      }
808    } catch (e) {
809      alert("error 1##" + e);
810    }
811  }
812
813  function flexiCSSMenus_getButtonLevel(selectedNode) {
814    try {
815      var upULSNo = 0;
816      while (
817        selectedNode &&
818        selectedNode[0].className != undefined &&
819        selectedNode[0].className.toLowerCase().indexOf("fm") < 0
820      ) {
821        if (
822          selectedNode[0].tagName &&
823          selectedNode[0].tagName.toLowerCase() == "ul"
824        ) {
825          upULSNo++;
826        }
827        selectedNode = $(selectedNode).parent();
828      }
829    } catch (e) {}
830    return upULSNo;
831  }
832
833  function flexiCSSMenus_getButtonMenu(selectedNode) {
834    try {
835      var upULSNo = 0;
836      while (
837        selectedNode &&
838        (selectedNode[0].className.toLowerCase().indexOf("fm2_") == -1 ||
839          selectedNode[0].className.toLowerCase().indexOf("_container") == -1)
840      ) {
841        selectedNode = selectedNode.parent();
842      }
843    } catch (e) {}
844    return selectedNode;
845  }
846
847  function showSubmenu(el) {
848    var uls = $("#" + CSSMenus.name + "_container").find("ul");
849    if (el.is(":animated") || el.get(0) == $("#" + CSSMenus.name).get(0)) {
850      return;
851    }
852    if (flexiCssMenus.settings.effect == "none") {
853      el.show();
854    } else {
855      el.show(
856        flexiCssMenus.settings.effect,
857        flexiCssMenus.settings.options,
858        200
859      );
860    }
861  }
862
863  function hideSubmenu(el) {
864    function hide() {
865      if (el.is(":animated") || el.get(0) == $("#" + CSSMenus.name).get(0)) {
866        return;
867      }
868
869      if (
870        flexiCssMenus.settings.effect &&
871        flexiCssMenus.settings.effect != "none"
872      ) {
873        el.hide(
874          flexiCssMenus.settings.effect,
875          flexiCssMenus.settings.options,
876          200
877        );
878      } else {
879        el.hide();
880      }
881    }
882
883    // delay the hide functionality to allow events triggering on IPad
884    setTimeout(hide, 500);
885  }
886
887  /**
888   **    End of tablet menu operations
889   **/
890
891  /*
892   *	Mobile menu generation
893   *
894   *	XTDMobileMenu() - Class which creates and handles a javascript menu for small mobile devices.
895   */
896  function XTDMobileMenu(MenuName) {
897    /* Private variables */
898    var Self = this;
899    var Parent = null;
900    var MenuName = MenuName;
901    var Options = null;
902    var MenuButton = null;
903    var MainContainer = null;
904    var MainMenu = null;
905    var mobileOverlay = null;
906    var Container = null;
907    var Header = null;
908    var MainUL = null;
909    var Visible = false;
910    var mainMenuHeader = null;
911    var presets = {
912      fixed: {
913        effect: "fade",
914        overlay: true,
915      },
916      relative: {
917        effect: "slideUp",
918        overlay: true,
919      },
920      push: {
921        effect: "slideLeft",
922        overlay: false,
923      },
924    };
925    window.flexiCssMenus.presetSettings = null;
926    /*
927     *	Init() - Initialize menu data.
928     */
929    this.Init = function (initObj) {
930      Options = {
931        FontColor: "#fff",
932        FontShadowColor: "#000",
933        NormalColor: "#ff0000",
934        HoverColor: "#DADADA",
935      };
936      if (initObj) {
937        for (var i in initObj) {
938          Options[i] = initObj[i];
939        }
940      }
941      window.flexiCssMenus.presetSettings = presets[Options.preset];
942    };
943    /*
944     *	Create() - Create the menu with the given settings.
945     */
946    this.Create = function (ButtonParent, onResize) {
947      if (document.readyState !== "complete") {
948        $(document).ready(function () {
949          CreateMainButton(ButtonParent);
950          var overlayHeight = Math.max(
951            $("body").outerHeight() + 13,
952            $(window).height(),
953            $(document).outerHeight()
954          );
955          var overlayWidth = Math.max(
956            $("body").outerWidth(),
957            $(window).width(),
958            $(document).width()
959          );
960          createStructure();
961          $(mobileOverlay).height(overlayHeight);
962          $(mobileOverlay).width(overlayWidth);
963        });
964      } else {
965        var overlayHeight = Math.max(
966          $("body").outerHeight() + 13,
967          $(window).height(),
968          $(document).outerHeight()
969        );
970        var overlayWidth = Math.max(
971          $("body").outerWidth(),
972          $(window).width(),
973          $(document).width()
974        );
975        CreateMainButton(ButtonParent);
976        createStructure();
977        $(mobileOverlay).height(overlayHeight);
978        $(mobileOverlay).width(overlayWidth);
979      }
980    };
981
982    function createStructure() {
983      mobileOverlay = document.createElement("div");
984      $(mobileOverlay).addClass(
985        "fm2_" +
986          MenuName +
987          "_mobile-overlay fm2_" +
988          MenuName +
989          "_mobile-overlay-hide mobile-overlay"
990      );
991      $(mobileOverlay).css("padding-top", $("body").offset().top + "px");
992      $(mobileOverlay)
993        .mousedown(function (ev) {
994          ev.preventDefault();
995        })
996        .click(function () {
997          if (Visible) {
998            Self.Show((Visible = !Visible));
999          }
1000        });
1001      MainContainer = document.createElement("div");
1002      MainContainer.setAttribute("id", "fm2_" + MenuName + "_jq_menu_back");
1003      MainContainer.setAttribute(
1004        "class",
1005        "fm2_mobile_jq_menu ui-main-container ui-corner-all ui-mobile-viewports"
1006      );
1007      MainContainer.style.zIndex = "10005";
1008      Container = document.createElement("div");
1009      Container.setAttribute("class", "menu-container");
1010      MainMenu = document.createElement("div");
1011      MainMenu.className = "menu main-menu";
1012      mainMenuHeader = createMainMenuHeader("Menu");
1013      MainContainer.appendChild(mainMenuHeader);
1014      var ItemList = CreateItemList();
1015      MainMenu.appendChild(ItemList);
1016      Container.appendChild(MainMenu);
1017      MainContainer.appendChild(Container);
1018      // Append the main container.
1019      Parent = document.getElementsByTagName("body")[0];
1020      if (Options.preset == "fixed") {
1021        mobileOverlay.appendChild(MainContainer);
1022        Parent.appendChild(mobileOverlay);
1023      } else {
1024        $(MenuButton).after($(MainContainer));
1025      }
1026      if (Options.preset != "relative") {
1027        if (Options.preset == "push") {
1028          MainMenu.style.marginTop =
1029            parseInt($(mainMenuHeader).outerHeight(true)) + "px";
1030        }
1031        var calcHeight =
1032          parseInt($(Container).height()) +
1033          parseInt($(mainMenuHeader).outerHeight());
1034        if (Options.preset == "push") {
1035          MainContainer.style.height =
1036            Math.max(
1037              $("body").outerWidth(),
1038              $(window).width(),
1039              $(document).width()
1040            ) + "px";
1041          Container.style.height = calcHeight + "px";
1042        }
1043      }
1044      $(MainContainer).hide();
1045      // Set the links callback.
1046      UpdateLinks();
1047      GetCurrentItem();
1048      Self.Update();
1049    }
1050
1051    /*
1052     *	Show() - Show the menu
1053     */
1054    this.Show = function (Visible) {
1055      if (Visible) {
1056        $(mobileOverlay).removeClass(
1057          "fm2_" + MenuName + "_mobile-overlay-hide"
1058        );
1059        var overlayWidth = Math.max(
1060          $("body").outerWidth(),
1061          $(window).width(),
1062          $(document).width()
1063        );
1064        $(mobileOverlay).width(overlayWidth);
1065        $(MainContainer)
1066          .fadeIn("fast")
1067          .css({
1068            top: $(window).scrollTop(),
1069            left: $("body").css("margin-left"),
1070          });
1071        var overlayHeight = Math.max(
1072          $("body").outerHeight() + 13,
1073          $(window).height(),
1074          $(document).outerHeight()
1075        );
1076        var containerHeight =
1077          $(Container).height() + $(window).scrollTop() + 300;
1078        $(mobileOverlay).height(Math.max(overlayHeight, containerHeight));
1079      } else {
1080        $(mobileOverlay).addClass("fm2_" + MenuName + "_mobile-overlay-hide");
1081        $(MainContainer).fadeOut("fast", function () {
1082          $(MainContainer).find(".submenu").remove();
1083          $(MainContainer).find(".menu").css("width", "").show();
1084        });
1085      }
1086    };
1087    /*
1088     *	ShowHeader() - Show/Hide the header.
1089     *
1090     *	PARAMETERS:
1091     *		Visible - Specifies if this should be visible or not.
1092     */
1093    this.ShowHeader = function (Visible) {
1094      if (Visible) $(Header).show();
1095      else $(Header).hide();
1096    };
1097    /*
1098     *	GoToSubmenu() - Go to the specified submenu.
1099     */
1100    this.GoToSubmenu = function (ParentID, Current) {
1101      if ($(Current).parent().has("ul").length) {
1102        var Submenu = document.createElement("div");
1103        Submenu.setAttribute("class", "menu submenu");
1104        var UlElement = $(Current).parent().children("ul").clone(true, true);
1105        // Save these to know which submenu to set to header.
1106        UlElement.attr("elcaption", $(Current).text());
1107        UlElement.attr("ellink", $(Current).attr("href"));
1108        UlElement.attr("eltarget", $(Current).attr("target"));
1109        UlElement.show();
1110        var newHeader = CreateHeader(
1111          $(Current).text(),
1112          $(Current).attr("href")
1113        );
1114        Submenu.appendChild(newHeader);
1115        UlElement.appendTo($(Submenu));
1116        $(Submenu).appendTo(Container);
1117        var containerWidth = parseInt($(MainContainer).width());
1118        Submenu.style.width = containerWidth + "px";
1119        $(Container).children(".menu").eq(-1).css("width", containerWidth);
1120        $(Container).children(".menu").eq(-2).css("width", containerWidth);
1121        Container.style.width = 2 * containerWidth + 2 + "px";
1122        switch (window.flexiCssMenus.presetSettings.effect) {
1123          case "fade":
1124            $(Container).animate(
1125              {
1126                display: "none",
1127              },
1128              1,
1129              "swing",
1130              function () {
1131                $(Container).children(".menu").eq(-2).hide();
1132                $(Container).css({
1133                  width: "",
1134                  left: "",
1135                });
1136                $(Container).children(".menu").eq(-1).css("opacity", 0).animate(
1137                  {
1138                    opacity: 1,
1139                  },
1140                  150
1141                );
1142              }
1143            );
1144            break;
1145        }
1146      }
1147    };
1148    /*
1149     *	GoBack() - Go back to the previous menu submenu.
1150     */
1151    this.GoBack = function (Current) {
1152      if ($(Container).children(".menu").length > 1) {
1153        var containerWidth = parseInt($(MainContainer).width());
1154        $(Container)
1155          .children(".menu")
1156          .eq(-1)
1157          .css("width", containerWidth + "px");
1158        $(Container)
1159          .children(".menu")
1160          .eq(-2)
1161          .show()
1162          .css("width", containerWidth + "px");
1163        $(Container).css({
1164          width: 2 * containerWidth + "px",
1165          left: "-" + containerWidth + "px",
1166        });
1167        switch (window.flexiCssMenus.presetSettings.effect) {
1168          case "fade":
1169            $(Container).animate(
1170              {
1171                opacity: 1,
1172              },
1173              1,
1174              "swing",
1175              function () {
1176                $(Container).children(".menu").last().remove();
1177                $(Container).css({
1178                  width: "",
1179                  left: "",
1180                });
1181                $(Container).children(".menu").eq(-1).css("opacity", 0).animate(
1182                  {
1183                    opacity: 1,
1184                  },
1185                  150
1186                );
1187              }
1188            );
1189            break;
1190        }
1191      }
1192    };
1193    /*
1194     *	SetOptions() - Set Menu options.
1195     */
1196    this.SetOptions = function (Value) {
1197      Options = $.extend(true, Options, Value);
1198      // Update menu with the new options.
1199      Self.Update();
1200    };
1201    /*
1202     *	Update() - Update the menu.
1203     */
1204    this.Update = function () {
1205      if ($(Container).children("ul").length == 1) {
1206        $(Header).children("a.back-btn").css("display", "none");
1207      }
1208    };
1209    /* Private functions */
1210
1211    /*
1212     *	CreateMainButton() - Create the Level 0 button.
1213     */
1214    function CreateMainButton(Parent) {
1215      // search the page for already created button
1216      var btn = $("#fm2_" + MenuName + "_mobile_button");
1217      if (btn.length > 0) {
1218        btn.attr("href", "#").removeAttr("style");
1219        MenuButton = btn[0];
1220      } else {
1221        // create a new button
1222        MenuButton = document.createElement("a");
1223        MenuButton.innerHTML +=
1224          "<span class='down-arrow'>&#x25BC;</span><span class='caption'>Menu</span>";
1225        MenuButton.setAttribute("href", "#");
1226        MenuButton.setAttribute("id", "fm2_" + MenuName + "_mobile_button");
1227        $(MenuButton).addClass("fm2_mobile_button").appendTo(Parent);
1228      }
1229      $(MenuButton)
1230        .unbind("click")
1231        .click(function (ev) {
1232          ev.preventDefault();
1233          ev.stopPropagation();
1234          // Toggle visible.
1235          Self.Show((Visible = !Visible));
1236          var opeEvent = "ope-mobile-menu-" + (Visible ? "show" : "hide");
1237          jQuery(document).trigger(opeEvent);
1238        });
1239    }
1240
1241    /*
1242     *	CreateHeader() - Create the menu header.
1243     */
1244    function CreateHeader(Caption, Link) {
1245      var Header = document.createElement("div");
1246      var BackBtn = document.createElement("a");
1247      var CloseBtn = document.createElement("a");
1248      var Title = document.createElement("p");
1249      Header.setAttribute("id", MenuName + "_jq_menu_header");
1250      Header.setAttribute("class", "menu-header");
1251      BackBtn.setAttribute("href", "javascript: void(0);");
1252      BackBtn.setAttribute("class", "back-btn");
1253      $(BackBtn).click(function (ev) {
1254        ev.stopPropagation();
1255        // Go back.
1256        Self.GoBack();
1257      });
1258      Title.innerHTML = "<a href='" + Link + "''>" + Caption + "</a>";
1259      Header.appendChild(BackBtn);
1260      Header.appendChild(Title);
1261      return Header;
1262    }
1263
1264    function createMainMenuHeader(caption) {
1265      var Header = document.createElement("div");
1266      Header.setAttribute("class", "main-menu-header");
1267      $(Header).click(function (ev) {
1268        ev.preventDefault();
1269        ev.stopPropagation();
1270        // Toggle visible.
1271        Self.Show((Visible = !Visible));
1272      });
1273      return Header;
1274    }
1275
1276    /*
1277     *	GetCurrentItem() - Get the current item from link.
1278     */
1279    function GetCurrentItem() {
1280      var MenuItem = "Menu";
1281      $(Container)
1282        .children("ul")
1283        .find("a")
1284        .each(function () {
1285          if ($(this).attr("href") == window.location) {
1286            MenuItem = $(this).children("p").html();
1287          }
1288        });
1289      $(MenuButton)
1290        .children("span.caption")
1291        .children("p.xtd_menu_ellipsis")
1292        .html(MenuItem);
1293    }
1294
1295    /*
1296     *	CreateItemList() - Create a list with all menu/submenu items.
1297     */
1298    function CreateItemList(Structure) {
1299      var Structure =
1300        typeof Structure != "undefined"
1301          ? Structure
1302          : $("#" + MenuName + "_container > ul > li");
1303      var ULElement = document.createElement("ul");
1304      Structure.each(function (Index) {
1305        var LiElement = document.createElement("li");
1306        var AElement = null;
1307        LiElement.className = "ellipsis";
1308        // Clone the original a element
1309        AElement = $(this).children("a").clone().appendTo($(LiElement));
1310        if ($(this).children("ul").length) {
1311          AElement.html('<span class="branch">' + AElement.html() + "</span>");
1312        } else {
1313          AElement.html('<font class="leaf">' + AElement.html() + "</font>");
1314        }
1315        // Add a paragraph for ellipsis to work.
1316        AElement.html(
1317          '<p class="xtd_menu_ellipsis">' + AElement.html() + "</p>"
1318        );
1319        if ($(this).children("ul").length) {
1320          // Recursive call for the child elements.
1321          var NewUL = CreateItemList($(this).children("ul").children("li"));
1322          NewUL.style.display = "none";
1323          LiElement.appendChild(NewUL);
1324        }
1325        ULElement.appendChild(LiElement);
1326      });
1327      return ULElement;
1328    }
1329
1330    /*
1331     *	UpdateLinks() - Update the jquery click event.
1332     */
1333    function UpdateLinks(Cont) {
1334      var ObjContainer = Cont != undefined ? Cont : MainMenu;
1335      // Do some init here.
1336      $(ObjContainer)
1337        .children("ul")
1338        .find("li")
1339        .click(function (event) {
1340          var elem = $(this).children("a");
1341          if ($(MainContainer).find(".menu").filter(":visible").length > 1) {
1342            //console.log($(".menu").filter(":visible").length);
1343            return;
1344          }
1345          // Check if it has a child so we know if we execute the link or the child.
1346          event.preventDefault();
1347          event.stopPropagation();
1348
1349          if (elem.data().smoothscroll) {
1350            if (
1351              !elem.data("onepage-section") &&
1352              window.smoothScrollGetAnchors
1353            ) {
1354              window.smoothScrollGetAnchors();
1355            }
1356            Visible = false;
1357            Self.Show(Visible);
1358            elem.trigger("click.onepage");
1359            return;
1360          }
1361
1362          if (elem.parent().has("ul").length) {
1363            Self.GoToSubmenu("", elem);
1364            event.preventDefault();
1365            event.stopPropagation();
1366          } else {
1367            if (elem.length > 0 && elem.attr("href")) {
1368              window.location = elem.attr("href");
1369            }
1370            $(MenuButton)
1371              .children("span.caption")
1372              .children("p.xtd_menu_ellipsis")
1373              .html(elem.children("p").html());
1374            if (Visible) {
1375              Self.Show((Visible = !Visible));
1376            }
1377          }
1378        })
1379        .on("touchstart", function () {
1380          $(this).addClass("clicked");
1381        })
1382        .on("touchend", function () {
1383          $(this).removeClass("clicked");
1384        })
1385        .on("touchmove", function () {
1386          $(this).removeClass("clicked");
1387        });
1388    }
1389
1390    /*
1391     * Destroy menu - destroy the mobile menu when required
1392     */
1393  }
1394
1395  function destroy() {
1396    $(".mobile_menu_button").remove();
1397    $(".mobile-overlay").remove();
1398    $(".fm2_mobile_jq_menu").remove();
1399    $("body").unbind("touchmove");
1400    if (
1401      window.flexiCssMenus.presetSettings &&
1402      window.flexiCssMenus.presetSettings.effect == "slideLeft"
1403    ) {
1404      $("body").stop(true, true).css({
1405        "margin-left": "0",
1406        width: "auto",
1407      });
1408    }
1409  }
1410
1411  if (!window.flexiCssMenus) window.flexiCssMenus = {};
1412  window.flexiCssMenus.xtdCSSMenuInit = xtdCSSMenuInit;
1413  window.flexiCssMenus.xtdUnsetTabletBehavior = xtdUnsetTabletBehavior;
1414  window.flexiCssMenus.destroy = destroy;
1415})(jQuery);
1416//ie css3 script//
1417(function ($) {
1418  function getBrowser() {
1419    // jquery code//
1420    var ua = navigator.userAgent.toLowerCase();
1421    var match =
1422      /(chrome)[ \/]([\w.]+)/.exec(ua) ||
1423      /(webkit)[ \/]([\w.]+)/.exec(ua) ||
1424      /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
1425      /(msie) ([\w.]+)/.exec(ua) ||
1426      (ua.indexOf("compatible") < 0 &&
1427        /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)) ||
1428      [];
1429    var ver = match[2] || "0";
1430    var fi = ver.indexOf(".");
1431    var fi2 = ver.indexOf(".", fi);
1432    if (fi2 != -1) {
1433      ver = parseFloat(ver.substring(0, fi2));
1434    }
1435    return {
1436      name: match[1] || "",
1437      version: ver,
1438    };
1439  }
1440
1441  function getScriptFolder() {
1442    var scripts = document.getElementsByTagName("SCRIPT");
1443    for (var i = 0; i < scripts.length; i++) {
1444      var src = scripts[i].getAttribute("src");
1445      if (src && src.indexOf("drop_menu_selection.js") != -1) {
1446        if (src.lastIndexOf("/") != -1) {
1447          return src.substring(0, src.lastIndexOf("/") + 1);
1448        } else {
1449          return "";
1450        }
1451      }
1452    }
1453  }
1454
1455  var browser = getBrowser();
1456  if (!window.flexiCssMenus) window.flexiCssMenus = {};
1457  window.flexiCssMenus.browser = getBrowser();
1458  var scriptFolder = getScriptFolder();
1459  var ssFolder = scriptFolder;
1460  window.pie2path = ssFolder + "js/";
1461
1462  function addEventListener(element, type, listener) {
1463    if (element.addEventListener) {
1464      element.addEventListener(type, listener, false);
1465    } else if (element.attachEvent) {
1466      element.attachEvent("on" + type, listener);
1467    }
1468  }
1469})(jQuery);
1470
1471function registerFlexiCSSMenu(name, settings) {
1472  flexiCssMenus.settings = settings;
1473  if (jQuery("#" + name + "_container").length == 0) {
1474    return;
1475  }
1476  jQuery("#" + name + "_container").after(
1477    '<a class="fm2_mobile_button" style="display:none;" id="fm2_drop_mainmenu_mobile_button"><span class="caption"></span></a>'
1478  );
1479  if (!window.registeredFlexiMenus) {
1480    window.registeredFlexiMenus = [];
1481  }
1482  if (
1483    window.flexiCssMenus.browser.name == "msie" &&
1484    window.flexiCssMenus.browser.version < 9
1485  ) {
1486    settings["effectRest"] = null;
1487    settings["effectSub"] = null;
1488    settings["effectSubTwo"] = null;
1489  }
1490  registeredFlexiMenus.push({
1491    name: name,
1492    settings: settings,
1493  });
1494  jQuery("#" + name + "_container").removeAttr("style");
1495  //console.log(settings.options['enableMobile']);
1496  if (!settings.options["enableMobile"]) {
1497    jQuery(document).ready(function () {
1498      jQuery(".fm2_mobile_button").hide();
1499    });
1500  }
1501  if (!flexiCssMenus.xtdCSSMenuInit(name, settings.options)) {
1502    flexiCssMenus.bindEffect(name, settings);
1503    flexiCssMenus.addSelectedClass(name);
1504    flexiCssMenus.alignMenu(name, settings.options);
1505  }
1506}
1507
1508(function ($) {
1509  var id;
1510  if (window.addEventListener) {
1511    window.addEventListener("orientationchange", function () {
1512      clearTimeout(id);
1513      id = setTimeout(doneResizing, 100);
1514    });
1515  }
1516  jQuery(window)
1517    .unbind("resize.xtd")
1518    .bind("resize.xtd", function () {
1519      var is_touch_device = "ontouchstart" in document.documentElement;
1520      if (is_touch_device) {
1521        jQuery(window).unbind("resize");
1522        return;
1523      }
1524      clearTimeout(id);
1525      id = setTimeout(doneResizing, 100);
1526    });
1527
1528  if (!window.registeredFlexiMenus) {
1529    window.registeredFlexiMenus = [];
1530  }
1531
1532  function doneResizing() {
1533    for (var i = 0; i < registeredFlexiMenus.length; i++) {
1534      var menu = registeredFlexiMenus[i];
1535      if (flexiCssMenus.destroy) {
1536        flexiCssMenus.destroy(menu.name);
1537        jQuery(".FM_CLOSE").remove();
1538        flexiCssMenus.xtdUnsetTabletBehavior("#" + menu.name + "_container");
1539        flexiCssMenus.unbindEffect(menu.name);
1540      }
1541    }
1542    for (var i = 0; i < registeredFlexiMenus.length; i++) {
1543      var menu = registeredFlexiMenus[i];
1544      if (!flexiCssMenus.xtdCSSMenuInit(menu.name, menu.settings.options)) {
1545        flexiCssMenus.bindEffect(menu.name, menu.settings);
1546        flexiCssMenus.alignMenu(name, menu.settings.options);
1547      }
1548    }
1549  }
1550
1551  var correctedViewportW = (function (win, docElem) {
1552    var mM = win["matchMedia"] || win["msMatchMedia"],
1553      client = docElem["clientWidth"],
1554      inner = win["innerWidth"];
1555    return mM &&
1556      client < inner &&
1557      true === mM("(min-width:" + inner + "px)")["matches"]
1558      ? function () {
1559          return win["innerWidth"];
1560        }
1561      : function () {
1562          return docElem["clientWidth"];
1563        };
1564  })(window, document.documentElement);
1565  if (!window.flexiCssMenus) window.flexiCssMenus = {};
1566  window.flexiCssMenus.correctedViewportW = correctedViewportW;
1567})(jQuery);
1568
1569(function (jQuery) {
1570  jQuery(document).ready(function () {
1571    var menuSettings = {
1572      drop_mainmenu: {
1573        effectSub: {
1574          name: "slide",
1575          direction: "up",
1576          duration: "250",
1577          easing: "swing",
1578          useFade: "false",
1579        },
1580        effectRest: {
1581          name: "slide",
1582          direction: "left",
1583          duration: "250",
1584          easing: "swing",
1585          useFade: "false",
1586        },
1587        effectSubTwo: {
1588          name: "none",
1589          direction: "left",
1590          duration: "250",
1591          easing: "swing",
1592          useFade: "false",
1593        },
1594        options: {
1595          preset: "fixed",
1596          enableTablet: "true",
1597          enableMobile: "true",
1598          mobileMaxWidth: 767,
1599          tabletMaxWidth: 1024,
1600          tabletCloseBtnLabel: "Close",
1601          tabletCloseBtnEnable: "true",
1602          mobileLabel: "\u00a0",
1603        },
1604        skin: "default",
1605      },
1606    };
1607    var instanceName;
1608    for (var key in menuSettings) {
1609      if (menuSettings.hasOwnProperty(key) && key != "xtd_drop_down_menu") {
1610        instanceSettings = menuSettings[key];
1611        instanceName = key;
1612        registerFlexiCSSMenu(instanceName, instanceSettings);
1613      }
1614    }
1615  });
1616})(jQuery);

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.