function validateThis(formItem) {
	var returnVal = true;
	formId = formItem.id;
	$("#"+formId+" .required").each(function() {
	$(this).removeClass('isValid');
	$(this).removeClass('notValid');
	var valBox = $(this).attr('name') + '_box';
	$("#" + valBox).removeClass('isValid');
	$("#" + valBox).removeClass('notValid');
	
	if ($(this)[0].tagName == 'INPUT' || $(this)[0].tagName == 'TEXTAREA') {
			var req = $(this).attr('req');
			var rVal = $(this).val();
			var len = $(this).val().length;
			if (req == 'email') {
				// email checking
				var emailOk = true;
				if (!rVal.match("@")) { emailOk = false;  }
				if (!rVal.match(/[.]/)) { emailOk = false;  }
				if (len < 6) { emailOk = false;  }
				if (emailOk == true) { $(this).addClass('isValid'); } else { $(this).addClass('notValid'); returnVal = false; }
			} else {
				if (req == 'checkbox') {
					// checkbox validation
					var checkVal = $(this).attr('checked');
					var valBox = $(this).attr('name') + '_box';
					if (checkVal == true) { $("#" + valBox).addClass('isValid'); } else { $("#" + valBox).addClass('notValid'); returnVal = false; }
				} else {
					// standard length checking
					if (len >= req) { $(this).addClass('isValid'); } else { $(this).addClass('notValid'); returnVal = false; }
				}
			}
		}
		
		if ($(this)[0].tagName == 'SELECT') {
			var thisVal = $(this).val();
			if (thisVal != '' && thisVal != 'N/A' && thisVal != 'NA' && thisVal != ' ' && thisVal != 'null' && thisVal != null) { $(this).addClass('isValid'); } else { $(this).addClass('notValid'); returnVal = false; }
		}
		
		
	});
		return returnVal;
}
