//wfp //added wfp sep 6, 2012 move the rendered search template to header-body $('#search-section').ready(function () { //$('#search-section').appendTo($('#header-body')); // service-menu-nav //$("
").appendTo($('#service-menu-nav')); //$("#search-section").appendTo($('#service-menu-nav > .li-search-section')); $("#search-section").appendTo($('.divsub-service-menu-nav')); }); //register hover for all submenus $('.withSubmenu').live({ mouseenter: function () { if ($('.submenu', this).is(':animated')) return; $('.submenu').stop(true, true).css('display', 'none'); $('.submenu', this).slideDown('fast'); $('> a', this).addClass('hovered'); // 1902 mdc jul19-2013 if ($(this).find('.iconservicemenuflere')) { var iconservicemenuflere = $(this).find('img.iconservicemenuflere'); $(iconservicemenuflere).attr('src', 'https://menu.amino.dk/skins/flat-v4/images/icn-arrow-topMenu.png') } }, mouseleave: function () { $('.submenu', this).stop(true, true).css('display', 'none'); $('> a', this).removeClass('hovered'); // 1902 mdc jul19-2013 if ($(this).find('.iconservicemenuflere')) { var iconservicemenuflere = $(this).find('img.iconservicemenuflere'); $(iconservicemenuflere).attr('src', 'https://menu.amino.dk/skins/flat-v4/images/dark-icn-arrow-hoverMenu.png') } }, click: function () { var submenu = $('.submenu', this); submenu.css('display', submenu.is(':visible') ? 'none' : 'block'); } /*added wfp aug 23, 2012 for ipad*/ } ); //select the current page from the service sub menu $(document).ready(function () { if (window.location.pathname != '/' && window.location.pathname != '') { var match = $('#service-menu-nav > li > a') .filter(function () { var patt = new RegExp(window.location.pathname, 'i'); return patt.test($(this).attr('href')); }); if (match.length == 1) match.parent('li').addClass('selected'); else //no match or more than one { if (match.length > 1) { //check if there's an exact match var exact_match = $('#service-menu-nav > li > a') .filter(function () { try { return $(this).attr('href').toLowerCase() == window.location.href.toLowerCase(); } catch (e) { return false; } }); if (exact_match.length == 1) exact_match.parent('li').addClass('selected'); } } } }); //added wfp aug 21, 2012 as per user request to remove the service menu bar if current service has no submenu $('#service-menu-nav').ready(function () { if ($('#service-menu-nav').children().length == 0) { $('#service-menu-nav').remove(); $('#usermenu-template').css('margin-top', '-77px'); } }); //register hover for all children submenus. 1902 mdc sep23-2013 $('.withChildren').live( { mouseenter: function () { if ($('.childrendiv', this).is(':animated')) return; $('.childrendiv').stop(true, true).css('display', 'none'); $('.childrendiv', this).slideDown('fast'); $('> a', this).addClass('hovered'); if ($(this).find('.iconservicemenuflere')) { var iconservicemenuflere = $(this).find('img.iconservicemenuflere'); $(iconservicemenuflere).attr('src', 'https://menu.amino.dk/skins/flat-v4/images/icn-arrow-topMenu.png'); } }, mouseleave: function () { $('.childrendiv', this).stop(true, true).css('display', 'none'); $('> a', this).removeClass('hovered'); if ($(this).find('.iconservicemenuflere')) { var iconservicemenuflere = $(this).find('img.iconservicemenuflere'); $(iconservicemenuflere).attr('src', 'https://menu.amino.dk/skins/flat-v4/images/dark-icn-arrow-hoverMenu.png'); } }, click: function () { var submenu = $('.submenu', this); submenu.css('display', submenu.is(':visible') ? 'none' : 'block'); } /*added wfp aug 23, 2012 for ipad*/ } ); $(document).ready(function () { $('.withChildren').each(function (_indx) { var _left = $(this).position().left; var _childrendiv = $(this).find('.childrendiv'); $(_childrendiv).css('left', _left + 'px' ); }); });