function chk_email_entry() {

	if ( (document.emailFrm.toline.value == '') || (document.emailFrm.toline.value == ' ') ) {
		alert ("'To:' Must Be Entered!");
		document.emailFrm.toline.focus();
		return false;
	}

	if ( (document.emailFrm.fromline.value == '') || (document.emailFrm.fromline.value == ' ') ) {
		alert ("'From:' Must Be Entered!");
		document.emailFrm.fromline.focus();
		return false;
	}

	if ( (document.emailFrm.toline.value.indexOf(".") == -1 ) || (document.emailFrm.toline.value.indexOf("@") == -1 ) ) {
		alert ("Invalid 'To:' Entry!");
		document.emailFrm.toline.focus();
		return false;
	}

	if ( (document.emailFrm.fromline.value.indexOf(".") == -1 ) || (document.emailFrm.fromline.value.indexOf("@") == -1 ) ) {
		alert ("Invalid 'From:' Entry!");
		document.emailFrm.fromline.focus();
		return false;
	}



// if no errors, submit form...
 document.emailFrm.submit();

}


function isValidDate(inDate, inFieldName) {
	var dateArr;
	var day;
	var month;
	var year;
	var pos = 0;
	var posCnt = 0;

	while (pos != -1) {
		pos = inDate.indexOf("/",pos);
		if (pos != -1) {
			posCnt++;
			pos++;
		}
	}

	if (posCnt != 2) {
		alert ('Date must be of the format "MM/DD/YYYY"');
		return false;
	}

	dateArr = inDate.split('/');
	month = dateArr[0];
	day = dateArr[1];
	year = dateArr[2];

	if( year.length != 4 )	{
		alert('4-Digit Year is Required for ' + inFieldName);
		return false;	
	}

	if ( isNaN(day) || isNaN(month) || isNaN(year) ) {
		alert(inFieldName +' Is An Invalid Date');
		return false;
	}

	if( month < 1 || month > 12 ) {
		alert(inFieldName +' Includes an Invalid Month');
		return false; 
	}

	if( day < 1 || day > 31 ) {
		alert(inFieldName +'  Includes an Invalid Day');
		 return false; 
	}

	if ((month==4 || month==6 || month==9 || month==11) && day > 30) {
		alert(inFieldName +' Is An Invalid Date');
		return false; 
	}

	// check for february 29th

	if (month == 2)	{ 
		var isleap = (year % 4 == 0 && (year %100 != 0 || year % 400 == 0));	
		if (day > 29 || (day==29 && !isleap)) {
			alert(inFieldName +' Is An Invalid Date');
			return false;	
		}
	}

}	


