$(document).ready(function(){
		   
						   
	$("#csButton").click(function(){



	var questform = document.getElementById('customized_form');
	symAt = $("#email").val().split("@");
	
	if($("#first_name").val().length < 1) {
		window.alert('Please Enter First Name!'); 
		return false;
	}
	if($("#last_name").val().length < 1) {
		window.alert('Please Enter Last Name!'); 
		return false;
	}
	if($("#phone").val().length < 1) {
		window.alert('Please Enter A Phone Number!'); 
		return false;
	}
	
	if (symAt.length==2){
		symDot = $("#email").val().search(".");
		if (symDot==-1){
			window.alert('Invalid Email!'); 
			return false;
		}
		
	} else {
			window.alert('Invalid Email!'); 
			return false;
	}
	if ($("#age").val() < 18) { 
		window.alert('You must be over 18 to Purchase a Stack'); 
		return false;
	} else if ($("#weight").val() == 0) {
		window.alert('Please Select a Weight Range');
		return false;
	}
	else {
		
		document.customized_form.submit();

	}
});


function checkNumRange(val, minVal, maxVal) {

	if(val<=minVal) {
		alert("Age cannot be less or equal to "+minVal);
		return false;
	}
	else if(val> maxVal) {
		alert("Age cannot be grater than "+maxVal);
		return false;
	}
	else {
	
		return true;
	}

}
					   
						   
						   
						   
});
