function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false}
else {return true}
}
}
// example of required
// function validate_form(thisform)
// {
// with (thisform)
// {
// if (validate_required(email,"Name must be filled out!")==false)
//   {name.focus();return false}
// }
// }

function validate_select(field,alerttxt)
{
with (field)
{
if (selectedIndex==null||selectedIndex=="0")
  {alert(alerttxt);return false}
else {return true}
}
}
// example of required
// Note:  Will only validate that index isn't 0 (the first option)
// function validate_form(thisform)
// {
// with (thisform)
// {
// if (validate_select(Item,"Must make a selection!")==false)
//   {Item.focus();return false}
// }
// }


function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false}
else {return true}
}
}

// example of email
// function validate_form(thisform)
// {
// with (thisform)
// {
// if (validate_email(email,"Not a valid e-mail address!")==false)
//   {email.focus();return false}
// }
// }

function validate_date(field,alerttxt)
{
with (field)
{
re = /^(\d{4})-(\d{2})-(\d{2})$/;
if (value==null||!value.match(re))
  {{alert(alerttxt);return false}
else {return true}
}
}

@@ -1183,32 +1183,34 @@
 eld,alerttxt)%0A%7B%0A
+  
 with (field)%0A%7B%0Ar
@@ -1206,18 +1206,24 @@
 (field)%0A
-%7B%0A
+  %7B%0A    
 re = /%5E(
@@ -1248,16 +1248,20 @@
 %7B2%7D)$/;%0A
+    
 if (valu
@@ -1259,24 +1259,25 @@
  if (value==
+=
 null%7C%7C!value
@@ -1291,13 +1291,17 @@
 re))
+ %7B
 %0A  
-%7B%7B
+    
 aler
@@ -1304,32 +1304,39 @@
 alert(alerttxt);
+%0A      
 return false%7D%0Ael
@@ -1327,32 +1327,45 @@
 return false
-%7D%0Aelse %7B
+;%0A    %7D else %7B%0A      
 return true%7D
@@ -1355,22 +1355,30 @@
      return true
-%7D%0A
+;%0A    %7D%0A  
 %7D%0A%7D%0A

fix syntax errors in validate_date