function validateForm() {
	var errors = new Array();
	var complaintArea = $.trim($("#complaintArea").val());
	var vendorActions = $.trim($("#vendorActions").val()); 
	var recAndRemarks = $.trim($("#recAndRemarksArea").val());
	var isDmp = $.trim($("#isDmpIssueDropDown").val());
	var dmpType = $.trim($($("#dmpQirTypeDropDown")).val());
	
	if(!isVendor && complaintArea == '') {
		errors.push({ field : 'name', message : 'Cause of Complaint is required.' })
	}
	
	if(isVendor && vendorActions =='') {
		errors.push({ field : 'name', message : 'Vendor Actions is required' })	
	}

	if(!isVendor && recAndRemarks == '') {
		errors.push({ field : 'name', message : 'Recommendations and Remarks are required.' })
	}
	
	if(canEditIsDmpIssue && (isDmp == '' || isDmp == 'S')) { //DMP Issue (and issue type) are only mandatory when moving from New to Approved status for National Administrator. 
		errors.push({ field : 'name', message : "DMP Issue is required." })
	}
	
	if(isDmp == 'Y') {
		if(!isVendor && dmpType == '-1') {
			errors.push({ field : 'name', message : "DMP Issue Type is required." })
		}
	}
	
	
	if (errors.length > 0) {
		showErrors(errors)
		forceFocusOnErrorMessage()
		return false
	}
	forceFocusOnErrorMessage()
	return true	
}

	function forceFocusOnErrorMessage() {		
		if($('#errorsWrapper').is(':visible')){	
			$('#errorsWrapper span:first').focus()	
		}

	}