$( "#property_area_range_slider" ).slider(
  {
    range: true,
    min: 0,
    max: 50000,
    values: [ $( "#property_area_from" ).val(), $( "#property_area_to" ).val() ],
    slide: function( event, ui ) {
        $( "#property_area_from" ).val( ui.values[ 0 ] );
        $( "#property_area_to" ).val( ui.values[ 1 ] );
    }
  }
);

$( '.form-row-property_location input[value="1"]' )
.bind(
  'change',
  {},
  function(){ checkPropertyLocation(this)}
)
.each( 
  function(){ checkPropertyLocation(this); } 
);
  
function checkPropertyLocation( element ){
  
  if( element.checked ){

    $( '.form-row-property_location_bp' ).show( 'slow' );     
    $( '.form-row-property_location input' ).attr( 'disabled', 'disabled' );
    $( element ).removeAttr( 'disabled' )
  }
  else{

    $( '.form-row-property_location input' ).removeAttr( 'disabled' );
    $( '.form-row-property_location_bp' ).hide( 'slow' );
  }
}  
  
$( '.ui-slider-handle:first' ).css(
  {
    'background': "url( '" + URI_STATIC + "images/search_slider_left.png' )",
    'border': 'none',
    'width': '17px',
    'height': '17px'
  }
);
$( '.ui-slider-handle:last' ).css(
  {
    'background': "url( '" + URI_STATIC + "images/search_slider_right.png' )",
    'border': 'none',
    'width': '17px',
    'height': '17px'
  }
);
  
$( '#property_area_range_slider' ).append( min_caption = $( '<div class="min_caption slider_caption">0 ' + DICT_CUSHMAN_COMMON_SQM + '</div>' ) );
$( '#property_area_range_slider' ).append( max_caption = $( '<div class="max_caption slider_caption">50000 ' + DICT_CUSHMAN_COMMON_SQM + '</div>' ) );
/*
$( "#property_area_range_slider" ).bind(
  'slide',
  {},
  function( event, ui ){
    console.log( ui.handler.position() );
  }
);
*/
