<!--//
function MM_validateForm() { //v4.0
  var i,p,q,nm,friendly,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { 
	friendly=args[i+1]; test=args[i+2]; val=MM_findObj(args[i]);
		if (val) { 
			nm=val.name; 
			if ((val=val.value)!="") {
				if (test.indexOf('isEmail')!=-1) { 
					p=val.indexOf('@');
					d=val.lastIndexOf('.');
					if (p<1 || p==(val.length-1) || d <= (p+1) || d==(val.length-1)) {
						document.getElementById(args[i]).style.background="#FF0000";
						errors+='- You did not specify a valid Email address.\n';
					}
				} else if (test.indexOf('D')!=-1) {
					if (isDate(val)==false) {
						document.getElementById(args[i]).style.background="#FF0000";
						errors+='- '+friendly+' must be in the format YYYY-MM-DD.\n';
					}
				} else if (test.indexOf('R')==-1) {
					if (isNaN(val)) 
						errors+='- '+friendly+' must contain a number.\n';
					if (test.indexOf('maxmin') != -1) { 
						p=test.indexOf(':');
						min=test.substring(6,p); 
						max=test.substring(p+1);
						if (val<min || max<val) {errors+='- '+friendly+' must contain a number between '+min+' and '+max+'.\n';}
					}     				
				}
			} else if (test.charAt(0) == 'R') {
				document.getElementById(args[i]).style.background="#FF0000";
				errors += '- '+friendly+' is required.\n';
			}
		}
  } 
  
  if (errors) 
	alert('ATTENTION!\n The system cannot accept your submission, please review the following errors:\n\n'+errors);
	
  if (!errors)
	thankYouMsg();
	
  document.MM_returnValue = (errors == '');
}
//-->

