jQuery(function($){$.fn.mnShowFrame=function(){var $$=$(this);$$.css({right:$(document).width()}).show().animate({right:0},'fast',function(){$(window).resize();});return $$;};$.fn.mnHideFrame=function(){var $$=$(this);$$.add('.mobile-nav-frame').css({right:0}).animate({right:$(document).width()},'fast',function(){$(this).hide();$(window).resize();});$('body').animate({'padding-left':0},'fast');};var doneIds=[];$('.so-mobilenav-standard').each(function(){var id=$(this).data('id');if(typeof doneIds[id]!='undefined')return true;else{doneIds[id]=true;}
var $nav=$(this).next();var $mnav=$('#so-mobilenav-mobile-'+id).next();var frame;$(document).on('click','a.mobilenav-main-link[data-id="'+id+'"]',function(event){event.preventDefault();if(frame==null){frame=$('
'+mobileNav.text.navigate+'
').appendTo('body');frame.find('.title').prepend('←X')
if(mobileNav.search){$("").insertAfter(frame.find('.title'));}
frame.find('.close').click(function(event){event.preventDefault();frame.mnHideFrame();});$(window).resize(function(){if(!frame.is(':visible'))return;frame.hide();frame.width($(window).width());frame.show();});$('body').bind('orientationchange',function(){$(window).resize();});activeSlide=null;showSlide=function(i){frame.find('.slides-container .slide').hide();activeSlide=frame.find('.slides-container .slide').eq(i).show();if(i==0)frame.find('a.back').hide();else frame.find('a.back').show();if(i!=0){frame.find('.title h3').html(activeSlide.data('title'));}
else{frame.find('.title h3').html(mobileNav.text.navigate);}}
frame.find('a.back').click(function(){var parent=activeSlide.data('parent-slide');if(parent!=undefined){showSlide(parent);}
return false;});var createMenu=function(root){var slide=$('').appendTo(frame.find('.slides-container'));root.find('> li').each(function(){var $$=$(this);var ln=$('').html($$.find('> a').html()).attr('href',$$.find('> a').attr('href')).addClass('link');var li=$('').append(ln);li.find('a[href!="#"]').click(function(e){frame.mnHideFrame();});slide.find('ul').append(li);if($$.find('> ul').length>0){var image=$('').attr('src',mobileNav.nextIconUrl).attr('width',18).attr('height',26);var next=$('').append(image);li.prepend(next);var child=$$.find('> ul').eq(0);var childSlide=createMenu(child);childSlide.data('parent-slide',slide.index());childSlide.data('title',ln.html());li.find('a.next').click(function(){showSlide(childSlide.index());return false;});li.find('a[href="#"]').not('.next').click(function(){next.click();return false;});}});return slide;}
createMenu($nav.find('ul').eq(0));showSlide(0);}
$(window).resize();frame.mnShowFrame();showSlide(0);return false;});});});