function checkMail(s){
// var emailFilter=/^.+@.+\..{2,3,4,5,6}$/;
 var emailFilter=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(2([0-4]\d|5[0-5])|1?\d{1,2})(\.(2([0-4]\d|5[0-5])|1?\d{1,2})){3} \])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
 var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/;

 if (s.match(illegalChars)){
  window.alert("The email address contains illegal characters.\n");
  return false;
 }
 else if (!(emailFilter.test(s))) { 
  window.alert("Can\'t use "+s+".\nPlease enter a valid email address.\n");
  return false;
 }
 else
  return true;
}

function checkText(field){
 var error="";
 if (field.value==error){
  window.alert(field.name+" is blank.\n\nPlease enter a value for "+field.name+".");
  return false;
 }
 else
  return true;
}

function showWindow(hwnd,url,x,y,resize) {
 if(url == null) { 
 url = "/help/general/";
 } 
 if(x==null || y==null){
 x = 620;
 y = 300;
 } 
 if (resize==null)
  resize="yes";
 var str = "toolbar=no,location=no,directories=no,status=no,    menubar=no,scrollbars=yes,resizable="+resize+",left=0,top=0,width="+x+",height="+y; 
 win = window.open(url,hwnd,str);
  this.win.focus();
 return true;
}

function dateTime(){
 today = new Date();
 now = today.getHours()+":"+today.getMinutes()+":"+today.getSeconds();
 return today+" "+now;
}

function getDownloadURL(document,value){
 document.action="http://www.aasdt.com/cgi-bin/track/download.cgi?site="+value;
 return(false);
}
