window.onerror=fakefunction;

function fakefunction(){
return true;

}


   function isNum(arg) {
      arg = Trim(arg);
      // Internal function to test whether argument is a number
      if (arg == "")
         return false;
      for (i=0; i<arg.length; i++) {
         if (arg.charAt(i) < "0" || arg.charAt(i) > "9") {
            return false;
         }
      }
      return true;
   }

function Trim(arg) {
      // strip leading and trailing spaces
      while (arg.charAt(0) == " ") {
            arg = arg.substring(1,arg.length);
      }
      while (arg.charAt(arg.length-1) == " ") {
            arg = arg.substring(0,arg.length-1);
      }  

      return arg;
}
function isNoData( str ) {
	var returnValue = true;
	var crFound = true;
	for (i=0; i < str.length; i++) {
		if (str.charAt(i) == "\r" && i + 1 <= str.length) {
			var crCheck = str.charAt(i) + str.charAt(i + 1);
			if (crCheck != "\r\n") {
				returnValue = false;
				break;
			}
		}
		else if (str.charAt(i) != " " && str.charAt(i) != "\n") {
			returnValue = false;
			break;
		}
	}
	return (returnValue);
}
      

   function monthToNum(monthStr) {
      // Internal function to convert a month string to numeric 1-12
      if (monthStr=="")
         return false;
      var m = monthStr;
      if (monthStr.length>3)
         var m = monthStr.substring(0,2);
      if (m=="jan" || m=="Jan" || m=="JAN")
         return 1;
      else if (m=="feb" || m=="Feb" || m=="FEB")
         return 2;
      else if (m=="mar" || m=="Mar" || m=="MAR")
         return 3;
      else if (m=="apr" || m=="Apr" || m=="APR")
         return 4;
      else if (m=="may" || m=="May" || m=="MAY")
         return 5;
      else if (m=="jun" || m=="Jun" || m=="JUN")
         return 6;
      else if (m=="jul" || m=="Jul" || m=="JUL")
         return 7;
      else if (m=="aug" || m=="Aug" || m=="AUG")
         return 8;
      else if (m=="sep" || m=="Sep" || m=="SEP")
         return 9;
      else if (m=="oct" || m=="Oct" || m=="OCT")
         return 10;
      else if (m=="nov" || m=="Nov" || m=="NOV")
         return 11;
      else if (m=="dec" || m=="Dec" || m=="DEC")
         return 12;
      else
         return 0;
   }

   function validDate(dateField,errMsg,fmt) {

      // Validates a date input field
      // Arguments: 
      //    1. reference to the date-entry field:
      //    2. error message (if passed empty, uses default)
      //    3. date display format (defaults to 'dd MMM yyyy')
      // Called as onChange="return validDate(this,'Duh!','0')"
      // Function converts date to a standard database format
      //    or selects invalid entry and prompts the user
      // If year does not include century, and year < 10 (n),
      //    converts the century to 2K+
      
      var ds = dateField.value;
      // bail if the date parameter is empty
      if (ds == "")
         return true;
      
      // suppress browser error dialogs on date function calls
      window.onerror = null;
      
      // declare local variables
      var n = 10;   // the Y2K offset in years
      var today = new Date();
      var err = 0;  // error flag
      var month = "";
      var d;
      var m;
      var y;
      var p1 = 0;
      var p2 = 0;
      var dd = 0;
      var mm = 0;
      var yy = 0;
      
      var e = errMsg;
      if (errMsg == "") {
         // default error message if second parameter is empty 
         e = "Invalid date! Please re-enter using a standard format...";
      }
      
      // strip leading and trailing spaces
      while (ds.charAt(0) == " ") {
            ds = ds.substring(1,ds.length);
//            dateField.value = ds;
      }
      while (ds.charAt(ds.length-1) == " ") {
            ds = ds.substring(0,ds.length-1);
//            dateField.value = ds;
      }  
      
      // handle common data-entry shortcuts
      if (ds == "t" || ds == "today" || ds == "0") {
            dd = today.getDate();
            mm = today.getMonth() + 1;
            yy = today.getYear();
            ds = mm + "/" + dd + "/" + yy;
      }
      else if (ds.length < 3 && isNum(ds)) {
         // try as a date in the current month and year
         if (parseInt(ds) < 32) {
            dd = ds;
            mm = today.getMonth() + 1;
            yy = today.getYear();
            ds = mm + "/" + dd + "/" + yy;
         }
      }
      else if (ds.length == 3 && monthToNum(ds) > 0) {
         // assume it's a month string, set date as 1st
         dd = 1;
         mm = monthToNum(ds);
         yy = today.getYear();
         ds = mm + "/" + dd + "/" + yy;
      }
      else if (ds.length == 4 && isNum(ds)) {
         // assume it's a year (yyyy), set date as 1st January
         dd = 1;
         mm = 1;
         yy = ds;
         ds = mm + "/" + dd + "/" + yy;
      }
      else if (ds.length>4 && ds.length<7 && monthToNum(ds.substring(0,3))>0 && ds.indexOf(" ",0)>0) {
         // assume it's a month and day (mmm d[d]), set year as current
         p1 = ds.indexOf(" ");   // position of space
         dd = ds.substring(p1+1,ds.length);
         mm = monthToNum(ds.substring(0,3));
         yy = today.getYear();
         ds = mm + "/" + dd + "/" + yy;
      }
      else if (ds.length>2 && ds.length<6 && ds.indexOf("/",0)>0 && ds.indexOf("/",0)==ds.lastIndexOf("/")) {
         // assume it's a month and day (mm/dd), set year as current
         p1 = ds.indexOf("/");   // position of slash
         mm = ds.substring(0,p1);
         dd = ds.substring(p1+1,p1+3);
         yy = today.getYear();
         if (dd.charAt(0) == "0") dd = dd.substring(1,2);
         if (mm.charAt(0) == "0") mm = mm.substring(1,2);
         ds = mm + "/" + dd + "/" + yy;
      }
      else if (ds.length>2 && ds.length<6 && ds.indexOf(" ",0)>0 && ds.indexOf(" ",0)==ds.lastIndexOf(" ")) {
         // assume it's a month and day (mm dd), set year as current
         p1 = ds.indexOf(" ");   // position of space
         mm = ds.substring(0,p1);
         dd = ds.substring(p1+1,p1+3);
         yy = today.getYear();
         if (dd.charAt(0) == "0") dd = dd.substring(1,2);
         if (mm.charAt(0) == "0") mm = mm.substring(1,2);
         ds = mm + "/" + dd + "/" + yy;
      }
      else if (ds.length>2 && ds.length<6 && ds.indexOf("-",0)>0 && ds.indexOf("-",0)==ds.lastIndexOf("-")) {
         // assume it's a day and month (dd-mm), set year as current
         p1 = ds.indexOf("-");   // position of dash
         dd = ds.substring(0,p1);
         mm = ds.substring(p1+1,ds.length);
         yy = today.getYear();
         if (dd.charAt(0) == "0") dd = dd.substring(1,2);
         if (mm.charAt(0) == "0") mm = mm.substring(1,2);
         ds = mm + "/" + dd + "/" + yy;
      }
      
      if (ds.indexOf("-",0)>0 && ds.indexOf("-",0)<3) {
         // test for DD-MMM-YYYY standard format
         if (ds.length == 11 && ds.indexOf("-",0) == 2 && ds.lastIndexOf("-") == 6) {
            dd = ds.substring(0,2);
            mm = monthToNum(ds.substring(3,6));
            yy = ds.substring(7,11);
            if (dd.charAt(0) == "0") dd = dd.substring(1,2);
            if (isNum(mm+dd+yy)) {
               ds = mm + "/" + dd + "/" + yy;
            }
            else {
               mm = 0;
               dd = 0;
               yy = 0;
            }
         }
         // test for DD-MMM-YY abbreviated format
         else if (ds.length == 9 && ds.indexOf("-",0) == 2 && ds.lastIndexOf("-") == 6) {
            dd = ds.substring(0,2);
            mm = monthToNum(ds.substring(3,6));
            yy = (parseInt(ds.substring(7,9))<n) ? ("20" + ds.substring(7,9)) : ("19" + ds.substring(7,9));
            if (dd.charAt(0) == "0") dd = dd.substring(1,2);
            if (isNum(mm+dd+yy)) {
               ds = mm + "/" + dd + "/" + yy;
            }
            else {
               mm = 0;
               dd = 0;
               yy = 0;
            }
         }
         // test for DD-MM-YY[YY] format
         else {
            p1 = ds.indexOf("-");   // position of first dash
            dd = ds.substring(0,p1);
            p2 = ds.lastIndexOf("-");   // position of last dash
            mm = ds.substring(p1+1,p2);
            yy = ds.substring(p2+1,ds.length);
            if (dd.charAt(0) == "0") dd = dd.substring(1,2);
            if (mm.charAt(0) == "0") mm = mm.substring(1,2);
            if (yy.length > 4) yy = yy.substring(0,4);
            if (dd==0 || mm==0) {
                  mm = 0;
                  dd = 0;
                  yy = 0;
            }
            else {
               if (yy == "0" || yy == "00" || yy == "000") yy = "2000";
               while (yy.substring(0,1)=="0") {
                  yy = yy.substring(1,yy.length);  // remove leading zeroes
               }
               if (yy == "") yy = today.getYear();
               if (isNum(mm+dd+yy)) {
                  if (yy > 0 && yy < 100) {
                     yy = (yy < n) ? (2000 + parseInt(yy)) : (1900 + parseInt(yy));
                  }
                  ds = mm + "/" + dd + "/" + yy;
               }
               else {
                     mm = 0;
                     dd = 0;
                     yy = 0;
               }
            }
         }
      }
      
      // test for MMDDYY patterned formats
      else if (ds.length == 6 && isNum(ds)) {
         dd = ds.substring(2,4);
         mm = ds.substring(0,2);
         yy = ds.substring(4,6);
         if (dd.charAt(0) == "0") dd = dd.substring(1,2);
         if (mm.charAt(0) == "0") mm = mm.substring(1,2);
         if (yy.charAt(0) == "0") yy = yy.substring(1,2);
         if (yy == "0" || yy == "00") yy = "2000";
         if (yy > 0 && yy < 100) {
            yy = (yy < n) ? (2000 + parseInt(yy)) : (1900 + parseInt(yy));
         }
         ds = mm + "/" + dd + "/" + yy;
      }
      
      // test for MMDDYYYY patterned formats
      else if (ds.length == 8  && isNum(ds)) {
         dd = ds.substring(2,4);
         mm = ds.substring(0,2);
         yy = ds.substring(4,8);
         if (yy == "0" || yy == "00" || yy == "000") yy = "2000";
         if (dd.charAt(0) == "0") dd = dd.substring(1,2);
         if (mm.charAt(0) == "0") mm = mm.substring(1,2);
         ds = mm + "/" + dd + "/" + yy;
      }
      
      // convert year 2K+ for MM/DD/YY[YY] pattern formats
      else if (ds.indexOf("/",0) > 0 && (ds.length-ds.lastIndexOf("/")) < 6) {
         p1 = ds.indexOf("/");   // position of first slash
         mm = ds.substring(0,p1);
         p2 = ds.lastIndexOf("/");   // position of last slash
         dd = ds.substring(p1+1,p2);
         yy = ds.substring(p2+1,ds.length);
         if (dd.charAt(0) == "0") dd = dd.substring(1,2);
         if (mm.charAt(0) == "0") mm = mm.substring(1,2);
         if (yy.length > 4) yy = yy.substring(0,4);
         if (yy == "0" || yy == "00" || yy == "000") yy = "2000";
         while (yy.substring(0,1)=="0") {
            yy = yy.substring(1,yy.length);  // remove leading zeroes
         }
         if (yy == "") yy = today.getYear();
         if (isNum(mm+dd+yy)) {
            if (yy > 0 && yy < 100) {
               yy = (yy < n) ? (2000 + parseInt(yy)) : (1900 + parseInt(yy));
            }
            ds = mm + "/" + dd + "/" + yy;
         }
         else {
               mm = 0;
               dd = 0;
               yy = 0;
         }
      }
      
      // convert year 2K+ for MM.DD.YY[YY] pattern formats
      else if (ds.indexOf(".",0) > 0 && (ds.length-ds.lastIndexOf(".")) < 6) {
         p1 = ds.indexOf(".");   // position of first dot
         mm = ds.substring(0,p1);
         p2 = ds.lastIndexOf(".");   // position of last dot
         dd = ds.substring(p1+1,p2);
         yy = ds.substring(p2+1,ds.length);
         if (dd.charAt(0) == "0") dd = dd.substring(1,2);
         if (mm.charAt(0) == "0") mm = mm.substring(1,2);
         if (yy.length > 4) yy = yy.substring(0,4);
         if (yy == "0" || yy == "00" || yy == "000") yy = "2000";
         while (yy.substring(0,1)=="0") {
            yy = yy.substring(1,yy.length);  // remove leading zeroes
         }
         if (yy == "") yy = today.getYear();
         if (isNum(mm+dd+yy)) {
            if (yy > 0 && yy < 100) {
               yy = (yy < n) ? (2000 + parseInt(yy)) : (1900 + parseInt(yy));
            }
            ds = mm + "/" + dd + "/" + yy;
         }
         else {
               mm = 0;
               dd = 0;
               yy = 0;
         }
      }
      
      // validate the standard space-delimited formats
      else if (ds.indexOf(" ",0)>0 && (ds.length-ds.lastIndexOf(" "))<6) {
         if (ds.indexOf(",",0) > 0) {
            // validate 'mmm[...] dd, yy[yy]' type formats
            p1 = ds.indexOf(" ");   // position of first space
            mm = monthToNum(ds.substring(0,3));
            dd = ds.substring(p1+1,ds.indexOf(",",0));
            p2 = ds.lastIndexOf(" ");   // position of last space
            yy = ds.substring(p2+1,ds.length);
            if (dd.charAt(0) == "0") dd = dd.substring(1,2);
            if (yy.length > 4) yy = yy.substring(0,4);
            if (yy == "0" || yy == "00" || yy == "000") yy = "2000";
            while (yy.substring(0,1)=="0") {
               yy = yy.substring(1,yy.length);  // remove leading zeroes
            }
            if (yy == "") yy = today.getYear();
            if (isNum(mm+dd+yy)) {
               if (yy > 0 && yy < 100) {
                  yy = (yy < n) ? (2000 + parseInt(yy)) : (1900 + parseInt(yy));
               }
               ds = mm + "/" + dd + "/" + yy;
            }
            else {
               mm = 0;
               dd = 0;
               yy = 0;
            }
         }
         
         else if (monthToNum(ds.substring(ds.indexOf(" ")+1,ds.indexOf(" ")+4))>0) {
            // validate 'dd mmm[...] yy[yy]' type formats
            p1 = ds.indexOf(" ");   // position of first space
            dd = ds.substring(0,p1);
            if (dd.charAt(0) == "0") dd = dd.substring(1,2);
            p2 = ds.lastIndexOf(" ");   // position of last space
            mm = monthToNum(ds.substring(p1+1,p1+4));   // extract 3 bytes for month
            yy = ds.substring(p2+1,ds.length);
            if (yy.length > 4) yy = yy.substring(0,4);
            if (yy == "0" || yy == "00" || yy == "000") yy = "2000";
            while (yy.substring(0,1) == "0") {
               yy = yy.substring(1,yy.length);  // remove leading zeroes
            }
            if (yy == "") yy = today.getYear();
            if (isNum(mm+dd+yy)) {
               if (yy > 0 && yy < 100) {
                  yy = (yy < n) ? (2000 + parseInt(yy)) : (1900 + parseInt(yy));
               }
               ds = mm + "/" + dd + "/" + yy;
            }
            else {
               mm = 0;
               dd = 0;
               yy = 0;
            }
         }
         
         // validate 'MM DD YY[YY]' formats
         else {
            p1 = ds.indexOf(" ");   // position of first space
            mm = ds.substring(0,p1);
            p2 = ds.lastIndexOf(" ");   // position of last space
            dd = ds.substring(p1+1,p2);
            yy = ds.substring(p2+1,ds.length);
            if (dd.charAt(0) == "0") dd = dd.substring(1,2);
            if (mm.charAt(0) == "0") mm = mm.substring(1,2);
            if (yy.length > 4) yy = yy.substring(0,4);
            if (yy == "0" || yy == "00" || yy == "000") yy = "2000";
            while (yy.substring(0,1)=="0") {
               yy = yy.substring(1,yy.length);  // remove leading zeroes
            }
            if (yy == "") yy = today.getYear();
            if (isNum(mm+dd+yy)) {
               if (yy > 0 && yy < 100) {
                  yy = (yy < n) ? (2000 + parseInt(yy)) : (1900 + parseInt(yy));
               }
               ds = mm + "/" + dd + "/" + yy;
            }
            else {
               mm = 0;
               dd = 0;
               yy = 0;
            }
         }
      }
      
      // attempt to parse any other dates with valid IETF formats
      if (dd==0 && mm==0 && yy==0) {
         d = new Date(Date.parse(ds));
         dd = d.getDate();
         mm = (d.getMonth() + 1);
         // Netscape returns last 2 digits of years 1900-1999,
         // and the full year (4 char) string for dates > 2000 or < 1900;
         // IE returns 1900 minus the current year in all cases,
         // <duh> except IE3, when the year is earlier than 1970 </duh>
         if (d.getYear() > 2000) {
            yy = d.getYear();  // Netscape
         }
         else if (d.getYear() < 1900 && d.getYear() > 200) {
            yy = d.getYear();  // Netscape, date prior to 1900
         }
         else {
            yy = (1900 + d.getYear());
         }
         if (dd == 31 && mm == 12 && yy == 1969) {
            // IE's start-epoch date
            mm = 0;
            dd = 0;
            yy = 0;
         }
         ds = mm + "/" + dd + "/" + yy;
      }
      
      // verify the date components
      if (parseInt(dd)>0 && parseInt(mm)>0 && parseInt(yy)+1>0) {
         if (mm < 1 || mm > 12) err = 1;
         if (dd < 1 || dd > 31) err = 1;
         if (yy < 1000 || yy > 9999) err = 1;
         
         // check the months with 30 days
         if (mm == 4 || mm == 6 || mm == 9 || mm == 11) {
            if (dd == 31) {
               dd = 1;  // flick it forward a day
               mm = mm + 1;
            }
         }
         // check February and leap years
         if (mm == 2) {
            if (dd > 29) err = 1;
            if (dd == 29 && ((yy/4) != parseInt(yy/4))) {
               dd = 1;  // flick it forward a day
               mm = 3;
            }
         }
      }
      
      // finally, test whether the input string can be Date.parsed
      d = new Date(Date.parse(ds));
      if (!d.getDate()) err = 1;
      
      if (err==1 || dd==0 || mm==0) {
         alert(e);
         dateField.select();
         dateField.focus();
         return false;
      }
      
      // we have a valid IETF date, so convert it to
      // the specified standard format for database entry
      if (parseInt(dd)<10 && (fmt < 4 || fmt > 6))
         dd = "0" + dd;   // add leading zero to days 1-9
      
      // convert month numeric to string
      if (mm == 1)
         month = "Jan";
      else if (mm == 2)
         month = "Feb";
      else if (mm == 3)
         month = "Mar";
      else if (mm == 4)
         month = "Apr";
      else if (mm == 5)
         month = "May";
      else if (mm == 6)
         month = "Jun";
      else if (mm == 7)
         month = "Jul";
      else if (mm == 8)
         month = "Aug";
      else if (mm == 9)
         month = "Sep";
      else if (mm == 10)
         month = "Oct";
      else if (mm == 11)
         month = "Nov";
      else if (mm == 12)
         month = "Dec";
      else month == "";
      // add leading zero to months 1-9 for mm formats
      if (fmt > 6 && mm < 10) mm = "0" + mm;

      // trim for yy formats
      if ((yy>99) && (fmt==0 || fmt==2 || fmt==5 || fmt==7 || fmt==9)) {
         yy = yy - (parseInt(yy/100)*100);
         if (yy < 10) yy = "0" + yy;
      }
      
      // re-test the date components
      if (dd==0 || dd=="" || month=="" || mm==0 || mm=="" || yy=="") {
         alert(e);
         dateField.select();
         dateField.focus();
         return false;
      }
      
     
      if (fmt == 1)
         dateField.value = dd + " " + month + " " + yy;
      else if (fmt == 2)
         dateField.value = dd + "-" + month + "-" + yy;
      else if (fmt == 3)
         dateField.value = dd + "-" + month + "-" + yy;
      else if (fmt == 4)
         dateField.value = month + " " + dd + ", " + yy;
      else if (fmt == 5)
         dateField.value = mm + "/" + dd + "/" + yy;
      else if (fmt == 6)
         dateField.value = mm + "/" + dd + "/" + yy;
      else if (fmt == 7)
         dateField.value = mm + "/" + dd + "/" + yy;
      else if (fmt == 8)
         dateField.value = mm + "/" + dd + "/" + yy;
      else if (fmt == 9)
         dateField.value = mm + " " + dd + " " + yy;
      else if (fmt == 10)
         dateField.value = mm + " " + dd + " " + yy;
      else if (fmt == 11)
         dateField.value = yy + mm + dd;
      else
         dateField.value = dd + " " + month + " " + yy;
      
      return true;
   }
   function validFax(dataField,errMsg) {
      var ds = dataField.value;
      var dsTemp
      // bail if the data parameter is empty
      if (ds == "")
         return true;
      
      window.onerror = null;

      // declare local variables
      var err = 0;  // error flag
      var p1 = 0;
      var p2 = 0;
      var p3 = 0;      
      var e;
      
      // strip spaces, dashes, parens, dots      
      dsTemp = ""
      for (var i = 0; i < ds.length; i++) {
         if ((ds.charAt(i) != " ") && (ds.charAt(i) != "-") && (ds.charAt(i) != "(") && (ds.charAt(i) != ")") && (ds.charAt(i) != ".")) {
            dsTemp = dsTemp + ds.charAt(i);
         }
      }
      ds = dsTemp;

      if (!isNum(ds)) {
         err=1
         e = "Your fax number may contain only digits, dashes, parens, and dots."
      }

      else if (ds.length != 10) {
         err=1
         e = "Your fax number must contain 10 digits."
      }

      if (err==1) {
         alert(e);
         dataField.select();
         dataField.focus();
         return false;
      }

      p1 = ds.substring(0,3);
      p2 = ds.substring(3,6);
      p3 = ds.substring(6,10);
      dataField.value = "(" + p1 + ") " + p2 + "-" + p3;
      
      return true;
   }
   function validZIP(dataField) {
      var ds = dataField.value;
      var dsTemp
      // bail if the data parameter is empty
      if (ds == "")
         return true;
      
      window.onerror = null;

      // declare local variables
      var err = 0;  // error flag
      var p1 = 0;
      var p2 = 0;
      var p3 = 0;
      var e;
      
      // strip spaces and dashes      
      dsTemp = ""
      for (var i = 0; i < ds.length; i++) {
         if ((ds.charAt(i) != " ") && (ds.charAt(i) != "-")) {
            dsTemp = dsTemp + ds.charAt(i);
         }
      }
      ds = dsTemp;

      if (!isNum(ds)) {
         err=1
         e = "Your ZipCode may contain only digits and a dash."
      }

      else if ((ds.length != 5) && (ds.length != 9)) {
         err=1
         e = "Your ZipCode may contain only 5 or 9 digits."
      }

      if (err==1) {
         alert(e);
         dataField.select();
         dataField.focus();
         return false;
      }

      if (ds.length == 5) {
         dataField.value = ds;
      }
      else {
         p1 = ds.substring(0,5);
         p2 = ds.substring(5,9);
         dataField.value = p1 + "-" + p2;
      }

      return true;
   }
   function validPhone(dataField,errMsg) {
      var ds = dataField.value;
      var dsTemp
      // bail if the data parameter is empty
      if (ds == "")
         return true;
      
      window.onerror = null;

      // declare local variables
      var err = 0;  // error flag
      var p1 = 0;
      var p2 = 0;
      var p3 = 0;      
      var e;
      
      // strip spaces, dashes, parens, dots      
      dsTemp = ""
      for (var i = 0; i < ds.length; i++) {
         if ((ds.charAt(i) != " ") && (ds.charAt(i) != "-") && (ds.charAt(i) != "(") && (ds.charAt(i) != ")") && (ds.charAt(i) != ".")) {
            dsTemp = dsTemp + ds.charAt(i);
         }
      }
      ds = dsTemp;

      if (!isNum(ds)) {
         err=1
         e = "Your phone number may contain only digits, dashes, parens, and dots."
      }

      else if (ds.length != 10) {
         err=1
         e = "Your phone number must contain 10 digits."
      }

      if (err==1) {
         alert(e);
         dataField.select();
         dataField.focus();
         return false;
      }

      p1 = ds.substring(0,3);
      p2 = ds.substring(3,6);
      p3 = ds.substring(6,10);
      dataField.value = "(" + p1 + ") " + p2 + "-" + p3;
      
      return true;
   }
   function validEmailAddress(dataField) {
	var tmpAtPos, varDotPos;
	var e
	var ds = dataField.value;

	if (ds.length != 0) {
		tmpAtPos = ds.indexOf("@");
		tmpDotPos = ds.indexOf(".", tmpAtPos);

		if ((tmpAtPos == -1) || (tmpDotPos == -1)) {
			e = "The e-mail address you entered is not in a proper format.  Please check the entry."
			alert(e);
			dataField.select();
			dataField.focus();
			return false;
		}
	}
	
	return(true);
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function validateForm(theform){
	if (theform.fname.value.length < 1) {
	 alert("Please enter your first name and re-submit")
	 theform.fname.focus()
	 return false
	 }
	if (theform.lname.value.length < 1) {
	 alert("Please enter your last name and re-submit")
	 theform.lname.focus()
	 return false
	 }
	/*if (theform.company.value.length < 1) {
	 alert("Please enter the name of your company and re-submit")
	 theform.company.focus()
	 return false
	 }

	if (theform.address.value.length < 1) {
	 alert("Please enter your address and re-submit")
	 theform.address.focus()
	 return false
	 }

	if (theform.city.value.length < 1) {
	 alert("Please enter your city and re-submit")
	 theform.city.focus()
	 return false
	 }

	if (theform.state.value.length < 1) {
	 alert("Please enter your state and re-submit")
	 theform.state.focus()
	 return false
	 }

	if (theform.zip.value.length < 1) {
	 alert("Please enter your zip code and re-submit")
	 theform.zip.focus()
	 return false
	 }

	if (theform.phone.value.length < 1) {
	 alert("Please enter a 10 digit phone number and re-submit")
	 theform.phone.focus()
	  return false
	}
	*/
	if (theform.email.value.length < 1) {
	 alert("Please enter your email and re-submit")
	 theform.email.focus()
	  return false
	}
	/*
	howContact = theform.howcontactu.selectedIndex
	 if (theform.howcontactu.options[howContact].value =="") {
	 alert("Please select how do you want to be contacted and re-submit")
	 theform.howcontactu.focus()
	 return false
	}

// If Fax is selected on "How do you want to be contacted", then make sure they entered Fax Number.
	//alert(theform.howcontactu.options[howContact].value);
	if (theform.howcontactu.options[howContact].value == "Fax" && theform.fax.value == "") {
	alert("Please specify fax number and re-submit")
	theform.fax.focus()
	 return false
	}

// If Licensed, then they need to give the name of broker/dealer
	//alert(theform.howcontactu.options[howContact].value);
	if (theform.licensed[0].checked == true && theform.dealer.value == "") {
	alert("Please specify your Dealer/Broker.")
	theform.dealer.focus()
	 return false
	}
	//alert(theform.getpassword.checked);
	if (theform.getpassword.checked==false && theform.requestinfo.checked==false) {
	alert("Please select if you want to request a password and/or make request & comments")
	theform.getpassword.focus()
	 return false
	}*/

document.infoRequest.submit();

}

function validateRegForm(theform){
	if (theform.fname.value.length < 1) {
	 alert("Please enter your first name and re-submit")
	 theform.fname.focus()
	 return false
	 }
	if (theform.lname.value.length < 1) {
	 alert("Please enter your last name and re-submit")
	 theform.lname.focus()
	 return false
	 }
	/*if (theform.company.value.length < 1) {
	 alert("Please enter the name of your company and re-submit")
	 theform.company.focus()
	 return false
	 }

	if (theform.address.value.length < 1) {
	 alert("Please enter your address and re-submit")
	 theform.address.focus()
	 return false
	 }

	if (theform.city.value.length < 1) {
	 alert("Please enter your city and re-submit")
	 theform.city.focus()
	 return false
	 }

	if (theform.state.value.length < 1) {
	 alert("Please enter your state and re-submit")
	 theform.state.focus()
	 return false
	 }

	if (theform.zip.value.length < 1) {
	 alert("Please enter your zip code and re-submit")
	 theform.zip.focus()
	 return false
	 }

	if (theform.phone.value.length < 1) {
	 alert("Please enter a 10 digit phone number and re-submit")
	 theform.phone.focus()
	  return false
	}
	*/
	if (theform.email.value.length < 1) {
	 alert("Please enter your email and re-submit")
	 theform.email.focus()
	  return false
	}
	/*
	howContact = theform.howcontactu.selectedIndex
	 if (theform.howcontactu.options[howContact].value =="") {
	 alert("Please select how do you want to be contacted and re-submit")
	 theform.howcontactu.focus()
	 return false
	}

// If Fax is selected on "How do you want to be contacted", then make sure they entered Fax Number.
	//alert(theform.howcontactu.options[howContact].value);
	if (theform.howcontactu.options[howContact].value == "Fax" && theform.fax.value == "") {
	alert("Please specify fax number and re-submit")
	theform.fax.focus()
	 return false
	}

// If Licensed, then they need to give the name of broker/dealer
	//alert(theform.howcontactu.options[howContact].value);
	if (theform.licensed[0].checked == true && theform.dealer.value == "") {
	alert("Please specify your Dealer/Broker.")
	theform.dealer.focus()
	 return false
	}
	//alert(theform.getpassword.checked);
	if (theform.getpassword.checked==false && theform.requestinfo.checked==false) {
	alert("Please select if you want to request a password and/or make request & comments")
	theform.getpassword.focus()
	 return false
	}*/
	if (theform.cboxTerms.checked == false) {
	 alert("You must agree to the terms and conditions before registering.")
	 theform.cboxTerms.focus()
	 return false
	 }

document.infoRequest.submit();

}
