function onSideSearchTypeChanged(basepath,type){var elem=$("sidebar_search_tag");if(!elem){return;}while(elem.firstChild){elem.removeChild(elem.firstChild);}url=basepath+"Titles.Search.AjaxTags";new Ajax.Request(basepath+"Titles/Search.AjaxTag",{method:"get",parameters:"type="+encodeURIComponent(type),onSuccess:function(httpObj){var node_select=$("sidebar_search_tag");node_select.appendChild(document.createElement("option"));var remote=eval("("+httpObj.responseText+")");for(var i=0;i<remote.length;++i){var node_optgroup=document.createElement("optgroup");node_optgroup.setAttribute("label",remote[i].label);for(var j=0;j<remote[i].options.length;++j){var node_option=document.createElement("option");node_option.setAttribute("value",remote[i].options[j].id);node_option.appendChild(document.createTextNode(remote[i].options[j].text));node_optgroup.appendChild(node_option);}node_select.appendChild(node_optgroup);}}});}