//////////////////////////////////////////////////////////////////////
// This file contains page specific JavaScript.  No code
// should be included in this file if it can be used across multiple
// pages.  Place common javaScript in common.js
//////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////
// indicates the input field is valid by displaying a clear graphic
//////////////////////////////////////////////////////////////////////
function ClearAllErrors()
{ 
}

// this function is called during the form load event
function LoadProcessing()
{ 
   // perform the common stuff
   CommonLoadProcessing();
}

//////////////////////////////////////////////////////////////////////
// The LoadProcessing that is called on page load grabs all keys
// so it can look for the Enter key.  When Enter is pressed, the
// javascript calls submitForm.  There was a reason I named the
// javascript below submitSigninForm instead of submitForm
// (I just can't remember why...).  I am creating this stub until
// I remember....
//////////////////////////////////////////////////////////////////////
function submitForm(SubmitType) 
{ 
   submitSigninForm(SubmitType);
}


//////////////////////////////////////////////////////////////////////
// Performs client side validation prior to form submission.  If any
// fields are invalid, the form will not be submitted.
//////////////////////////////////////////////////////////////////////
function submitSigninForm(SubmitType) 
{
   var error_arr      = new Array()
   var error_controls = new Array()
   var error_num = 0

   error_arr.length  	 = 0
   error_controls.length = 0
   error_num 		 = 0
   
   lform = document.signin_form
   
   ClearAllErrors();

   if (isBlank(lform.UserName.value)) {
      error_arr[error_num] = "Please enter your user name."
      error_num++;
   }

   if (isBlank(lform.Password.value)) {
      error_arr[error_num] = "Please enter your password."
      error_num++;
   }

   //do we have any errors?
   if (error_arr.length > 0) {

	// display the error window
	openErrorWindow(error_arr, error_num)

   } else {
      // need to know if the action is "next" or "end"
      lform.SubmitType.value = SubmitType;
      lform.submit();
   }

}
