var Site = {
	init: function() {
		if($('.help').length > 0){
			/*
			$('.fname')
			$('.lname')
			$('.address')
			$('.address2')
			$('.phone')
			$('.email')
			$('.endorser')
			$('.volunteer')
			$('.otherTxt')
			*/
			
			$("#submit").click(function(){
				//first
				var fname = $('#fname').val();
				var hwfname = /\w+/.test(fname);
				if (hwfname == false) {
					$('p.error').html('Please enter your name.');
					return false;
				}
				//last
				var lname = $('#lname').val();
				var hwlname = /\w+/.test(lname);
				if (hwlname == false) {
					$('p.error').html('Please enter your last name.');
					return false;
				}
				//address
				var address = $('#address').val();
				var hwaddress = /\w+/.test(address);
				if (hwaddress == false) {
					$('p.error').html('Please enter your address.');
					return false;
				}
				//phone
				var phone = $('#phone').val();
				var hwphone = /\w+/.test(phone);
				if (hwphone == false) {
					$('p.error').html('Please enter your phone.');
					return false;
				}
				//phone
				var email = $('#email').val();
				var hwemail = /\w+/.test(email);
				if (hwemail == false) {
					$('p.error').html('Please enter your email.');
					return false;
				}
				//vol
				var volunteerArray = [];
				$('.volunteerBoxes input').each(function(){
					if($(this).attr("checked")){
						var other;
						if($(this).val() == 'other'){
							other = $(this).val() +': '+ $('#otherTxt').val();
							volunteerArray.push(other);
						} else {
							volunteerArray.push($(this).val());
						}
						
					}
				});
				var volenteerArrayJoin = volunteerArray.join(", ")
				$("#hidden").val(volenteerArrayJoin);
				return true;
			});
		}
	}
}
$(Site.init);