$(document).ready(
	function() {
		$(".btnReset").click(
			function() 
			{
				$("form#bladeSpinRFQ").clearForm();
				return false;
			}
		);
		$(".btnSubmit").click(
			function() 
			{
				document.forms["bladeSpinRFQ"].submit();
                                return false;
			}
		)
		$("div.tableCollapser").click(
			function() 
			{
				var table = $(this).next("table");
				table.toggle();
				if (table.css("display") == "none")
				{
					$(this).css("background-position", "6px -19px");
				}
				else
				{
					$(this).css("background-position", "8px 0");
				}
			}
		)
		$("input.btnReset").click(
			function () 
			{
				$("form#bladeSpinRFQ").clearForm();
				return false;
			}
		);
	}
)

$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};