function checkDemoForm(othis){
	var result
	var oError

	result = true

	oError = checkFormRequiredFields(othis, 'InputFieldBad', 'InputListBoxBad', "numSystemsWindows numSystemsUNIX numSystemsOpenVMS whichDatabase IncreasedAvailability AutomationRequirements RequirementsList ProjectBudgeted");

	if (oError) {
		//oError.focus();
		alert("Please you must enter a value for all required fields!");
		result = false;
	}
	
	checkit = 0;
	checkit2 = 0;
	if(result){
		for (i=0; i<document.forms["abat_demo"].Automation.length; i++) {
			if (document.forms["abat_demo"].Automation[i].checked) {
				checkit++;
			}
		}
		
		for (j=0; j<document.forms["abat_demo"].KApplications.length; j++){
	        if (document.forms["abat_demo"].KApplications[j].checked){
	        checkit2++;
	        }
	    }
	}
	if(checkit <= 0 && result){
		alert("Please answer the first question regarding automation requirements.");
		result = false;
	}
	
	if(checkit2 <= 0 && result){
	 alert("Please answer the fourth question regarding key application.");
	 result = false;
	}

	
	checkit = 0;
	if(result){
		for (i=0; i<document.forms["abat_demo"].ParticipateWhen.length; i++) {
			if (document.forms["abat_demo"].ParticipateWhen[i].checked) {
				checkit++;
			}
		}
		if(document.forms["abat_demo"].otherParticipateWhen.value != "") checkit++;
		//alertdocument.forms["abat_demo"].otherParticipateWhen);
	}
	if(checkit <= 0 && result){
		alert("Please answer when you would like to participate in the web demo.");
		result = false;
	}
	

	if(result){
		//Now check personal information
		if (othis.lemail.value != "" && othis.lpassword.value != ""){
	 	 if(!checkEmail(othis.lemail.value)){
	  	  result = false
	  	  alert("The e-mail address: " + othis.lemail.value + ", is invalid!");
	  	  othis.lemail.className = "InputFieldBad";
	 	 }
	 	} else {
	 	 oError = checkFormRequiredFields(othis, 'InputFieldBad', 'InputListBoxBad', "email fname lname address1 title city state zip country phone company")
	 	 if (oError){
	 	  oError.focus();
	 	  alert("You must complete ALL the personal information")
	 	  result = false
	 	 }
	 	 if(result){
	 	  if(!checkEmail(othis.email.value)){
	 	   result = false
	 	   alert("The e-mail address: " + othis.email.value + ", is invalid!");
	 	   othis.email.className = "InputFieldBad";
	 	  }
	 	 }
	 	}
	}

	return result
}
function checkEmail(sValue) {
 var regexp  = /^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-\'])+\.)+([a-zA-Z0-9])+$/;

 if (!regexp.test(sValue)) {
  return false;
 }
 return true;
}
function fillcheck(thisname, thisform){
 var f_temparray = unescape(eval("f_" + thisname)).split(", ");
 for (i=0; i<document.forms[thisform][thisname].length; i++) {
  for(j=0; j<f_temparray.length; j++){
   if(document.forms[thisform][thisname][i].value == f_temparray[j]){
    document.forms[thisform][thisname][i].checked = true;
    break;
   }
  }
 }
}