function validate_calform(frm) {
	with (frm) {			
		if (cal_sdate.value.length == 0 && cal_edate.value.length == 0 && cal_keyword.value.length == 0 && cal_catID.selectedIndex == 0) {
			alert('Please enter a date range, keyword, or choose a Category!');
			cal_sdate.focus();
			return false;		
		}

		if (cal_sdate.value.length > 0 && !fmtDate(cal_sdate, '-')) {
			alert('Please enter a valid From Date!');
			cal_sdate.focus();
			return false;
		}
		
		if (cal_edate.value.length > 0 && !fmtDate(cal_edate, '-')) {
			alert('Please enter a valid To Date!');
			cal_edate.focus();
			return false;
		}			
	
		if (new Date(cal_edate.value) < new Date(cal_sdate.value)) {
			alert('The end date should be after the start date!');
			cal_edate.focus();
			return false;
		}
	}
		
	return true;
}
