/*
	Pacific Concord Properties, Inc.
	Lancaster Hotels Web Portal Stylesheet
	v1.0.000.000

REVISION HISTORY
	v1.0.000.000 :: October 25, 2007
		1. Initial published version of JS
*/



function validateFeedback( ) {
	var sErr = '', vFocus

	with( document.forms['frmFeedback'] ) {
		// Message required
		if( txtMessage.value=='' ) {
			sErr= 'Please type in your Inquiry/Feedback Message.\n' + sErr;
			vFocus = 3;
		}
		// A valid e-Mail Address is required
		if( txtEMail.value=='' ) {
			sErr = 'Please tell us your e-Mail Address.\n' + sErr;
			vFocus = 2;
		} else if( IsEmailAddress(txtEMail.value)==false ) {
			sErr = 'A valid e-Mail Address is required.\n' + sErr;
			vFocus = 2;
		}
		// Visitor Name is required
		if( txtName.value=='' ) {
			sErr= 'Please tell us your Full Name.\n' + sErr;
			vFocus = 1;
		}

		if( sErr!='' ) {
			sErr = 'Missing Feedback Information:\n\n' + sErr;
			alert( sErr );
			if( vFocus==1 )
				txtName.focus( );
			if( vFocus==2 )
				txtEMail.focus( );
			if( vFocus==3 )
				txtMessage.focus( );
		} else {
			submit( );
		}
	}
}

