jQuery(document).ready(function() {
  //loop though hiding the three other text boxes
  if(jQuery('select#edit-cdea-project-hs-data-meth-fuel-procure').val() != 4)
  {
    jQuery('div.form-item-cdea-project-hs-data-meth-fuel-procure-other').hide();
  }

  if(jQuery('select#edit-cdea-project-hw-data-meth-fuel-procure').val() != 4)
  {
    jQuery('div.form-item-cdea-project-hw-data-meth-fuel-procure-other').hide();
  }

  if(jQuery('select#edit-cdea-project-c-data-meth-fuel-procure').val() != 4)
  {
    jQuery('div.form-item-cdea-project-c-data-meth-fuel-procure-other').hide();
  }

  jQuery('select#edit-cdea-project-hs-data-meth-fuel-procure').change(function(){
    if(jQuery(this).val() == 4)
    {
      jQuery('div.form-item-cdea-project-hs-data-meth-fuel-procure-other').show();
    }
    else
    {
      jQuery('div.form-item-cdea-project-hs-data-meth-fuel-procure-other').hide();
    }
  });

  jQuery('select#edit-cdea-project-hw-data-meth-fuel-procure').change(function(){
    if(jQuery(this).val() == 4)
    {
      jQuery('div.form-item-cdea-project-hw-data-meth-fuel-procure-other').show();
    }
    else
    {
      jQuery('div.form-item-cdea-project-hw-data-meth-fuel-procure-other').hide();
    }
  });

  jQuery('select#edit-cdea-project-c-data-meth-fuel-procure').change(function(){
    if(jQuery(this).val() == 4)
    {
      jQuery('div.form-item-cdea-project-c-data-meth-fuel-procure-other').show();
    }
    else
    {
      jQuery('div.form-item-cdea-project-c-data-meth-fuel-procure-other').hide();
    }
  });

  //Hide and show the type of equipment other textfield
  if(jQuery('select#edit-cdea-project-hs-data-type-equip').val() != 6)
  {
    jQuery('div.form-item-cdea-project-hs-data-type-equip-other').hide();
  }

  if(jQuery('select#edit-cdea-project-hw-data-type-equip').val() != 6)
  {
    jQuery('div.form-item-cdea-project-hw-data-type-equip-other').hide();
  }

  if(jQuery('select#edit-cdea-project-c-data-type-equip').val() != 6)
  {
    jQuery('div.form-item-cdea-project-c-data-type-equip-other').hide();
  }

  jQuery('select#edit-cdea-project-hs-data-type-equip').change(function(){
    if(jQuery(this).val() == 6)
    {
      jQuery('div.form-item-cdea-project-hs-data-type-equip-other').show();
    }
    else
    {
      jQuery('div.form-item-cdea-project-hs-data-type-equip-other').hide();
    }
  });

  jQuery('select#edit-cdea-project-hw-data-type-equip').change(function(){
    if(jQuery(this).val() == 6)
    {
      jQuery('div.form-item-cdea-project-hw-data-type-equip-other').show();
    }
    else
    {
      jQuery('div.form-item-cdea-project-hw-data-type-equip-other').hide();
    }
  });

  jQuery('select#edit-cdea-project-c-data-type-equip').change(function(){
    if(jQuery(this).val() == 6)
    {
      jQuery('div.form-item-cdea-project-c-data-type-equip-other').show();
    }
    else
    {
      jQuery('div.form-item-cdea-project-c-data-type-equip-other').hide();
    }
  });

  //Capital investment hiding and showing of exact amount box
  if(jQuery('select#edit-cdea-project-financial-approx-cap-inv').val() != 7)
  {
    jQuery('div.form-item-cdea-project-financial-approx-cap-inv-exact').hide();
  }

  jQuery('select#edit-cdea-project-financial-approx-cap-inv').change(function(){
    if(jQuery(this).val() == 7)
    {
      jQuery('div.form-item-cdea-project-financial-approx-cap-inv-exact').show();
    }
    else
    {
      jQuery('div.form-item-cdea-project-financial-approx-cap-inv-exact').hide();
    }
  });
});
;

