function validateEmail(eObj)
{
    var email = eObj.value;
    if(email.length <= 0)
	{
	  return true;
	}
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) {
         alert("Email is not a valid format.");
         eObj.focus();
         return false;
         }
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) {
         alert("Email is not a valid format.");
         eObj.focus();
         return false;
         }
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) {
         alert("Email is not a valid format.");
         eObj.focus();
         return false;
         }
      }// if
      return true;
     }
alert("Email is not a valid format.");
return false;
}

function validatePhone (pObj)   
{
  var tfld = pObj.value;  
  if(tfld.length <= 0)
	{
	  return true;
	}
	
  var telnr = /^\+?[0-9 ()-]+[0-9]$/  ;
  if (!telnr.test(tfld)) {
    alert ("Not a valid telephone number. Characters permitted are digits, space ()- and leading +");
    pObj.focus();
    return false;
  }

  var numdigits = 0;
  for (var j=0; j<tfld.length; j++)
    if (tfld.charAt(j)>='0' && tfld.charAt(j)<='9') numdigits++;

  if (numdigits<10) {
    alert ("Not a valid telephone number. Area code is required.");
    pObj.focus();
    return false;
  }

  return true;
}

function checkForm ()
{
    if(eval(document.frmContact.Name.value.length) == 0) 
        { 
            alert("Please enter a Name.");
            document.frmContact.Name.focus(); 
            return false; 
        }
    if(eval(document.frmContact.Email.value.length) == 0) 
        { 
            alert("Please enter an Email.");
            document.frmContact.Email.focus(); 
            return false; 
        }
    return true;
}

function checkComment ()
{
    if(eval(document.frmComment.txtName.value.length) == 0) 
        { 
            alert("Please enter a Name.");
            document.frmComment.txtName.focus(); 
            return false; 
        }
    if(eval(document.frmComment.txtEmail.value.length) == 0) 
        { 
            alert("Please enter an Email.");
            document.frmComment.txtEmail.focus(); 
            return false; 
        }
    if(eval(document.frmComment.txtComment.value.length) == 0) 
        { 
            alert("Please enter a Comment.");
            document.frmComment.txtComment.focus(); 
            return false; 
        }
    return true;
}

  
function validateDate (dObj)
{
  var dfld = dObj.value;  
    var dateformat = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/;
    if (!dateformat.test(dfld) & dfld.length > 0) 
    {
        alert ("Not a valid date.");
        dObj.focus();
        return false;
    }
}