| 108 | }); |
| 109 | // set default menu visibility |
| 110 | function resetState() { |
| 111 | var $menu = $('#main-menu'); |
| 112 | var $mainMenuState = $('#main-menu-state'); |
| 113 | var newWidth = $(window).outerWidth(); |
| 114 | if (newWidth!=prevWidth) { |
| 115 | if ($(window).outerWidth()<768) { |
| 116 | $mainMenuState.prop('checked',false); $menu.hide(); |
| 117 | $('#searchBoxPos1').html(searchBoxHtml); |
| 118 | $('#searchBoxPos2').hide(); |
| 119 | } else { |
| 120 | $menu.show(); |
| 121 | $('#searchBoxPos1').empty(); |
| 122 | $('#searchBoxPos2').html(searchBoxHtml); |
| 123 | $('#searchBoxPos2').show(); |
| 124 | } |
| 125 | if (typeof searchBox!=='undefined') { |
| 126 | searchBox.CloseResultsWindow(); |
| 127 | } |
| 128 | prevWidth = newWidth; |
| 129 | } |
| 130 | } |
| 131 | $(window).ready(function() { resetState(); initResizableIfExists(); }); |
| 132 | $(window).resize(resetState); |
| 133 | } |