$.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 = 0;
  });
};

$(document).ready(function(){
		
		$("#desireddate").datePicker();
		$("#alternatedesiredate").datePicker();
		
		$('#clearForm').click(function(){
			$('#rfpform').clearForm();
			$('#spacerequirements').clearForm();
			$('#otherrequirements').clearForm();
			$('#breakfast').clearForm();
			$('#lunch').clearForm();
			$('#dinner').clearForm();
			$('#history').clearForm();
			$('#otherlocations').clearForm();
			   document.getElementById('fileFieldWrapper').innerHTML = 
                    document.getElementById('fileFieldWrapper').innerHTML;
			return false;
		});
});
