AJAX.registerTeardown("db_search.js",function(){$("#buttonGo").unbind("click");$("#togglesearchresultlink").unbind("click");$("#togglequerybox").unbind("click");$("#togglesearchformlink").unbind("click");$("#db_search_form.ajax").die("submit")});function loadResult(c,a,b){$(function(){var d=PMA_ajaxShowMessage(PMA_messages.strBrowsing,false);$("#sqlqueryform").hide();$("#togglequerybox").hide();$("#table-info").show();$("#table-link").attr({href:"sql.php?"+b}).text(a);var e=c+" #sqlqueryresults";$("#browse-results").load(e,null,function(){$("html, body").animate({scrollTop:$("#browse-results").offset().top},1000);PMA_ajaxRemoveMessage(d);PMA_makegrid($("#table_results")[0],true,true,true,true)}).show()})}function deleteResult(a,b){$(function(){$("#table-info").hide();$("#browse-results").hide();$("#sqlqueryform").hide();$("#togglequerybox").hide();if(confirm(b)){var c=PMA_ajaxShowMessage(PMA_messages.strDeleting,false);$("#sqlqueryform").html("");var d=a+" #result_query, #sqlqueryform";$("#browse-results").load(d,function(){document.getElementById("buttonGo").click();$("#togglequerybox").html(PMA_messages.strHideQueryBox);$("#browse-results").show();$("#sqlqueryform").show();$("#togglequerybox").show();$("html, body").animate({scrollTop:$("#browse-results").offset().top},1000);PMA_ajaxRemoveMessage(c)})}})}AJAX.registerOnload("db_search.js",function(){var a=PMA_getImage("s_tbl.png","",{id:"table-image"}).toString();$("#table-info").prepend(a).hide();$("#buttonGo").click(function(){$("#table-info").hide();$("#browse-results").hide();$("#sqlqueryform").hide();$("#togglequerybox").hide()});$('<div id="togglesearchresultsdiv"><a id="togglesearchresultlink"></a></div>').insertAfter("#searchresults").hide();$('<br class="clearfloat" />').insertAfter("#togglesearchresultsdiv").show();$("#togglesearchresultlink").html(PMA_messages.strHideSearchResults).bind("click",function(){var b=$(this);$("#searchresults").slideToggle();if(b.text()==PMA_messages.strHideSearchResults){b.text(PMA_messages.strShowSearchResults)}else{b.text(PMA_messages.strHideSearchResults)}return false});$('<div id="togglesearchformdiv"><a id="togglesearchformlink"></a></div>').insertAfter("#db_search_form").hide();$("#togglequerybox").hide().bind("click",function(){var b=$(this);$("#sqlqueryform").slideToggle("medium");if(b.text()==PMA_messages.strHideQueryBox){b.text(PMA_messages.strShowQueryBox)}else{b.text(PMA_messages.strHideQueryBox)}return false});$("#togglesearchformlink").html(PMA_messages.strShowSearchCriteria).bind("click",function(){var b=$(this);$("#db_search_form").slideToggle();if(b.text()==PMA_messages.strHideSearchCriteria){b.text(PMA_messages.strShowSearchCriteria)}else{b.text(PMA_messages.strHideSearchCriteria)}return false});$("#db_search_form.ajax").live("submit",function(d){d.preventDefault();var e=PMA_ajaxShowMessage(PMA_messages.strSearching,false);var b=$(this);PMA_prepareForAjaxRequest(b);var c=b.serialize()+"&submit_search="+$("#buttonGo").val();$.post(b.attr("action"),c,function(f){if(f.success==true){$("#searchresults").html(f.message);$("#togglesearchresultlink").text(PMA_messages.strHideSearchResults);$("#togglesearchresultsdiv").show();$("#searchresults").show();$("#db_search_form").slideToggle().hide();$("#togglesearchformlink").text(PMA_messages.strShowSearchCriteria);$("#togglesearchformdiv").show()}else{$("#sqlqueryresults").html(f.error)}PMA_ajaxRemoveMessage(e)})})});