function grouphelp() {
    helptext = new Array;
    helptext ="To become a manager, you must specify a name for your " +
        "working group. \nClients will enter this word to when logging " +
        "in to use your schedules.\nYour group name should be ONE word " +
        "and should contain NO spaces.\n(Dashes and underscore characters " +
        "are OK.)\n\nHere are some examples:\n\n" +
        "CCRC  		The Complex Carbohydrate Research Center\n" +
        "CEPCEB  	Center for Plant Cell Biology, Botany & Plant Sciences\n" +
        "CU-NMR         Cornell University - NMR\n" +
        "IMRR           Institue for Magnetic Resonance Research\n" +
        "UGA-BCMB  	The University of Georgia Biochemistry Department\n" ;
    alert(helptext);
}

function trim(str,chr) {
  while (str.charAt(0) == chr)  {
     str = str.substring(1,str.length);
  }
  while (str.charAt(str.length - 1) == chr)  {
     str = str.substring(0,str.length - 1);
  }
  return str;
}


function checkString(ss,req,txt) {
  eval("sss = this.document.forms[0]." + ss + ".value");
  sss = trim(sss,' ');
  eval("this.document.forms[0]." + ss + ".value = sss");
  if (sss.length == 0) {
    if (req == 1)  {
      alert(" Please Enter Your " + txt +".");
      return 0;
    } else {
      eval("this.document.forms[0]." + ss + ".value = 'none'");
    }
  }
  return 1;
}

function checkSubmit() {
  badchar = new Array(' ', '!', '@', '#', '%', '$', '%', '^',
                      '&', '*', '(', ')', '+', '=', '?', '\\',
                      '/', '|', '{', '}', '[', ']', '<', '>',
                      '.', ',','\'','\"');


  if (checkString("account",1,"Account") == 0) return;
  if (checkString("email",1,"E-Mail Address") == 0) return;
  if (checkString("first",1,"First Name") == 0) return;
  if (checkString("last",1,"Last Name") == 0) return;
  if (checkString("place",1,"Institution") == 0) return;
  checkString("street",0,"");
  checkString("city",0,"");
  checkString("state",0,"");
  checkString("pcode",0,"");
  checkString("country",0,"");
  checkString("phone",0,"");

  account = this.document.forms[0].account.value;
  for (i=0; i<28; i++) {
  if (account.indexOf(badchar[i]) >= 0){
      if ( badchar[i] == ' ') {
        alert("The account name you requested ( " + account + " ) is not a valid account name because it contains at least one space."); 
      } else {
        alert("The account name you requested ' " + account + " ' is not a valid account name because it contains the character ' " + badchar[i] + " '.");
      }
      return;
    }
  }

  email = this.document.forms[0].email.value;
  if (email.indexOf(" ") >= 0){
    alert("Your email ' " + email + " ' cannot have spaces in it");
    return;
  }
  if ( (email.indexOf("@") == -1) || (email.indexOf(".") == -1) ){
    alert("Please check your email");
    return;
  } 

  floater2 = window.open('terms.html','floater2','resizable,scrollbars,status,width=540,height=460');
  if (floater2.opener == null) floater2.opener = this;
}

function getPrivacy() {
  floater3 = window.open('http://128.192.9.30/web/tp/privacyw.html',
       'floater3','resizable,scrollbars,status,width=640,height=250');
}

function getDisclaimer() {
  floater4 = window.open('http://128.192.9.30/web/tp/disclaimer.html',
       'floater4','resizable,scrollbars,status,width=640,height=450');
}
//*************
