//	Feedback form scripts

WM.form.feedback = function() {

	return {

		//	check Type field on change
  	setup:	function() {
  		$("#fType").change(function() { WM.form.feedback.checkComplaints(); });
  		$("#fType").change();
  	},
  	
    //	add action field when Type is complaint and hide if not
  	checkComplaints:	function() {
      if ($("#fType").val() === "Comments and complaints") {
      	$("#complaints").append("<label for='fAction'>What would you like us to do about this?<\/label><input type='text' name='Action' id='fAction' value='' \/>");
      } else {
      	$("#complaints").empty();
      }
    }

	};

} ();

$(document).ready(function() { WM.form.feedback.setup(); });
