// =================================================================================
//  question.js
//   Created 12/120/2008 by Greg Spry
//    Holds javascript specific to form submission
//
// =================================================================================
// Functions
// =================================================================================
window.addEvent('domready', function() {
	
});

// =================================================================================
function submitQuickQuestionForm(actk){
	theForm = $('quickQuestionForm');
	with(theForm){
		if(Name_REQ.value == ''){
			alert('Please enter your first and last name.');
			Name_REQ.focus();
			return false;
		}
		if(Company_REQ.value == ''){
			alert('Please enter the name of your company.');
			Company_REQ.focus();
			return false;
		}
		if(Email_REQ.value == ''){
			alert('Please enter your email address.');
			Email_REQ.focus();
			return false;
		}
		if(!isValidEmail(Email_REQ.value)){
			alert('Please enter a valid email address.\nExample: local@domain.ext');
			Email_REQ.focus();
			return false;
		}
		if(Telephone_REQ.value == ''){
			alert('Please enter your phone number.');
			Telephone_REQ.focus();
			return false;
		}
		if(Questions.value == ''){
			alert('Please enter a comment or question.');
			Questions.focus();
			return false;
		}
	}
	insitePost(actk, 'quickQuestionForm', 'Email_REQ', 'Grob - Quick Question');
	theForm.submit();
}

// =================================================================================
function isValidEmail(stringValue){
	return stringValue.match(/^(\w|-|_|\.)+@(\w|-|_|\.){3,}\.\w{2,5}$/);
}

// =================================================================================