var contactForm;
var emailFilter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;

function CartContactUs(theForm, theStore) {
	contactForm = theForm;
	
	if ((theForm.name.value == null) || (theForm.name.value.length == 0)) {
		alert('Please enter your name');
		theForm.name.focus();
		return false;
	}
	
	if ((theForm.email.value == null) || (theForm.email.value.length == 0)) {
		alert('Please enter your email address');
		theForm.email.focus();
		return false;
	}
	
	if (emailFilter.test(theForm.email.value) == false){
		alert('Your email address is invalid, please re-enter');
		theForm.email.focus();
		return false;
	}
	
	if (theForm.subject.selectedIndex <= 0) {
		alert('Please select a subject');
		theForm.subject.focus();
		return false;
	}
	
	if ((theForm.comments.value == null) || (theForm.comments.value.length == 0)) {
		alert('Please enter your question or comment');
		theForm.comments.focus();
		return false;
	}
	
	// error checking done
	
	var parms = new Array();
	parms[parms.length] = theForm.codiv.value;
	parms[parms.length] = theForm.name.value;
	parms[parms.length] = theForm.email.value;
	parms[parms.length] = theForm.order.value;
	parms[parms.length] = theForm.subject.options[theForm.subject.selectedIndex].value;
	parms[parms.length] = theForm.comments.value;
	
	jsrsExecute("/common/comm/cartContactUs/server.asp", ContactUsCallBack, "CartContactUs", parms, false);
	
	return false;
}
/*
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SEE INCLUDES/FUNCTIONS.ASP under the individual store for this function.  I moved it for the cart only stores
so we can redirect to the contact_thankyou.asp for the individual store rather then theConsumerLink's 
contact_thankyou.asp
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function ContactUsCallBack(str) {
	if (str.substr(0, 5) != 'ERROR') {
		contactForm.reset();
		location.href = "/contact_thankyou.asp";
	} else {
		alert(str);
	}
}
*/
