// JavaScript Document
function zebra_stripes() {
	$$("table").each(function(table){
		Selector.findChildElements(table, ["tr"])
			.findAll(function(row,i){ return i % 2 == 1; })
			.invoke("addClassName", "odd");
	});
}


function validate_form() {
	
	// first submission where type is selected
	if ( $("residential") ) {
		if ( ! $("residential").checked && ! $("commercial").checked ) {
			alert("Please select either Residential or Commercial insurace before continuing.");
			return false;
		}
	}
	// final submission check
	if ( $("i_agree") ) {
		if ( ! $("i_agree").checked ) {
			alert("You need to agree to the terms and conditions of this form before submitting your information.");
			return false;
		}
	}
	
}

function show_state() {
	// final submission check
	if ( $("i_agree") ) {
		if ( ! $("i_agree").checked ) {
			alert("You need to agree to the terms and conditions of this form before submitting your information.");
			return false;
		}
	}
}
