var isMappable=false;var resultListOffset=169;var sImageOnPath="/images/form_radio_sel_sm.gif";var sImageOffPath="/images/form_radio_sm.gif";var oImgWidth=16;var oImgHeight=16;var search_history_id=null;var queryParams=$H();var queryKeywordId='';var transactionTypeShorthand='';var searchRepresentation='';function internalLinkForNavigator(additionalParamsAsArray){internalLink($H({type:additionalParamsAsArray[0],tnn:additionalParamsAsArray[1],tmn:additionalParamsAsArray[2],tmdn:additionalParamsAsArray[3],tmv:additionalParamsAsArray[4],tmc:additionalParamsAsArray[5],tmd:additionalParamsAsArray[6]}));pageTracker._trackEvent('SearchNavigation','Modifier_'+additionalParamsAsArray[6]+'_'+additionalParamsAsArray[3]);}
function internalLink(additionalParams){var currentParams=queryParams;currentParams.set('query_keyword_id',queryKeywordId);var params=currentParams.merge(additionalParams);try{new Ajax.Request('/search/results',{method:'get',parameters:params,onlyLatestOfClass:'internal_link'});showFilteringResults();pageTracker._trackEvent('Interface','ResultsAjaxUpdate');}
catch(e){sendJSError('results.js: internalLink()',e);}}
function internalLinkOnlyMyGlobrix(additionalParams){try{if(MyGlobrix.loggedIn){internalLink(additionalParams);}else{var currentParams=queryParams;currentParams.set('query_keyword_id',queryKeywordId);currentParams.set('consecutive_request',true);var params=currentParams.merge(additionalParams);new Ajax.Request('/myglobrix/instigate_login',{method:'get',parameters:params});}}catch(e){sendJSError('results.js: internalLink()',e);}}
function reloadExistingSearch(params,newRentSort){var currentLocation=window.location.protocol+"//"+window.location.host+window.location.pathname;if(typeof params=='undefined'){params=queryParams}
params.set('query_keyword_id',queryKeywordId);if(typeof newRentSort!='undefined'&&typeof params.get('sb')!='undefined'&&params.get('sb').include('gbprent')){var newSort=params.get('sb');if(newRentSort=='pcm'){newSort=newSort.sub('pw','pcm');}
else{newSort=newSort.sub('pcm','pw');}
params.set('sb',newSort);}
var newQuery=currentLocation+"?"+params.toQueryString();window.location=newQuery;}
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 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');}
var Results={hits:new Array(),total:new String(),is_mappable:false,unmappableCoords:['49.210420445650286','-22.32421875','59.42272750081453','16.3037109375','54.62297813269033','-2.98828125'],show_save:false,offset:0,requestedNext:false,append:function(json){try{_results=json;_hits_to_append=_results.hits;_src=new String();_hits_to_append.each(function(hit_data){_src+=hit_data.hit_html;Results.hits.push(hit_data);});Element.insert('results_container',{bottom:_src});this.show_save=_results.save_from_here;this.is_mappable=_results.is_mappable;statsAndTrackers();}catch(e){sendJSError('results.js: Results.append',e);}},update:function(json){try{Results.offset=0;this.load(json);if(Settings.MAP_VIEW){mapResults('map');}else{listResults();};statsAndTrackers();}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{Settings.MAP_VIEW=false;Cookies.set('show_map','false',365);queryParams.set('query_keyword_id',queryKeywordId);var params=queryParams.update({sm:'',cst:''}).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.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);_src='';hideMap();$('results_list').show();}}catch(e){sendJSError('results.js: listResults()',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 toggleFeaturedProperties(){try{Element.toggle('featured_properties_contents');if($('featured_properties').hasClassName('closed')){$('featured_properties').removeClassName('closed');$('featured_properties').addClassName('open');}else{$('featured_properties').removeClassName('open');$('featured_properties').addClassName('closed');}}catch(e){sendJSError('results.js: toggleFeaturedProperties()',e);}}
function appendResults(additionalParams){Cookies.set('show_map','false',365);try{if(!Results.requestedNext&&Results.total>Results.hits.length){Results.requestedNext=true;var currentParams=queryParams;currentParams.set('query_keyword_id',queryKeywordId);var params=currentParams.merge(additionalParams);new Ajax.Request('/search/append_results',{method:'get',parameters:params,onlyLatestOfClass:'scroll_search'});showFilteringResults();pageTracker._trackEvent('Interface','GrowResults');}}catch(e){sendJSError('results.js: appendResults()',e);}}
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.find(function(hit){return hit.id==hit_id});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 GSmallZoomControl3D(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(6,6)));var options={title:"Visit the agent's details at: "+hit.link,icon:new GIcon()};options.icon.image=setMapPointer()+".png";options.icon.iconSize=new GSize(16,16);options.icon.iconAnchor=new GPoint(8,8);var marker=new GMarker(hit_lat_lng,options);GEvent.addListener(marker,"click",function(){window.open(hit.link,'new')});map.addOverlay(marker);};return false;}catch(e){sendJSError('results.js: mapSingleResult()',e);}}
function turnOffSlider(){if(!bIE6){try{setUpPriceBoxesWithoutSlider(true);}
catch(e){};try{Effect.Fade('hide_slider_message');}
catch(e){};try{$$('#price_form input[type=text]').invoke('stopObserving','focus',show_hide_slider_message);}
catch(e){}}}
function turnOnSlider(){if(!bIE6){try{PriceSlider.setup(true);}
catch(e){};try{Effect.Fade('hide_slider_message');}
catch(e){};try{$$('#price_form input[type=text]').invoke('stopObserving','focus',show_hide_slider_message);}
catch(e){}}}
if(navigator.platform.include('mac')){aLoadScripts.push(function(){try{$('breadcrumb').addClassName('mac');}catch(e){sendJSError('aLoadScripts: trying to addClassName to breadcrumb',e);}})}
var slider_data={buckets:[{value:'0',props:0}],average_price:0,rent_suffix:'',user_selection:{min:'',max:''}};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:0,LAYOUT_MODE:'normal',tempFormValue:'',isSetUp:false,setup:function(fade){PriceSlider.HEIGHT=25-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();PriceSlider.OFFSET_LEFT=PriceSlider.getSliderXPos();aResizeScripts.push(PriceSlider.resize);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;var sliderClickX=Event.pointerX(e)-PriceSlider.OFFSET_LEFT;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];}}});if($('rent_unit_option')){$('rent_unit_option').observe('mouseover',function(e){$('rent_unit_option_picker').show();$('rent_unit_option_selected').addClassName('hover');})
$('rent_unit_option').observe('mouseout',function(e){$('rent_unit_option_picker').hide();$('rent_unit_option_selected').removeClassName('hover');})
$$('#rent_unit_option_picker a').invoke('observe','click',function(e){new Ajax.UniqueLiveRequest('/myglobrix/set_rent_navigator_from_shortcut',{parameters:{unit:Event.element(e).innerHTML}})})}
PriceSlider.isSetUp=true;PriceSlider.refresh();},resize:function(){PriceSlider.WIDTH=PriceSlider.calculateCurrentWidth();PriceSlider.OFFSET_LEFT=PriceSlider.getSliderXPos();try{if(slider_data.buckets.length>0){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({width:bucket_width+'px'});bucket.down('div.graph').setStyle({width:bucket_width+'px'});});$('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';if(typeof slider_data.buckets.last!='undefined'){PriceSlider.resetPrice();}
PriceSlider.setAveragePrice();}}catch(e){}},adjustForClient:function(){if(Prototype.Browser.Gecko&&navigator.platform.toLowerCase().include('mac')){$$('#price_form input').each(function(input){input.setStyle({paddingTop:'4px',height:'12px'})})
$$('td.header h3')[0].setStyle({paddingTop:'4px'})}},layout:function(){PriceSlider.WIDTH=PriceSlider.calculateCurrentWidth();PriceSlider.PRICE_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(slider_data.buckets[index]){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){if(slider_data.buckets[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();if(slider_data.buckets.length>0){form.tmv.value="["+iMin+";"+(iMax==slider_data.buckets.last().value?'':iMax)+"]";}else{form.tmv.value="["+iMin+";"+iMax+"]";}
form.tmdn.value=Settings.CURRENCY_NUMBER+$F('range_min')+" to "+Settings.CURRENCY_NUMBER+$F('range_max')+PriceSlider.PRICE_SUFFIX;},applyFilter:function(){PriceSlider.setFormValues();var form=$('price_form');var tmvRegEx=/\[\d*?;\d*?\]/;if(tmvRegEx.test(form.tmv.value)){var params=form.serialize(true);internalLink(params);pageTracker._trackEvent('Interface','Slider');}},setRequiredWidth:function(){PriceSlider.WIDTH=$('content').getWidth()-(PriceSlider.MARGIN*2)-2;},calculateCurrentWidth:function(){var rentUnitSelectorOffset=$('rent_unit_option_selected')?$('rent_unit_option_selected').getWidth():0;return $('content').getWidth()-(PriceSlider.MARGIN*2)-2-rentUnitSelectorOffset;},getSliderXPos:function(){var sliderOffsetParent=$('slider').getOffsetParent();var sliderXOffset=$('slider').viewportOffset().left;var sliderOffsetParentXOffset=sliderOffsetParent.viewportOffset().left;return(sliderXOffset==sliderOffsetParentXOffset?sliderXOffset+parseInt(sliderOffsetParent.getStyle('border-left-width')):sliderXOffset)}}
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())}}
