<!--
function isEmpty(s)
{ return ((s == null) || (s.length == 0)); }
function isSpace(c)
{ return ((c == "\n") || (c == " ") || (c == "\b") || (c == "\t")); }
function isWhiteSpace(s)
{ for(i=0; i<s.length; i++)
  if(!isSpace(s.charAt(i))) return false;
  return true;
}
function warning(f,s)
{ f.focus();
  f.select();
  alert(s);
  return false;
}
function isEmail(email)
{
  if(isEmpty(email)) return false;
  if(isWhiteSpace(email)) return false;
  invalidChars = " /:,;";
  for(i=0; i<invalidChars.length; i++)
  {
    badChar = invalidChars.charAt(i);
    if(email.indexOf(badChar,0) > -1) return false; 
  }
  atPos = email.indexOf("@",1);
  if(atPos == -1) return false; 
  if(email.indexOf("@",atPos+1) > -1) return false; 
  periodPos = email.indexOf(".",atPos);
  if(periodPos == -1) return false; 
  if(periodPos+3 > email.length) return false; 
 return true;
}


function validaforma(fm)
{
  thefullname = fm.fname.value;
  theemail = fm.email.value;
  thephone = fm.phone.value;
  thecity = fm.city.value;
  thequestions = fm.questions.value;
  
  if(isEmpty(thefullname))
    return (warning(fm.fname,"Please type your Full Name"));

  if(!isEmail(theemail))
    return (warning(fm.email,"The Email field is Empty or Invalid"));


  if(isEmpty(thephone))
    return (warning(fm.phone,"Please type your Phone Number"));

  if(isEmpty(thecity))
    return (warning(fm.city,"Please type your city"));
	 
  if(isEmpty(thequestions))
    return (warning(fm.questions,"Please type your Questions or Comments"));

  return enviar();
}


function nuevoAjax(){
var xmlhttp=false;
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}


function enviar()
{

var a,b,c,d,e;

a = document.getElementById('fname').value;
b = document.getElementById('email').value;
c = document.getElementById('phone').value;
d = document.getElementById('city').value;
e = document.getElementById('questions').value;


ajax=nuevoAjax();
ajax.open("GET", "../enviar.php?a="+a+"&b="+b+"&c="+c+"&d="+d+"&e="+e,true);
ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
//alert(ajax.responseText);
}
}
ajax.send(null)
}


-->
