
 var origMsg = "Watch this space for helpful navigation tips!";
 var msg = origMsg;
 var ok = 0;

 // left in to prevent errors on pages that still refer to it
 function init(){
	   return false;
 }

function newWindow(url, windowName){
     open(url, windowName, 'scrollbars=1,resizable=1,width=600,height=400');
}

 function showLayer(layerName){
       if (document.getElementById) {
		 var h = document.getElementById(layerName);
         h.style.visibility='visible';
       }
 }

 function hideLayer(layerName){
       if (document.getElementById) {
		 var h = document.getElementById(layerName);
         h.style.visibility='hidden';
       }
 }

// ---------------------------------------------------------------------------
// JUST FOR THE CGI Demo section:

 function cgiWindow (url, windowName){
     alert ('A new window will be opened for viewing.\n When you are done, simply close it\n to return to this section.');
     open(url, windowName, 'width=600,height=400,status,resizable,scrollbars,toolbar=no,location=1,menubar');
 }

//------------------------------------------------------------------------------
// FORM CHECKS: Pass all required fields in the form:
//  ('formName', 'required1,required2,required3', EmailName)

function CheckForm(form, required, EmailName) {
    if (  ok == 1 ) {

        var requArray = required.split(',');
        var checkThis = "";
        var msg = "";
        var insertAnd = requArray.length - 1;
        var passChecks = true;

        for (i=0; i<requArray.length; i++) {
            checkThis = eval('form.' + requArray[i] + '.value');
            if ((checkThis == "") || (checkThis == null)) {
                msg = "In order to submit this form,\n" +
                      "you need to fill out the ";
                      for (k=0; k<requArray.length; k++) {
                          if (k == insertAnd) {
                             if (k > 0) {  msg += 'and ' + requArray[k] + ' fields.';  }
                             else { msg += requArray[k] + ' field.' }
                          }
                          else { msg += requArray[k] + ', '; }
                      }
                msg += '\n';
                passChecks = false; break;
            }
        }
        if (EmailName) {
            if ((passChecks == true) && (eval('form.' + EmailName + '.value') != "")) {
                var found = false;
                var emailString = eval ('form.' + EmailName + '.value');
                for (j=0; j < emailString.length; j++) {
                    if (emailString.charAt(j) == "@") { found = true; }
                }
                if (found == false) {
                    msg = 'Is that your true email address?\n' +
                          'Please enter your correct email address.\n' +
                          'We will not place you on any mailing lists!\n';
                    passChecks = false;
                }
            }
        }

        if (passChecks == true) { form.submit(); }
        else if (passChecks == false) {  alert(msg);  }

     } // End if ok == 1
     else { return 0;  }

}

// CLEAR FORM --------------------------------------------------------------------------
// A little snippet to clear the text that loads in the fields, where focusField is field
// to focus on after clearing (make a blank '' if none is desired:
// ClearForm (this.form, 'field1,field2,field3', field1);

function ClearForm(form, fields, focusField) {

        var clearArray = fields.split(',');
        for (j=0; j<clearArray.length; j++) {
           eval('form.' + clearArray[j] + '.value = ""');
        }
        if (focusField !="") {
           focusOn = eval('form.' + focusField);
           focusOn.focus();
        }
}

