/*************************************************************
* Check_Team_Login_Form - Ensures that the user has          *
*                         supplied a username And Password.  *
**************************************************************

/*************************************************************
*   Function: checkAdminLoginForm                             *
*                                                            *
*   This function will ensure that the user has supplied     *
*   a username and password before they can login            *
**************************************************************/

function checkAdminLoginForm() {

   var errorStr = "";
   
   if (document.AdminMember.username.value == "") {
      errorStr = errorStr + "<LI><P>The 'Username' field has been left blank</P></LI>";
   }
   
   if (document.AdminMember.passwd.value == "") {
      errorStr = errorStr + "<LI><P>The 'Password' field has been left blank</P></LI>";
   }

   if (errorStr != "") {
      displayErrorPopup( errorStr);
      return false; }
   else
      return true;
}


/*************************************************************
*   Function: displayErrorPopup                              *
*                                                            *
*   This function will display a standard error window.      *
*   You must call this function when the data in the form    *
*   is invalid/incomplete.                                   *
*   To use the function pass in a HTML coded error message   *
**************************************************************/

function displayErrorPopup( errorStr) {

   var errorwindow = window.open("", "errorwin", "width=400, height=170, scrollbars=yes", true);
   
   //Header HTML for new document
   errorwindow.document.writeln("<HTML><HEAD>");
   errorwindow.document.writeln("<TITLE>Error!</TITLE>");
   errorwindow.document.writeln("<link href='../fort.css' rel='stylesheet'>");
   errorwindow.document.writeln("</HEAD>");
   errorwindow.document.writeln("<BODY>");
   errorwindow.document.writeln("<h2>Error</h2><p>Sorry, you could not log in for the following reasons:</p>");
           
   //Code to add in Help text to help user 

   errorwindow.document.writeln(errorStr);

   //Footer HTML for New Document
   errorwindow.document.writeln("</BODY></HTML>");
   errorwindow.document.close;
}
