function searchBoxShow() { var x = document.getElementsByClassName("top_search_box"); for (var i = 0; i < x.length; i++) { x[i].style.display = 'block'; x[i].style.opacity = '1'; } document.getElementById('top_search_box').style.display = 'block'; document.getElementById('top_search_box').style.opacity = '1'; document.getElementById('site_search_search').focus(); var x = document.getElementsByClassName("site_search_search"); for (var i = 0; i < x.length; i++) { x[i].focus(); } } function searchBoxHide() { if ( document.getElementById('site_search_search') === document.activeElement || document.getElementById('site_search_go') === document.activeElement || document.getElementById('site_search') === document.activeElement || document.getElementById('sitesearch') === document.activeElement || document.getElementById('top_search_box') === document.activeElement) { return 0; } else { var x = document.getElementsByClassName("top_search_box"); var i; for (i = 0; i < x.length; i++) { var thisEl = x[i]; (function(x) { setTimeout(function() { x.style.display = 'none'; }, 500); })(thisEl); thisEl.style.opacity = '0'; } window.setTimeout(function() { document.getElementById('top_search_box').style.display = 'none'; }, 500); document.getElementById('top_search_box').style.opacity = '0'; } } function searchBoxCheck() { window.setTimeout('searchBoxHide()', 200); } document.getElementById('top_search_button').onclick = function() { searchBoxShow(); return false; } document.getElementById('site_search_search').onblur = function() { searchBoxCheck(); } var fixedMenu = new bumbleFixObj('nav_container');