$(document).ready(function(){
  $("#currentInsurer").change(function() {
    $("#otherInsurerSet").css("display", this.value == "OTHER"? "" : "none");
    $("#otherInsurer")[0].validated = false;//reset validation
  }).trigger("change");

  if ($("#otherInsurer").length > 0) {
    $("#otherInsurer").addValidation(function() {
      if (!(this.valid = !(this.form["currentInsurer"].value == "OTHER" && this.value == ""))) {
        this.error = "Value not entered";
      }
    });
  }
  
  $("#publicLiability1").click(function() {
		if (this.form["associationLiability"][0].checked) {
			this.form["associationLiability"][1].checked = true;
		}
	});
  
  $("#associationLiability0").click(function() {
		this.form["publicLiability"][0].checked = true;
	});
});
