function cleanSearchForm(){removeFromSearchForm("topic"),removeFromSearchForm("brd["+curBoard+"]");for(var a in focusBoards)removeFromSearchForm("brd["+focusBoards[a]+"]")}function removeFromSearchForm(a){var b=searchForm.elements[a];b&&searchForm.removeChild(b)}function addToSearchForm(a,b){var c=searchForm.elements[a];c||(c=document.createElement("input"),c.setAttribute("type","hidden"),c.setAttribute("name",a),c.setAttribute("value",b),searchForm.appendChild(c))}var searchForm=document.getElementById("search_form"),focusSelect=document.getElementById("search_focus");searchForm.onsubmit=function(){var a=focusSelect.options[focusSelect.selectedIndex].value;return cleanSearchForm(),"topic"==a?addToSearchForm("topic",curTopic):"board"==a?addToSearchForm("brd["+curBoard+"]",curBoard):!isNaN(parseFloat(a))&&isFinite(a)&&addToSearchForm("brd["+a+"]",a),!0};