function internalLink(additionalParams){try{afsInsertionQueue.clear();var currentParams=queryParams;if(Settings.MAP_VIEW){currentParams=currentParams.merge($H({hits:Settings.MAX_HITS.MAP}));};var params=currentParams.merge(additionalParams);new Ajax.Request('/search/results',{method:'get',parameters:params,onlyLatestOfClass:'internal_link'});showFilteringResults();}catch(e){sendJSError('results.js: internalLink()',e);}}
function internalLinkOnlyMyGlobrix(additionalParams){try{if(MyGlobrix.loggedIn){internalLink(additionalParams);}else{MyGlobrix.window.load('welcome',true);}}catch(e){sendJSError('results.js: internalLink()',e);}}
function sendExcludeSold(){try{var form=$('exclude_sold_form');var params=form.serialize();if(Settings.MAP_VIEW){params+='&hits='+Settings.MAX_HITS.MAP};new Ajax.Request('/search/results',{method:'get',parameters:params});showFilteringResults();}catch(e){sendJSError('results.js: sendExcludeSold()',e);}}
function showFilteringResults(){try{if($('content'))
{Element.setOpacity('content',0.5);}
if($('results_filter'))
{$('results_filter').show();}}catch(e){sendJSError('results.js: showFilteringResults()',e);}}
function hideFilteringResults(){try{if($('content'))
{Element.setOpacity('content',1);}
if($('results_filter'))
{$('results_filter').hide();}}catch(e){sendJSError('results.js: hideFilteringResults()',e);}}
function getFeaturedProperties(transactionType,priceMin,priceMax){params="&qt="+queryKeywordId;params+="&transaction_type="+transactionType;params+="&min_price="+priceMin;params+="&max_price="+priceMax;params+="&origin=getFeaturedProperties";var options={asynchronous:true,parameters:params,method:'post'}
new Ajax.Request('/image/featured_properties',options);}
function restoreFeaturedPropertiesPanel(){if($('featured_properties').hasClassName('closed')){$('featured_properties').removeClassName('closed');$('featured_properties').addClassName('open');}
$('featured_properties').appear({duration:1.0});}
function openLinkToThisSearch(){window.prompt('Paste the full link below in your email or chat:',searchRepresentation);}
function copyLinkToThisSearch(){$('copy_link').show();$('copy_link_generating').show();$('copy_link_link').hide();new Ajax.Request('/search/copy_link',{asynchronous:true,evalScripts:true,parameters:{url:searchRepresentation},onFailure:function(){$('copy_link').hide();if(confirm("There was an error, sorry. We couldn't go through with it...")){copyLinkToThisSearch();};}});}
function emailSearch(){new Ajax.UniqueLiveRequest('/results/email_link');}
Results={hits:new Array(),total:new String(),is_mappable:false,show_save:false,append:function(json){try{if(typeof json=="undefined"){sendJSError('results.js: Results.append, no json response',null,json);}else{_results=json;_hits_to_append=_results.hits;_src=new String();_hits_to_append.each(function(hit_data){_src+=hit_data.hit_html;hit_data.hit_html='';Results.hits.push(hit_data);});Element.insert('results_container',{bottom:_src});_src='';this.show_save=_results.save_from_here;this.is_mappable=_results.is_mappable;if(Results.total==Results.hits.length){$('load_next_ten_results').hide();};setMapResultsButton(this.is_mappable);};}catch(e){sendJSError('results.js: Results.append',e);}},update:function(json){try{iSetsReqested=0;os=0;this.load(json);if(Settings.MAP_VIEW){mapResults('map');}else{listResults();};setMapResultsButton(this.is_mappable);}catch(e){sendJSError('results.js: Results.update',e);}},load:function(json){try{if(typeof json!="undefined"){_results=json;this.hits=_results.hits;this.total=_results.total;this.show_save=_results.save_from_here;this.is_mappable=_results.is_mappable;}else{this.hits=[];this.total=0;this.is_mappable=false;}}catch(e){sendJSError('results.js: Results.load',e);}}}
function loadAndListResults(){try{afsInsertionQueue.clear();Settings.MAP_VIEW=false;Cookies.set('show_map','false',365);var params=queryParams.update({sm:'',cst:'',hits:Settings.MAX_HITS.LIST}).toQueryString();new Ajax.Request('/search/results',{method:'get',parameters:params,onlyLatestOfClass:'reload_list_or_map'});showFilteringResults();}catch(e){sendJSError('results.js: loadAndListResults()',e);}}
function listResults(){try{Settings.MAP_VIEW=false;Cookies.set('show_map','false',365);var _src=new String();var errorLoadingMapDataInList=false;if(Results.hits.length>0){Results.hits=Results.hits.slice(0,Settings.MAX_HITS.LIST);Results.hits.each(function(hit_data){if(typeof hit_data.hit_html!='string')
{errorLoadingMapDataInList=true;throw $break;}
_src+=hit_data.hit_html;hit_data.hit_html='';});}
if(errorLoadingMapDataInList)
{loadAndListResults();}
else
{$('results_container').update(_src);scrollResults();nextResultsButton();_src='';hideMap();$('results_list','sort_links').invoke('show');}
reloadAFSFrame();}catch(e){sendJSError('results.js: listResults()',e);}}
function nextResultsButton()
{try
{if($('results_container').getHeight()>0&&$('content').getHeight()>0)
{if(typeof Results.hits!="undefined"&&Results.hits!=null){if(Results.total>Results.hits.length&&$('results_container').getHeight()<$('content').getHeight()){if($('load_next_ten_results')){$('load_next_ten_results').show();}}else{if($('load_next_ten_results')){$('load_next_ten_results').hide();}};}}}catch(e){sendJSError('results.js: nextResultsButton()',e);}}
function setMapResultsButton(isMappable){try{if(isMappable&&mapResultsHandlers.bindedUnMappableFunction!=null){Event.stopObserving('display_map','click',mapResultsHandlers.bindedUnMappableFunction);mapResultsHandlers.bindedMappableFunction=mapResultsHandlers.mappable.bindAsEventListener(mapResultsHandlers);Event.observe('display_map','click',mapResultsHandlers.bindedMappableFunction);}else if(!isMappable){Event.stopObserving('display_map','click',mapResultsHandlers.bindedMappableFunction);mapResultsHandlers.bindedUnMappableFunction=mapResultsHandlers.unmappable.bindAsEventListener(mapResultsHandlers);Event.observe('display_map','click',mapResultsHandlers.bindedUnMappableFunction);}}catch(e){sendJSError('results.js: setMapResultsButton()',e);}}
function makeSearchNearHereHref(hit_data){var linkHref='#'
if((typeof hit_data.street!='undefined'&&typeof hit_data.short_postcode!='undefined')&&(hit_data.street!=null&&hit_data.short_postcode!=null)&&(hit_data.street!=''&&hit_data.short_postcode!='')&&(Settings.BUY_RENT!='flatshare')){linkHref="/property/"+Settings.BUY_RENT+"/"+spacifize(hit_data.short_postcode.toLowerCase())+"/"+spacifize(hit_data.street.toLowerCase());}
return linkHref;}
function makeSearchNearHereLink(hit_data){var link="internalLink($H({type:'searchnearlink',at:'false',gsl:'"+hit_data.loc+"',gst:'filter',gscx:'"+hit_data.lng+"',gscy:'"+hit_data.lat+"',gsr:'0.2'})); return false;";return link;}
function makeSearchNearHereTitle(hit_data){return"Search near to "+hit_data.loc;}
function buyOrRentSeoLabel(){return Settings.BUY_RENT=='buy'?'for sale':'to rent';}
function toggleAlternativeSearches(){try{Element.toggle('alternative_searches');if($('alternative_searches_toggle').hasClassName('closed')){$('alternative_searches_toggle').removeClassName('closed');$('alternative_searches_toggle').addClassName('open');pageTracker._trackEvent('Interface','Fine tune');}else{$('alternative_searches_toggle').removeClassName('open');$('alternative_searches_toggle').addClassName('closed');}}catch(e){sendJSError('results.js: toggleAlternativeSearches()',e);}}
function toggleFeaturedProperties(){try{Element.toggle('featured_properties_contents');if($('featured_properties').hasClassName('closed')){$('featured_properties').removeClassName('closed');$('featured_properties').addClassName('open');pageTracker._trackEvent('Interface','Featured prop');}else{$('featured_properties').removeClassName('open');$('featured_properties').addClassName('closed');}}catch(e){sendJSError('results.js: toggleFeaturedProperties()',e);}}
function getNextResults(){Cookies.set('show_map','false',365);try{if(!requestedNext&&Results.total>Results.hits.length){requestedNext=true;if(typeof $('results_notifier_error_message')!="undefined")
{$('results_notifier_error_message').hide();}
if(typeof $('results_notifier_loading_message')!="undefined")
{$('results_notifier_loading_message').show();}
if(typeof $('results_notifier')!="undefined")
{new Effect.Appear('results_notifier',{duration:0.2});}
var paramsHash=new Hash();paramsHash.update(queryParams);var params=paramsHash.update({os:os+Settings.MAX_HITS.LIST,secret:pagelink_secret,afs_id:afsConfigId,type:"pagelink",scroll:"true"}).toQueryString();var addResults=function(t){requestedNext=false;if(typeof $('results_notifier')!="undefined")
{new Effect.Fade('results_notifier',{duration:0.5});}};var addResultsError=function(t){requestedNext=false;if(typeof $('results_notifier_error_message')!="undefined")
{$('results_notifier_error_message').show();}
if(typeof $('results_notifier_loading_message')!="undefined")
{$('results_notifier_loading_message').hide();}
if(typeof $('results_notifier')!="undefined")
{new Effect.Fade('results_notifier',{duration:0.5,from:1,to:0});}};new Ajax.Request('/search/results',{method:'get',parameters:params,onSuccess:addResults,onFailure:addResultsError,onlyLatestOfClass:'scroll_search'});iSetsReqested++;}}catch(e){sendJSError('results.js: getNextResults()',e);}}
var ModifierOptions={show:function(modifier,modifierOptions){t=modifier.offsetTop+modifier.getHeight()+(Prototype.Browser.IE?3:-1);l=modifier.offsetLeft+12;modifierOptions.setStyle({top:t+'px',left:l+'px',display:'block'});}};function newGeoSearchRadiusQuery(){var form=$('geo_search_radius_form');var radius=form.set_geo_radius.options[form.set_geo_radius.selectedIndex].value;form.gsr.value=radius;form.submit();}
function newExpansionSearchRadiusQuery(formId){var form=$('geo_search_radius_form_'+formId);var radius=form.set_geo_radius.options[form.set_geo_radius.selectedIndex].value;form.gsr.value=radius;form.submit();}
function mapSingleResult(hit_id){try{var hit=Results.hits[hit_id-1];if(GBrowserIsCompatible()&&parseInt(hit.lat)!=200&&parseInt(hit.lng)!=200&&hit.lat!=null&&hit.lng!=null){var map=new GMap2($('hit_'+hit_id+'_map'));var hit_lat_lng=new GLatLng(hit.lat,hit.lng);map.setCenter(hit_lat_lng,13);map.addControl(new GSmallZoomControl(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(12,12)));var icon=new GIcon();icon.image=setmappointer()+".png";icon.iconSize=new GSize(16,16);icon.iconAnchor=new GPoint(8,8);var marker=new GMarker(hit_lat_lng,icon);GEvent.addListener(marker,"click",function(){window.open(hit.link,'new')});map.addOverlay(marker);};return false;}catch(e){sendJSError('results.js: mapSingleResult()',e);}}
function scrollResults(id){if($('hit_'+id)){$('results_list').scrollTop=$('hit_'+id).offsetTop-resultListOffset;}else{$('results_list').scrollTop=0;}}
if(navigator.platform.include('mac')){aLoadScripts.push(function(){try{$('breadcrumb').addClassName('mac');}catch(e){sendJSError('aLoadScripts: trying to addClassName to breadcrumb',e);}})}
aLoadScripts.push(function(){if($('results_list')){if($('messages')){resultListOffset=$('messages').offsetHeight+28;}
$('results_list').observe('scroll',function(){try{if(typeof Settings!="undefined"){if($('results_list').scrollHeight-$('results_list').scrollTop<$('results_list').offsetHeight+200&&Settings.MAP_VIEW==false&&enableScrolling){getNextResults();}}}catch(e){sendJSError('results.js: checkScrollBottom()',e);}});}});aLoadScripts.push(function(){nextResultsButton()});String.prototype.toShortHand=function(showPriceSuffix){if(!isNaN(parseFloat(this))&&(parseFloat(this)>-1)){var i=this.endsWith('k')?parseFloat(this)*1000:this.endsWith('m')?parseFloat(this)*1000000:parseFloat(this);var value_suffix=i==slider_data.buckets.last().value&&showPriceSuffix?'+':'';return(i<1000000?i<1000?this:(i/1000).roundToXDecimalPlaces($F('br')=='buy'?0:1)+'k':(i/1000000).roundToXDecimalPlaces(2)+'m')+value_suffix;}else{return PriceSlider.tempFormValue;}}
String.prototype.extrapolateFromShortHand=function(){s=this.gsub(',','');if(s.indexOf('k')!=-1){return parseFloat(s)*1000;}else if(s.indexOf('m')!=-1){s=s.gsub('m','');if(s.indexOf('.99')!=-1){while(s.length<8){s+='9';}}
ret_val=parseFloat(s)*1000000;ret_val=ret_val.roundToXDecimalPlaces(0);return ret_val;};var value=parseFloat(s);return isNaN(value)?0:value;}
Number.prototype.roundToXDecimalPlaces=function(XPlaces){var i=this;if(i>8191&&i<10485){i-=5000;i=Math.floor(i*Math.pow(10,XPlaces))/Math.pow(10,XPlaces);i+=5000;}else{i=Math.floor(i*Math.pow(10,XPlaces))/Math.pow(10,XPlaces);};return i;}
function runPriceSlider(){try{priceSliderSetup();}catch(ea){try{setTimeout(priceSliderSetup,5);}catch(eb){try{setUpPriceBoxesWithoutSlider();}catch(ec){sendJSError('price_slider.js: runPriceSlider()',ec);}}}}
function priceSliderSetup(){if(slider_data.buckets.length>0){PriceSlider.setup();}}
function toggleSlider(noResults,sliderElement){if(noResults){$(sliderElement).hide();$('no_slider').show();}else{$('no_slider').hide();$(sliderElement).show();}}
var PriceSlider={FORM_SUBMITABLE:true,HANDLE_WIDTH:5,WIDTH:0,FINAL_BUCKET_WIDTH:20,MARGIN:4,LAYOUT_MODE:'normal',tempFormValue:'',isSetUp:false,setup:function(fade){PriceSlider.HEIGHT=24-PriceSlider.MARGIN;PriceSlider.layout();$('min').style.left='-'+(PriceSlider.WIDTH-PriceSlider.HANDLE_WIDTH)+'px';$('max').style.left=(PriceSlider.WIDTH-PriceSlider.HANDLE_WIDTH)+'px';$('slider_replacement').hide();fade?Effect.Appear('slider'):$('slider').show();aResizeScripts.push(PriceSlider.layout);aResizeScripts.push(PriceSlider.refresh);Event.observe('slider','mouseover',function(){Effect.Queues.get('slider').each(function(effect){effect.cancel()});$('handle_label_min','handle_label_max').invoke('setOpacity',1).invoke('show');});Event.observe('slider','mouseout',function(){new Effect.Fade('handle_label_min',{queue:{scope:'slider'}});new Effect.Fade('handle_label_max',{queue:{scope:'slider'}});});Event.observe('slider','mousedown',function(e){var o=$('slider');var sliderXPos=0;if(o.offsetParent){sliderXPos=o.offsetLeft;while(o=o.offsetParent){sliderXPos+=o.offsetLeft};};var sliderClickX=(Event.pointerX(e)-sliderXPos);if(sliderClickX>maxDragController.currentDelta()[0]){$('max').setStyle({left:sliderClickX+'px'});PriceSlider.updateMaxValue();}else{$('min').setStyle({left:sliderClickX-PriceSlider.WIDTH+'px'});if(minDragController.currentDelta()[0]+PriceSlider.WIDTH>maxDragController.currentDelta()[0]){$('max').setStyle({left:minDragController.currentDelta()[0]+PriceSlider.WIDTH+'px'});PriceSlider.updateMinValue();PriceSlider.updateMaxValue();}else{PriceSlider.updateMinValue();};};PriceSlider.applyFilter();});minDragController=new Draggable('min',{handle:'min_handle',starteffect:function(){},endeffect:PriceSlider.applyFilter,snap:function(x,y){PriceSlider.updateMinValue();if(x<0-PriceSlider.WIDTH+PriceSlider.HANDLE_WIDTH){return[0-PriceSlider.WIDTH+PriceSlider.HANDLE_WIDTH,0];}else if(x>0-PriceSlider.HANDLE_WIDTH){$('max').setStyle({left:PriceSlider.WIDTH-PriceSlider.HANDLE_WIDTH+'px'});PriceSlider.updateMaxValue();return[0-PriceSlider.HANDLE_WIDTH,0];}else{if(x+PriceSlider.WIDTH>maxDragController.currentDelta()[0]){$('max').setStyle({left:x+PriceSlider.WIDTH+'px'});PriceSlider.updateMaxValue();};return[x,0];}}});maxDragController=new Draggable('max',{handle:'max_handle',starteffect:function(){},endeffect:PriceSlider.applyFilter,snap:function(x,y){PriceSlider.updateMaxValue();if(x>PriceSlider.WIDTH-PriceSlider.HANDLE_WIDTH){return[PriceSlider.WIDTH-PriceSlider.HANDLE_WIDTH,0];}else if(x<PriceSlider.HANDLE_WIDTH){$('min').setStyle({left:0-PriceSlider.WIDTH+PriceSlider.HANDLE_WIDTH+'px'});PriceSlider.updateMinValue();return[PriceSlider.HANDLE_WIDTH,0];}else{if(x<(minDragController.currentDelta()[0]+PriceSlider.WIDTH)){$('min').setStyle({left:x-PriceSlider.WIDTH+'px'});PriceSlider.updateMinValue();};return[x,0];}}});PriceSlider.isSetUp=true;PriceSlider.refresh();},layout:function(){PriceSlider.WIDTH=PriceSlider.calculateCurrentWidth();PriceSlider.PRICE_SUFFIX=$F('br')=='buy'?'':slider_data.rent_suffix;bucket_width=Math.floor(((PriceSlider.WIDTH-PriceSlider.FINAL_BUCKET_WIDTH-(slider_data.buckets.length-1))/(slider_data.buckets.length-1)))-1;$('slider').style.width=PriceSlider.WIDTH+'px';$('slider_buckets').style.width=PriceSlider.WIDTH+'px';$('slider_controls').style.width=PriceSlider.WIDTH+'px';$$('div.bucket').each(function(bucket,index){bucket.setStyle({height:PriceSlider.HEIGHT+'px',width:bucket_width+'px'});bucket.down('div.graph').setStyle({width:bucket_width+'px'});if(index==slider_data.buckets.length-1){bucket.down('p').update(Settings.CURRENCY_NAME+slider_data.buckets[index].value.toShortHand()+PriceSlider.PRICE_SUFFIX+'+');}else{bucket.down('p').update(Settings.CURRENCY_NAME+slider_data.buckets[index].value.toShortHand()+PriceSlider.PRICE_SUFFIX);}});$('slider').down('div.bucket.final').style.width=PriceSlider.FINAL_BUCKET_WIDTH+'px';$('slider').down('div.bucket.final>div.graph').style.width=PriceSlider.FINAL_BUCKET_WIDTH-1+'px';},refresh:function(){PriceSlider.renderGraph();PriceSlider.resetPrice();PriceSlider.setAveragePrice();$$('#price_form input[type=text]').each(function(input){Event.observe(input,'focus',function(){PriceSlider.tempFormValue=$F(input);});Event.observe(input,'blur',function(){input.value=$F(input).toShortHand();if($F('br')=='buy'){var i=input.value.extrapolateFromShortHand();if(i<1000){input.value=(i*1000).toString().toShortHand()};};if($F("range_min").extrapolateFromShortHand()>$F("range_max").extrapolateFromShortHand()){$("range_max").value=$F('range_min');};PriceSlider.checkSliderPosition();});Event.observe(input,'keypress',function(e){if(e.keyCode==Event.KEY_RETURN){input.blur();PriceSlider.applyFilter();}});})},checkSliderPosition:function(){var minX=PriceSlider.getXPostitionFromValue($F("range_min").extrapolateFromShortHand());var maxX=PriceSlider.getXPostitionFromValue($F("range_max").extrapolateFromShortHand())||PriceSlider.WIDTH-PriceSlider.HANDLE_WIDTH;$('min').setStyle({left:Math.max(minX-PriceSlider.WIDTH,0-PriceSlider.WIDTH+PriceSlider.HANDLE_WIDTH)+'px'});$("handle_label_min").update($F("range_min"));$('max').setStyle({left:maxX+'px'});$("handle_label_max").update($F("range_max"));},resetPrice:function(){if(typeof slider_data!='undefined'){$('range_min').value=slider_data.user_selection.min.empty()?slider_data.buckets.first().value.toShortHand():slider_data.user_selection.min.toShortHand();$('range_max').value=slider_data.user_selection.max.empty()?slider_data.buckets.last().value.toShortHand()+'+':slider_data.user_selection.max.toShortHand();PriceSlider.setFormValues();PriceSlider.checkSliderPosition();}},renderGraph:function(){top_props=slider_data.buckets.max(function(bucket){return bucket.props});$$('#slider_buckets div.graph').each(function(graph,index){graph.setStyle({height:Math.ceil(PriceSlider.HEIGHT*(slider_data.buckets[index].props/top_props))+"px"});})},clearGraph:function(){$$('#slider_buckets div.graph').each(function(graph,index){graph.setStyle({height:"0px"});})},setAveragePrice:function(){var average_price_indicator_image_width=12;$('average_price').setStyle({left:PriceSlider.getXPostitionFromValue(slider_data.average_price)-(average_price_indicator_image_width/2)+'px'});$('average_price').title="Average price: "+Settings.CURRENCY_CHAR+slider_data.average_price.toString().toShortHand();},getValueFromXPostition:function(XPostition,showPriceSuffix){var this_bucket_index=Math.floor(XPostition/(bucket_width+1));if(this_bucket_index<slider_data.buckets.length-1){var this_bucket_increment=(slider_data.buckets[this_bucket_index+1].value-slider_data.buckets[this_bucket_index].value)/(bucket_width+1);var this_bucket_slider_offset=(XPostition-(this_bucket_index*(bucket_width+1)));var round_to=this_bucket_increment>999?this_bucket_increment<9999?1000:100000:1;var slider_value=Math.round(Math.floor(parseInt(slider_data.buckets[this_bucket_index].value)+(this_bucket_slider_offset*this_bucket_increment))/round_to)*round_to;}else{var slider_value=slider_data.buckets[this_bucket_index].value;};return slider_value.toString().toShortHand(showPriceSuffix);},getXPostitionFromValue:function(value){var this_bucket_index=slider_data.buckets.indexOf(slider_data.buckets.find(function(bucket,index){if(index==slider_data.buckets.length-1){return true;}else{return value>=bucket.value&&value<slider_data.buckets[index+1].value;}}));if(this_bucket_index<slider_data.buckets.length-1){var this_bucket_increment=(slider_data.buckets[this_bucket_index+1].value-slider_data.buckets[this_bucket_index].value)/(bucket_width+1);var this_value_offset=(value-slider_data.buckets[this_bucket_index].value)/this_bucket_increment;var this_value_XPostition=Math.floor((this_bucket_index*(bucket_width+1))+this_value_offset);}else{var this_value_XPostition=Math.floor((this_bucket_index*(bucket_width+1))+PriceSlider.FINAL_BUCKET_WIDTH);};return this_value_XPostition;},updateMinValue:function(){var value=PriceSlider.getValueFromXPostition(minDragController.currentDelta()[0]+PriceSlider.WIDTH);$("handle_label_min").update(value+PriceSlider.PRICE_SUFFIX);if($("range_min")){$("range_min").value=value};},updateMaxValue:function(){var value=PriceSlider.getValueFromXPostition(maxDragController.currentDelta()[0],true);$("handle_label_max").update(value+PriceSlider.PRICE_SUFFIX);if($("range_max")){$("range_max").value=value};},setFormValues:function(){var form=$('price_form');var iMin=$F('range_min').extrapolateFromShortHand();var iMax=$F('range_max').extrapolateFromShortHand();form.tmv.value="["+iMin+";"+(iMax==slider_data.buckets.last().value?'':iMax)+"]";form.tmdn.value=Settings.CURRENCY_NUMBER+$F('range_min')+" to "+Settings.CURRENCY_NUMBER+$F('range_max')+PriceSlider.PRICE_SUFFIX;},applyFilter:function(){afsInsertionQueue.clear();PriceSlider.setFormValues();var form=$('price_form');var params=form.serialize();if(Settings.MAP_VIEW){params+='&hits='+Settings.MAX_HITS.MAP;};new Ajax.Request('/search/results',{method:'get',parameters:params,onlyLatestOfClass:'slider_link'});showFilteringResults();pageTracker._trackEvent('Interface','Slider');},setRequiredWidth:function(){PriceSlider.WIDTH=$('content').getWidth()-(PriceSlider.MARGIN*2)-2;},calculateCurrentWidth:function(){return $('content').getWidth()-(PriceSlider.MARGIN*2)-2;}}
function setUpPriceBoxesWithoutSlider(fade){$('slider').hide();fade?Effect.Appear('slider_replacement'):$('slider_replacement').show();rangeMinIfSelectionEmpty=slider_data.buckets.length>0?slider_data.buckets.first().value.toShortHand():'';rangeMaxIfSelectionEmpty=slider_data.buckets.length>0?slider_data.buckets.last().value.toShortHand()+'+':'';$('range_min').value=slider_data.user_selection.min.empty()?rangeMinIfSelectionEmpty:slider_data.user_selection.min.toShortHand();$('range_max').value=slider_data.user_selection.max.empty()?rangeMaxIfSelectionEmpty:slider_data.user_selection.max.toShortHand();$$('#price_form input[type=text]').each(function(input){Event.observe(input,'focus',function(){PriceSlider.tempFormValue=$F(input);});Event.observe(input,'blur',function(){input.value=$F(input).toShortHand();if($F('br')=='buy'){var i=input.value.extrapolateFromShortHand();if(i<1000){input.value=(i*1000).toString().toShortHand()};};if($F("range_min").extrapolateFromShortHand()>$F("range_max").extrapolateFromShortHand()){$("range_max").value=$F('range_min');};});Event.observe(input,'keypress',function(e){if(e.keyCode==Event.KEY_RETURN){input.blur();}});})
PriceSlider.PRICE_SUFFIX=$F('br')=='buy'?'':slider_data.rent_suffix;if($('slider_replacement_average_price_container')){$('slider_replacement_average_price_container').update(slider_data.average_price.number_with_delimiter())}}