/**
 * Changes the search page for either 'Sale' or 'Lease' transaction type
 * - 'Lease' disables the property types and switches the price list to rental prices
 * - 'Sale' enables the property types and switches the price list to sale prices
 * Added - selecting lease disables and uncheck foreclosure and shortsale fields - Axel
 */
function switchTransactionType(idxClass)
{
  var transactionType = jQuery("input[name='transactionType']:checked").val();
  
  if(transactionType == 'Lease') {
    if(idxClass == 'residential') {
	jQuery("input[name='propertyType[]']").attr('disabled', 'disabled');
    jQuery("input[name='Foreclosure']").removeAttr('checked');
	jQuery("input[name='Foreclosure']").attr('disabled', 'disabled');
	jQuery("input[name='ShortSale']").removeAttr('checked');
	jQuery("input[name='ShortSale']").attr('disabled', 'disabled');
	
	}
    jQuery('#maximumPrice').attr('disabled', 'disabled').hide();
    jQuery('#minimumPrice').attr('disabled', 'disabled').hide();
    jQuery('#maximumRentalPrice').removeAttr('disabled').show();
    jQuery('#minimumRentalPrice').removeAttr('disabled').show();
  }
  else {
    if(idxClass == 'residential') {
      jQuery("input[name='propertyType[]']").removeAttr('disabled');
	  jQuery("input[name='Foreclosure']").removeAttr('disabled');
	  jQuery("input[name='ShortSale']").removeAttr('disabled');
	  }
    jQuery('#maximumPrice').removeAttr('disabled').show();
    jQuery('#minimumPrice').removeAttr('disabled').show();
    jQuery('#maximumRentalPrice').attr('disabled', 'disabled').hide();
    jQuery('#minimumRentalPrice').attr('disabled', 'disabled').hide();
  }
}
