
     <!--
      function makeNewWindow(){
       newWindow = window.open("","","status, scrollbars=yes, height=450px, width=310px")
       }

        //make a new window to show scores and input scores to database
       function doHelp(){

             //open a new window
            makeNewWindow()

         //bring the new window to the front
       newWindow.focus();

         //write content to the window
      var newContent  = "<HTML><HEAD><TITLE>Help</TITLE></HEAD><BODY> "
          
           newContent += "<P><CENTER><B>Help</B></CENTER></P>"
           newContent += "<HR COLOR='seagreen'>"
           newContent += "<OL>"
           newContent += "<LI>AREA:&nbsp;&nbsp;The suburb or neighborhood in which your team is located.<BR><BR>"
           newContent += "<LI>FIRST:&nbsp;&nbsp;This would be the first name of the team member or Captain.<BR>"
           newContent += "If two members have the same first name, use an initial or number to help distinguish between them.<BR><BR>"
           newContent += "<LI>Captain's Password:&nbsp;&nbsp;This is a security measure and Team Captains, or their designate, must enter this password every time they want to up-date mileage on the Captain's Mileage Log."
           newContent += "&nbsp;&nbsp;This can be any combination of letters or numbers you can easily remember, such as Frog100."
           newContent += "</OL><FORM><CENTER>"
           newContent += "<INPUT TYPE='button' VALUE='Close' onClick='window.close()'>"
           newContent += "</CENTER></FORM>"
           newContent += "</BODY></HTML>"

            //write to the new window
           newWindow.document.write(newContent)
            //close the layout stream
           newWindow.document.close()
           
           }
           
         //make a new window to show scores and input scores to database
	function schoolHelp(){
	   
	      //open a new window
	     makeNewWindow()
	   
	     //bring the new window to the front
	   newWindow.focus();
	   
	   //write content to the window
	   var newContent  = "<HTML><HEAD><TITLE>Help</TITLE></HEAD><BODY> "
	             
	       newContent += "<P><CENTER><B>Help</B></CENTER></P>"
	       newContent += "<HR COLOR='seagreen'>"
	       newContent += "<OL>"
	       newContent += "<LI>DISTRICT:&nbsp;&nbsp;Enter your school district by Name of District and ISD (example:  Bryan ISD, Dallas ISD).<br>"
	       newContent += "If your school is a Private School, enter NONE.<BR><BR>"
	       newContent += "<LI>TEACHER PASSWORD:&nbsp;&nbsp;This is a security measure and will be required "
	       newContent += "each time the Team's Log is updated."
	       newContent += "&nbsp;&nbsp;This can be any combination of letters or numbers you can easily remember."
	       newContent += "</OL><FORM><CENTER>"
	       newContent += "<INPUT TYPE='button' VALUE='Close' onClick='window.close()'>"
	       newContent += "</CENTER></FORM>"
	       newContent += "</BODY></HTML>"
	   
	     //write to the new window
	    newWindow.document.write(newContent)
	     //close the layout stream
	    newWindow.document.close()
	              
           }


    function hijackValidator() {
      // loop through all the Forms in the document
      for (i=0; i<document.forms.length; i++) {
    
    /* create a new property of the Form that tracks whether the Form has been submitted*/
    
       document.forms[i].notSubmittedYet = true;
       if (document.forms[i].onsubmit) {
        var oldHandler = new String(document.forms[i].onsubmit)
    
    /*  oldHandler will be something like this, depending on the browser in use,
    *   and the name of the Form:
    *
    *   "function anonymous() { return FrontPage_Form1_Validator(this); }"
    *
    *   We need to extract just the "FrontPage_Form1_Validator(this)" part
    */
    
        //find "Validator"
        var validatorIndex = oldHandler.indexOf("Validator");
    
        //if "Validator" not found, then abort
        if (validatorIndex<0) return;
    
        //find space before name of validator function
        var startIndex = oldHandler.lastIndexOf(" ",validatorIndex)
    
        // if space not found, abort
        if (startIndex<0) return;
    
        // find final parenthesis
        var endIndex = oldHandler.indexOf(")",validatorIndex);
    
        //if parenthesis not found, abort
        if (endIndex<0) return;
    
        // create a String for the name of the validator function,
        // and store it as a new property of the Form
        document.forms[i].oldValidator = new String(oldHandler.slice(startIndex,endIndex+1));
    
        /* oldValidator is something like this:
        * "FrontPage_Form1_Validator(this);"
    
        */
       }
    
       else {  //Form did not have an onSubmit handler previously
       	 document.forms[i].oldValidator = new String("true;");
    	}
    
       //substitute our own onSubmit handler for the one FrontPage created
       document.forms[i].onsubmit = enhancedValidator;
    
      } //end for
    
    } //end hijackValidator()
    
    function enhancedValidator() {
    
     /* This is our new validator function.
     * It first calls the FrontPage validator for the Form.
     * If that returns TRUE, it then checks whether the Form
     * has already been submitted.
     * If it has been, we do not submit it again.
     */
    
     if (eval(this.oldValidator.valueOf())) { // is FrontPage validation successful?
    
      if (this.notSubmittedYet) {  //did user click Submit already?
       this.notSubmittedYet = false;
       return true; // submit form
      }
    
      else { // form already submitted; complain to user
       alert("You have already submitted the form.  Please be patient. \nThe Internet has had a busy day and is a little tired, but as soon as it catches its breath, it will deliver your confirmation message.");
       return false;  // don't submit form
      }
    
     }
    
     else { // FrontPage validator found error
      return false;  // don't submit form
     }
    
    } // end enhancedValidator()





   var submitcount=0;
 
   function reset() {
      document.ckCapform.teamname.value="";
      document.ckCapform.teamname.value="";
      document.ckCapform.userID.value="";
      }

   function checkFields() {                       // field validation -
       if ( (document.ckCapform.Location.value=="")  ||   // checks if fields are blank.
            (document.ckCapform.teamname.value=="") ||   // More validation scripts at
            (document.ckCapform.userID.value=="") ) // forms.javascriptsource.com
          {
           alert("Please enter your County, Team Name, and Captains Password then re-submit this form.");
           return false;
           }
      
       else 
         {
         if (submitcount == 0)
            {
            submitcount++;
            return true;
            }
         else 
            {
            alert("This form has already been submitted.  Thanks!");
            return false;
             }
          }
       }
      //  End -->

     
