if (typeof North52 == 'undefined') { North52 = {}; }
if (typeof North52.Deploy== 'undefined') { North52.Deploy= {}; }

North52.Deploy.Ok= function () {

        };
   
    North52.Deploy.OnLoad = function () {
       $('#btnOk').attr('disabled',true);  
 
      var configurationId = N52.DialogHelpers.GetConfigurationId();
      var serverUrl = N52.DialogHelpers.GetServerUrl();
      var command = 217890011;

      North52.Deploy.Execute(command, serverUrl,configurationId  );     
    };


North52.Deploy.Execute= function(command, serverurl, configurationId ) {

  try
   { 
                  var configuration = {};
                    configuration.north52_Command = { Value: command };
                   
                    SDK.JQuery.updateRecord(
                         configurationId,
                         configuration,
                         "north52_configuration", 
                         North52.Deploy.configSuccess,
                         North52.Deploy.configError
                      );
}
  catch (ex)
  {
     alert('North52 Formula Manager Error: ' + ex.message);
   }

};

 North52.Deploy.configSuccess= function () {
        window.close();
     };

 North52.Deploy.configError= function (XmlHttpRequest, textStatus, errorThrown) {
                      
                      alert('North52 Formula Manager: ' + XmlHttpRequest.message )
                      $('#btnOk').attr('disabled',false); 
                     $('#loading').hide(); 
       };