$(function(){$(".helpmsg").tooltip({position:"bottom center",offset:[10,20],effect:"fade",opacity:0.8,events:{def:"click,mouseout"}});$("#button_save_main_settings").click(function(){if($("#button_save_main_settings").text()!="Saving..."){$("#button_save_main_settings").prop("disabled",true);$("#button_save_main_settings").text("Saving...");$("#button_save_main_settings").after("<img style=\"margin-left: 10px\" src='images/loader_small_grey.gif' />");$("#ms_form").submit()}return false});$("#dialog-change-password").dialog({modal:true,autoOpen:false,closeOnEscape:false,width:400,position:["center",150],draggable:false,resizable:false,buttons:[{text:"Save Password",id:"dialog-change-password-btn-save-changes","class":"bb_button bb_small bb_green",click:function(){var b=$.trim($("#dialog-change-password-input1").val());var a=$.trim($("#dialog-change-password-input2").val());var c=$("#ms_box_account").data("userid");if(b==""||a==""){alert("Please enter both password fields!")}else{if(b!=a){alert("Please enter the same password for both fields!")}else{$("#dialog-change-password-btn-save-changes").prop("disabled",true);$("#dialog-change-password-btn-cancel").hide();$("#dialog-change-password-btn-save-changes").text("Saving...");$("#dialog-change-password-btn-save-changes").after("<div class='small_loader_box'><img src='images/loader_small_grey.gif' /></div>");$.ajax({type:"POST",async:true,url:"change_password.php",data:{np:b,user_id:c},cache:false,global:false,dataType:"json",error:function(g,d,f){alert("Unable to save the password!");$(this).dialog("close")},success:function(d){$("#dialog-change-password").dialog("close");$("#dialog-change-password-btn-save-changes").prop("disabled",false);$("#dialog-change-password-btn-cancel").show();$("#dialog-change-password-btn-save-changes").text("Save Password");$("#dialog-change-password-btn-save-changes").next().remove();$("#dialog-change-password-input1").val("");$("#dialog-change-password-input2").val("");if(d.status=="ok"){$("#dialog-password-changed").dialog("open")}}})}}}},{text:"Cancel",id:"dialog-change-password-btn-cancel","class":"btn_secondary_action",click:function(){$(this).dialog("close")}}]});$("#dialog-password-changed").dialog({modal:true,autoOpen:false,closeOnEscape:false,width:400,position:["center",150],draggable:false,resizable:false,buttons:[{text:"OK",id:"dialog-password-changed-btn-ok","class":"bb_button bb_small bb_green",click:function(){$(this).dialog("close")}}]});$("#ms_change_password").click(function(){$("#dialog-change-password").dialog("open");return false})});