   // PRINT ERROR MSG
   //--

   function fixError(formField, EmptyField){
        alert('Please enter a value for the "' + EmptyField +'" field.');
        formField.focus();
        return false;
        }


    // DIGIT VALIDATION
    //--
    function allDigits(str){  return ValidCharSet(str,"0123456789.");  }

    //INVALID CHAR SET
    function goodString(str){  return notValidCharSet(str,"~@^*+\?><;");   }

    //INVALID CHAR SET
    function noquotes(str){  return notValidCharSet(str,'"');   }


    // ALPHA VALIDATION
    //--
    function allAlpha(str){ return ValidCharSet(str,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.- '");  }


    //PHONE VALIDATION
    function goodPhone(str){  return ValidCharSet(str,"0123456789-() ");  }

    // VALIDATE CHAR IN STRING
    //--
    function ValidCharSet(str,charset){
        var result = true;
            // Note: doesn't use regular expressions
            //       to avoid early Mac browser bugs
            //ex:  str: h*ello  is 'h' in charset...yes well keep going, is '*' in charset...no stop fall out found bad char
        for (var i=0;i<str.length;i++){
                if (charset.indexOf(str.substr(i,1))<0){
                  //      alert("Coud not find it in charset" + str.substr(i,1) );
                        result = false;
                        break;
                        }
        }
        return result;
        }
      
    // VALIDATE STRING NOT IN BAD CHARSET
    //--
    function notValidCharSet(str,badcharset){
        var result = true;
            // Note: doesn't use regular expressions
            //       to avoid early Mac browser bugs
            //ex:  str: h*ello  is 'h' in charset...yes STOP fount bad character
        for (var i=0;i<str.length;i++)
                if (badcharset.indexOf(str.substr(i,1))>=0){
                        //alert("Found it: " + str.substr(i,1) + "STOP" );
                        result = false;
                        break;
                        }
        return result;
        }



   //VALIDATE FIELD HAS BEEN CHANGED BY USER
   //--
   //      formField = specific form field
   //   defaultValue = default String in text box
   //     EmptyField = variable for field with missing user data
   //--
     function validRequired(formField, defaultValue,EmptyField){

//alert("formField.value:" + formField.value + "    defaultValue: "+ defaultValue);
        var result = true;
          if ( (formField.value == defaultValue) || (formField.value.length == 0) ) {
                result = fixError(formField, EmptyField);
                }

        return result;
        }


    // VALIDATE PULLDOWN MENUS
    //--
    function validReqPDmenu(formField, defaultValue,EmptyField){

        var result = true;
          //alert ("In validReqPDmenu and defaultvalue = "+defaultValue);
          if (formField.value == defaultValue) {

                alert("Please Select a value for " + EmptyField +" in the pulldown menu.");
                formField.focus();
                result = false;
                }

        return result;
        }


   // Validate Name
   //--
   function validateName(formFieldfname, formFieldlname) {

//alert (formFieldfname.value);

       //validate first name
       if (!validRequired(formFieldfname, "First", "First Name")){
               return false;

        }else{
               if (!allAlpha(formFieldfname.value)){
                   alert("Invalid First Name, No special Characters or Numbers");
                   formFieldfname.focus();
                   return false; }
        }

        //validate last name
        if (!validRequired(formFieldlname, "Last", "Last Name")){
                return false;
        }else{

                if (!allAlpha(formFieldlname.value)){
                   alert("Invalid Last Name, No special Characters or Numbers");
                   formFieldlname.focus();
                   return false; }
        }
        return true;
    }//--validateName


   // Validate any Text Boxes
   //--
   function validateTbox(formField,AlertText) {

//       alert (formField.value);

       if (!allAlpha(formField.value)){
                   alert('' + AlertText + ': Invalid Entry, No special Characters or Numbers');
                   formField.focus();
                   return false; }
        return true;
    }//--validateTbox

//-------VALIDATE THE FORMS USING THE FUNCTIONS ABOVE----------------
//--
//--
//------------------VALIDATE LOGIN---------------------

//------------------BEGIN new_registration--------------
   function validateForm (myform) {
     
            //validate name
            if (!validateName(myform.fname,myform.lname))
                return false;

            //email
            if (myform.email.value.length == 0){
                   alert("Please enter your email address.");
                   myform.email.focus();
               return false;
               }
            if (!ValidCharSet("@.",myform.email.value)){
                   alert("Your email address is invalid. Must contain '@' and '.'\n" + "Ex: j_doe@insite.com");
                   myform.email.focus();
               return false;
               }


            //address-street-city-zip
            if(myform.street.value.length>0) {
               if (!goodString(myform.street.value)){
                   alert("Address - Street: Invalid. Must not contain '~@^*+\?><;' \n" + "Ex: 700 Park Avenue");
                   myform.street.focus();
                   return false;
               }
            }
            if(myform.city.value.length>0) {  if (!validateTbox(myform.city,"Address - City"))  return false;}
            if(myform.zip.value.length>0) {  if (!allDigits(myform.zip.value)) { alert('Zip Code:  Invalid Entry, Use Only Numbers.'); return false;}}
 
            //phone-fax
            if(myform.phone.value.length>0) {
               if (!goodPhone(myform.phone.value)){
                   alert("Phone #: Invalid. Ex: (757) 555-1000");
                   myform.phone.focus();
                   return false;
               }
            }
            if(myform.fax.value.length>0) {
               if (!goodPhone(myform.fax.value)){
                   alert("Fax #: Invalid. Ex: (757) 555-1000");
                   myform.fax.focus();
                   return false;
               }
            }
           //-REQUIRED designation
           if (myform.Classification.value.length == 0){ 
                  alert("Please select your Designation.");
                   myform.Classification.focus();
               return false;
               }
            //-REQUIRED 1st Choice Workshop
            if (myform.choice1.value.length == 0){
                  alert("Please select your 1st Choice for a Workshop.");
                  myform.choice1.focus();
                return false;
             }
 
            //-REQUIRED 2nd Choice Workshop
            if (myform.choice2.value.length == 0){
                  alert("Please select your 2nd Choice for a Workshop.");
                  myform.choice2.focus();
                return false;
             }

           

            if(myform.inst.value.length>0) {  if (!validateTbox(myform.inst,"School/Organization")) return false; }

            if(myform.ptitle.value.length>0) {

               if (!goodString(myform.ptitle.value)){
                   alert("Poster Title:  Invalid. Must not contain '~@^*+\?><;' \n" + "EX: The Bridge Between Computers and Science");
                   myform.ptitle.focus();
                   return false;
               }
               if (!noquotes(myform.ptitle.value)){
                   alert("Poster Title:  Invalid. Must not contain double quotes.\n" + "Use single quotes instead.\n" +
                         "Ex: 'The Bridge Between Computers and Science'");
                   myform.ptitle.focus();
                   return false;
               }

            }



        return true;
        }
//-----------------END new_registration--------------



//------------------BEGIN reg_recall-----------------
// 
   function ValidSignin (form1) {
       if (form1.email.value.length<=0){  alert("Enter Your Email Address in the Box Provided");  form1.email.focus(); return false;  }
       if (!ValidCharSet("@.",form1.email.value)){
                   alert("Your email address is invalid. Must contain '@' and '.'\n" + "Ex: j_doe@insite.com");
                   form1.email.focus();
               return false;
               }

   }//ValidSignin
   function ValidateUpdate (myform) {
//alert(myform.street.value);

            //validate fname,lname
            if (!validateName(myform.fname,myform.lname))
                return false;

            if(myform.inst.value.length>0) {  if (!validateTbox(myform.inst,"School/Organization")) return false; }
 
            if(myform.street.value.length>0) { 
               if (!goodString(myform.street.value)){
                   alert("Address - Street: Invalid. Must not contain '~!@%^*()_+{}|\?\"><' \n" + "Ex: 700 Park Avenue");
                   myform.street.focus();
                   return false;
               }
            }


            if(myform.city.value.length>0) {  if (!validateTbox(myform.city,"Address - City"))  return false;}
            if(myform.zip.value.length>0) {  if (!allDigits(myform.zip.value)) { alert('Zip Code:  Invalid Entry, Use Only Numbers.'); return false;}}
            if(myform.phone.value.length>0) {
               if (!goodPhone(myform.phone.value)){
                   alert("Phone #: Invalid. Ex: (757) 555-1000");
                   myform.phone.focus();
                   return false;
               }
            }

            if(myform.fax.value.length>0) {
               if (!goodPhone(myform.fax.value)){
                   alert("Fax #: Invalid. Ex: (757) 555-1000");
                   myform.fax.focus();
                   return false;
               }
            }

//alert("before ptitle validation");
            if(myform.ptitle.value.length>0) {
//alert("inside ptitle validation");

               if (!goodString(myform.ptitle.value)){
                   alert("Poster Title:  Invalid. Must not contain '~!@%^*()_+{}|\?><' \n" + "EX: The Bridge Between Computers and Science");
                   myform.ptitle.focus();
                   return false;
               }
               if (!noquotes(myform.ptitle.value)){
                   alert("Poster Title:  Invalid. Must not contain double quotes.\n" + "Use single quotes instead.\n" + 
                         "Ex: 'The Bridge Between Computers and Science'");
                   myform.ptitle.focus();
                   return false;
               }

            }




        return true;
        }
//-----------------END reg_recall--------------------




