// JavaScript Document
$(document).ready(function(){
    $('input').keypress(function (event){ return event.keyCode == 13 ? false : true; });
});

function clearContactForm(){
	clearFormElements($('#contactForm'));	
}

function clearFormElements(formElement){	
	inputElements = $(formElement).find('input,textarea');
	clearElements = $(inputElements).filter(function(){
											 return this.type != 'button' && this.type != 'submit';
											 });
	$(clearElements).val('');
}

function validateForm(){
	msgs = '';
	
	name = $.trim($('#name').val());
	loc = $.trim($('#loc').val());
	email = $.trim($('#email').val());
	comments = $.trim($('#comments').val());
		
	if(name == ''){
		msgs += "\n-Name";	
	}
	if(loc == ''){
		msgs += "\n-City, State Zip";
	}
	if(email == ''){
		msgs += "\n-E-Mail";
	}
	if(comments == ''){
		msgs += "\n-Questions or Comments";
	}
	if(msgs == ''){
		return true;	
	}
	msgs = "The following are required to proceed:" + msgs;
	alert(msgs);
	return false;
}
