var createAccountButton1=document.getElementById("create_account_button1");if(createAccountButton1){createAccountButton1.onclick=function(){var a=document.getElementById("login_div");if(a){a.style.display="none"}var c=document.getElementById("create_account_div");if(c){c.style.display="block"}var b=document.getElementById("back_button");b.onclick=function(){if(a){a.style.display="block";if(c){c.style.display="none"}}initForms(document.getElementById("login_button"))};initForms(document.getElementById("create_account_button2"))}}function createAccount(f,b){var e=document.getElementById("new_password").value;var c=document.getElementById("verify_password").value;if(e!=c){alert("Passwords do not match. Try again.");return}origButton=b.cloneNode(false);b.style.color="green";b.value="Running...";gSearchButton=b;gSearchButton.original_value=gSearchButton.value;startLoadingIndicator(gSearchButton);var a=function(h){if(h!=""){unHighlightFields();if(h!="!SUCCESS!"){highlightFields(h,"!ERR:FIELD:")}else{if(f=="EditAccount"){alert("Account Saved.");updateTable("accounts")}else{alert("Account Created.")}}resetLoadingIndicator(gSearchButton)}};var g="";if(f=="EditAccount"){g="edit"}var d="http://"+myHost+"/"+thisApp+"/ajax_controllers/createAccount.php?op="+g;ajaxPostCall(d,"view_form",a,errorFunction)}function editAccount(g,d){gSearchButton=d;gSearchButton.original_value=gSearchButton.value;startLoadingIndicator(gSearchButton);var b=document.getElementsByName("edit_row");var e=false;for(var c=0;c<b.length;c++){if(b[c].checked){e=b[c];break}}if(e==false){alert("Please select an import to edit.");resetLoadingIndicator(gSearchButton);return}var a=function(h){if(h.status!="!SUCCESS!"){alert("Could not edit selected rows")}else{var i=document.getElementById("edit_container");i.innerHTML=h.html;i.style.display="block"}resetLoadingIndicator(gSearchButton)};var f="http://"+myHost+"/"+thisApp+"/ajax_controllers/editAccount.php?user_name="+e.value;ajaxPostCall(f,"view_form",a,errorFunction,"json")}function changePassword(b){var e=document.getElementById("new_password").value;var c=document.getElementById("verify_password").value;if(e!=c){alert("Passwords do not match. Try again.");return}gSearchButton=b;gSearchButton.original_value=gSearchButton.value;startLoadingIndicator(gSearchButton);var a=function(f){if(f!=""){unHighlightFields();if(f!="!SUCCESS!"){highlightFields(f,"!ERR:FIELD:")}else{alert("Password Changed.")}resetLoadingIndicator(gSearchButton)}};var d="http://"+myHost+"/"+thisApp+"/ajax_controllers/changePassword.php";ajaxPostCall(d,"view_form",a,errorFunction)};