/*LOAD LEAF*/
//This is a leaf level library that has functions related to establishing of a session with the server.
/*
DEPENDENCIES
http://demo.wolfframeworks.com/ewidgets/loginservices.js [does not need to be included in the page. This page takes care of it]

USAGE
onload of the page the following need to be set.

wolf.loginServices.loginBox         =   ... [reference to the login html element]
wolf.loginServices.passwordBox      =   ... [reference to the password html element]
wolf.loginServices.appId            =   ... [appid to which the login is required]
wolf.loginServices.hostURL          =   ... [usually https://run.wolfframeworks.com but if the url has been masked one can use thos urls]
wolf.loginServices.onSignInSuccess  = _onSignIn [pointer to a function that is called after a sign in attempt]
wolf.loginServices.onSignedOut      = _onSignOut [pointer to a function that is called after a sign out]

function _onSignIn(inSession)
{
    //inSession will be true or false.
}

function _onSignOut()
{
}

//if  you have a login form on the page then onclick do the following
//wolf.loginServices.form_login(); and
wolf.loginServices.onBeforeFormLogin    = beforeFormLogin;

function beforeFormLogin()
{
    wolf.loginServices.loginBox     =   document.getElementById("txtlogin");
    wolf.loginServices.passwordBox  =   document.getElementById("txtpassword");
}

INFORMATION AVAILBLE IF A SESSION IS SUCCESSFUL

wolf.session.applicationId      [the application id]
wolf.session.loginId            [the login id]
wolf.session.userName           [the user name]
wolf.session.userId             [the internal user unique id]
wolf.session.defaultFolderName  [the users default folder]
wolf.session.defaultFolderId    [the users defaults folder's uniqueid id]
wolf.session.userRights         [user priveleges on menus and objects]

*/
try{if(wolf.loginServices.init == null){loadLoginServices()}}catch(e){loadLoginServices()}
function loadLoginServices(){document.write(unescape('%3Cscript type="text/javascript" language="javascript" src="http://demo.wolfframeworks.com/ewidgets/loginservices.js">%3C/script>'))}

