var cur_page=0;var io_more_inner_o="";var search_query="";var split_query="";function reload_list(){cur_page=0;$("#search_result").html('<p style="padding: 15px 0" align="center"><img src="'+GET_STATIC_URL+'/common/loading_b.gif" alt="" /></p>');$("#io_more").html(io_more_inner_o);$("#io_more").click()}$(document).ready(function(){$("#list_nav a").click(function(){$("#list_nav a").removeClass("cur");$(this).addClass("cur");window.location.hash=$(this).attr("href").replace(/#/g,"");$("#search_type").html($(this).text());reload_list();return false});io_more_inner_o=$("#io_more").html();$("#io_more").click(function(){var _this=this;switch(window.location.hash){default:var request_url=GET_BASE_URL+"/search/ajax/search_result/search_type-all__q-"+encodeURIComponent(search_query)+"__page-"+cur_page;break;case"#questions":case"#topics":case"#users":var request_url=GET_BASE_URL+"/search/ajax/search_result/search_type-"+window.location.hash.replace(/#/g,"")+"__q-"+encodeURIComponent(search_query)+"__page-"+cur_page;break}$(this).addClass("loading");$(this).find("a").html("Loading......");$.get(request_url,function(response){if(response.length){if(cur_page==0){$("#search_result").html(response)}else{$("#search_result").append(response)}$("#search_result li p.keyword a").highText(split_query,"span","tny-red");cur_page++;$(_this).html(io_more_inner_o)}else{if(cur_page==0){$("#search_result").html('<p style="padding: 15px 0" align="center">No Content</p>')}$(_this).addClass("disabled");$(_this).find("a").html("No more")}$(_this).removeClass("loading")});return false});switch(window.location.hash){default:$("#list_nav a[href='#all']").click();break;case"#questions":case"#topics":case"#users":$("#list_nav a[href='"+window.location.hash+"']").click();break}});