AJAX.registerTeardown("db_operations.js",function(){$("#rename_db_form.ajax").die("submit");$("#copy_db_form.ajax").die("submit");$("#change_db_charset_form.ajax").die("submit")});AJAX.registerOnload("db_operations.js",function(){$("#rename_db_form.ajax").live("submit",function(c){c.preventDefault();var b=$(this);var a=escapeHtml("CREATE DATABASE "+$("#new_db_name").val()+" / DROP DATABASE "+PMA_commonParams.get("db"));PMA_prepareForAjaxRequest(b);b.PMA_confirm(a,b.attr("action"),function(d){PMA_ajaxShowMessage(PMA_messages.strRenamingDatabases,false);$.get(d,$("#rename_db_form").serialize()+"&is_js_confirmed=1",function(e){if(e.success==true){PMA_ajaxShowMessage(e.message);PMA_commonParams.set("db",e.newname);PMA_reloadNavigation(function(){$("#pma_navigation_tree").find("a:not('.expander')").each(function(g){var f=$(this);if(f.text()==e.newname){f.trigger("click")}})})}else{PMA_ajaxShowMessage(e.error,false)}})})});$("#copy_db_form.ajax").live("submit",function(b){b.preventDefault();PMA_ajaxShowMessage(PMA_messages.strCopyingDatabase,false);var a=$(this);PMA_prepareForAjaxRequest(a);$.get(a.attr("action"),a.serialize(),function(c){$("div.success, div.error").fadeOut();if(c.success==true){PMA_commonParams.set("db",c.newname);if($("#checkbox_switch").is(":checked")){PMA_commonParams.set("db",c.newname);PMA_commonActions.refreshMain(false,function(){PMA_ajaxShowMessage(c.message)})}else{PMA_ajaxShowMessage(c.message)}PMA_reloadNavigation()}else{PMA_ajaxShowMessage(c.error,false)}})});$("#change_db_charset_form.ajax").live("submit",function(b){b.preventDefault();var a=$(this);PMA_prepareForAjaxRequest(a);PMA_ajaxShowMessage(PMA_messages.strChangingCharset);$.get(a.attr("action"),a.serialize()+"&submitcollation=1",function(c){if(c.success==true){PMA_ajaxShowMessage(c.message)}else{PMA_ajaxShowMessage(c.error,false)}})})});