// Client-side form validation

$(function(){
	$('form#form1').validate({
		rules: {
			cvv2Number: {
				required: true,
				rangelength: [3, 3]
			},
			txtPhone: {
				required: true,
				rangelength: [8, 12]	
			},
			zip: {
				required: true,
				rangelength: [4, 4]
			},
			txtPostcode: {
				required: true,
				rangelength: [4, 4]
			},
			cmbEventList: {
				required: true,
				min: 1
			},
			txtAddress: {
				required: true,
				maxlength: 100
			},
			txtSuburb: {
				required: true,
				maxlength: 30
			},
			cbxTermsConditions: {
				required: true
			}
		}
	});
});

// Replace spaces in admin table with non-breaking spaces
/*

$(function(){
	$("td:contains(' ')").each(function(){
	$(this).html($(this).html().replace(/ /g, "&nbsp;"));
	});
});*/

