AJAX.registerTeardown("server_databases.js",function(){$("#dbStatsForm").die("submit");$("#create_database_form.ajax").die("submit")});AJAX.registerOnload("server_databases.js",function(){$("#dbStatsForm").live("submit",function(d){d.preventDefault();var b=$(this);var c=[];b.find("input:checkbox:checked:not(#checkall)").each(function(){$(this).closest("tr").addClass("removeMe");c[c.length]="DROP DATABASE `"+escapeHtml($(this).val())+"`;"});if(!c.length){PMA_ajaxShowMessage($('<div class="notice" />').text(PMA_messages.strNoDatabasesSelected),2000);return}var a=PMA_messages.strDropDatabaseStrongWarning+" "+$.sprintf(PMA_messages.strDoYouReally,c.join("<br />"));$(this).PMA_confirm(a,b.prop("action")+"?"+$(this).serialize()+"&drop_selected_dbs=1&is_js_confirmed=1&ajax_request=true",function(e){PMA_ajaxShowMessage(PMA_messages.strProcessingRequest,false);$.post(e,function(i){if(i.success==true){PMA_ajaxShowMessage(i.message);var g=b.find("tr.removeMe");var f=$("#databases_count");var h=parseInt(f.text())-g.length;f.text(h);g.remove();b.find("tbody").PMA_sort_table(".name");PMA_reloadNavigation()}else{b.find("tr.removeMe").removeClass("removeMe");PMA_ajaxShowMessage(i.error,false)}})})});$("#create_database_form.ajax").live("submit",function(b){b.preventDefault();$form=$(this);var a=$form.find("input[name=new_db]");if(a.val()===""){a.focus();alert(PMA_messages.strFormEmpty);return}PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);PMA_prepareForAjaxRequest($form);$.post($form.attr("action"),$form.serialize(),function(e){if(e.success==true){PMA_ajaxShowMessage(e.message);$("#tabledatabases").find("tbody").append(e.new_db_string).PMA_sort_table(".name");var d=$("#databases_count");var c=parseInt(d.text())+1;d.text(c);PMA_reloadNavigation()}else{PMA_ajaxShowMessage(e.error,false)}})})});