/// <reference path="LaunchNetClientBase.js"/>
/// <reference path="BrowserServices.js"/>
/// <reference path="ErrorServices.js"/>
/// <reference path="ClientProxyServices.js"/>
/// <reference path="LaunchNetClientContext.js"/>
/// <reference path="PlatformServices.js"/>

//the following are variables for which values are injected
//var __yourVariable;

function SprycelGlobalServices()
{
  var commands = new LaunchNetServiceCommands();

  this.OnPageLoad = OnPageLoad;
  this.OnPageClick = OnPageClick;
  this.OnValidationRequiredCheck = OnValidationRequiredCheck;
  this.OnValidateLaunchNetElements = OnValidateLaunchNetElements;

  
/* ***********************************************************************************
-  Page Load Event
************************************************************************************ */

  function OnPageLoad()
  {
  }


/* ***********************************************************************************
-  Page Click Event
************************************************************************************ */

  function OnPageClick(launchNetElementClicked, pageValid)
  {
    commands.HandlePageClick(this, launchNetElementClicked, pageValid);
  }
  
/* ***********************************************************************************
-  Page Validation
************************************************************************************ */

  function OnValidationRequiredCheck(launchNetElementClicked)
  {
    return commands.HandleValidationRequiredCheck(launchNetElementClicked);
    //return true if the incoming launchNetElementClicked indicates a need to perform validation
    //note that launchNetElementClicked is of type LaunchNetElement (see LaunchNetClientBase.js)
  }

  function OnValidateLaunchNetElements(validatableLaunchNetElements)
  {
    //validate any special elements here; return true if validation successful
    return true;
  }
}