var iCallID;
function checkEmpty(){var isEmpty = (Form1.txtUserID.value != "" && Form1.txtPassword.value != "");Form1.btnLogin.disabled = !isEmpty;return isEmpty;}
function systemInit() {if (checkTop()) {window.moveTo(0,0);window.resizeTo(window.screen.availWidth,window.screen.availHeight);Form1.txtUserID.onkeyup = checkEmpty;Form1.txtPassword.onkeyup = checkEmpty;Form1.txtPassword.readOnly = false;Form1.txtUserID.readOnly = false;Form1.txtPassword.disabled = false;Form1.txtUserID.disabled = false;if (Form1.txtUserID.value=='') Form1.txtUserID.focus();}}				
function checkTop(){if ((window.top != this) || !(window.opener)){var xBaseWindow = window.open('../Main/Main.aspx?w='+ window.screen.availWidth + '&h=' + window.screen.availHeight,'xbase','fullscreen=0,status=yes,directories=no,toolbar=no,location=no,menubar=no,resizable=yes,left=0,top=0');window.opener=top;window.close();xBaseWindow.focus();return false;} else return true;}
function xbAuthenticate(){Form1.txtPassword.readOnly = true;Form1.txtUserID.readOnly = true;Form1.txtPassword.disabled = true;Form1.txtUserID.disabled = true;spLogin.style.display = "none";spProgress.style.display = "";webService.useService ("../../xBaseWebServices/Authenticate.asmx?WSDL", "Authenticate");iCallID = webService.Authenticate.callService("AuthenticateUser", Form1.txtUserID.value, Form1.txtPassword.value);}
function onWSResult() { if((event.result.error) && (iCallID==event.result.id)){var xfaultcode = event.result.errorDetail.code;var xfaultstring = event.result.errorDetail.string;    var xfaultsoap = event.result.errorDetail.raw;alert( xfaultstring );} else if((!event.result.error) && (iCallID == event.result.id) && (! event.result.value)){Form1.txtPassword.disabled = false;Form1.txtUserID.disabled = false;Form1.btnAuthOk.click();}else {alert (event.result.value);Form1.txtPassword.readOnly = false;Form1.txtPassword.disabled = false;Form1.txtUserID.readOnly = false;Form1.txtUserID.disabled = false;Form1.txtPassword.value = "";Form1.txtPassword.focus();spLogin.style.display = "";spProgress.style.display = "none";}}		
