jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=a([]);if(c.range){if(c.range===true){this.range=a("<div></div>");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length<c.values.length){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d<b))){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,{handle:this.handles[e],value:d,values:c});var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,{handle:this.handles[e],value:d});if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("stop",d,b)},_change:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("change",d,b)},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);jQuery.fn.pageSlider=function(t,q,f){var h=$("ul",this);var u=q;if(q>1){if(document.getElementById("linkNo"+String(q-1))!==undefined){u=document.getElementById("linkNo"+String(q-1)).href}else{if(document.getElementById("linkNo"+String(q+1))!==undefined){u=document.getElementById("linkNo"+String(q+1)).href}}}else{if(t>1){u=document.getElementById("linkNo2").href}}h.empty();for(var r=0;r<t;r++){if((r+1)==q){h.append('<li><span class="current">'+q+"</span></li>")}else{var d=u.indexOf("?");var l=u.length;if(u.indexOf("index=")>-1){d=u.indexOf("index=");if(u.indexOf("&",d)>-1){l=u.indexOf("&",d)}var j=u.substring(d,l);if(j.indexOf("index")>-1){if((r*f)>0){h.append('<li><a href="'+u.replace(j,"index="+(r*f))+'" rel="nofollow">'+(r+1)+"</a></li>")}else{h.append('<li><a href="'+u.replace(u.substring(d-1,l),"")+'" rel="nofollow">'+(r+1)+"</a></li>")}}else{if((r*f)>0){h.append('<li><a href="'+u.replace(j,j+"index="+(r*f))+'" rel="nofollow">'+(r+1)+"</a></li>")}else{h.append('<li><a href="'+u.replace(j,j)+'" rel="nofollow">'+(r+1)+"</a></li>")}}}else{if((r*f)===0){h.append('<li><a href="'+u+'" rel="nofollow">'+(r+1)+"</a></li>")}else{var w="&";if(u.indexOf("?")===-1){w="?"}h.append('<li><a href="'+u+w+"index="+(r*f)+'" rel="nofollow">'+(r+1)+"</a></li>")}}}}var c=$(".sliderGallery",this);c.addClass("sliderGallery-JS");var a=$(c).outerWidth();var e=h.innerWidth()+(h.innerWidth()/10);var n;if(e>a){var o=e-a;var b=o/(t-1);var k=b*(q-1);n=$("#slider",this);h.css("left","-"+k+"px");n.slider({min:0,max:o,value:k,slide:function(i,s){h.css("left","-"+s.value+"px")},stop:function(i,s){h.css("left","-"+s.value+"px")}});var p=5;var v=$(".ui-slider-handle",n);var m=a*parseInt(v.css("left"),10)/100-(p/2);n.append("<div class='previous-marker' style='left:"+m+"px;'></div>");h.css("width",(e+3)+"px");h.children("li").css("float","left");h.children("li").css("margin-right","3px");h.children(":last-child").css("margin-right","0")}else{n=$(".sliderGallery",this);n.css("width",e);var g=$(".items",this);g.addClass("slidersmalllist");h.css("width",(e+3)+"px");h.children("li").css("float","left");h.children("li").css("margin-right","3px");h.children(":last-child").css("margin-right","0")}};jQuery.fn.addSearchLocationEvent=function(){var c;var b;var g;var f=this.find("input[name=locationIdentifier]",this);var d=this.find("input[name=useLocationIdentifier]",this);var h=this.find("input[name=searchLocation]",this);var i=this;var a=function(){if(h[0]){if(jQuery.trim(h.val()).length<2){alert("Please enter an area, postcode or train station.");return true}else{if(!jQuery.trim(h.val()).match(new RegExp("([a-zA-Z0-9])*([a-zA-Z0-9])([a-zA-Z0-9])*"))){alert("Please enter an area, postcode or train station.");return true}else{if(jQuery.trim(h.val()).length>200){alert("Please enter an area, postcode or train station.");return true}}}}return false};var e=function(){if(a()){return false}if(h.val()===b){f.val(c);d.val("true")}else{d.val("false");var k=rightmove_autocomplete_getMatchingRegionIds(h.val());if(k.length>0){$("<input />").attr("type","hidden").attr("name","topMatchPersistRegIds").attr("value",k.join(",")).appendTo(i)}var j=RIGHTMOVE.UTIL.typeAheadPersister.getLatestItemFromHistory();if(j!==null){$("<input />").attr("type","hidden").attr("name","lastPersistLocId").attr("value",j.locationIdentifier).appendTo(i)}}return true};this.submit(function(){return e()});h.result(function(j,k,l){c=l;b=k})};function rightmove_autocomplete_replaceWeirdCharsWithSpace(a){a=a.replace(/'/g,"");a=a.replace(/[^A-Z0-9&]/g," ");return a.replace(/\s+/g," ")+""}function rightmove_autocomplete_convertTerm(a){a=a.replace(/&/g,"AND")+"";a=a.replace(/ ST\./g," SAINT ")+"";a=a.replace(/ ST /g," SAINT ")+"";a=a.replace(/^ST\./g,"SAINT ")+"";a=a.replace(/^ST /g,"SAINT ")+"";a=rightmove_autocomplete_replaceWeirdCharsWithSpace(a);return a}function rightmove_autocomplete_filterOutNonMatchingLocations(a,b){return jQuery.grep(a,function(e,c){if(!e.displayName){return false}var d=rightmove_autocomplete_convertTerm(e.displayName.toUpperCase());return(d.indexOf(b)===0)})}function rightmove_autocomplete_getMatchingRegionIds(b){var d="REGION^".length;var a=rightmove_autocomplete_convertTerm(b.toUpperCase());var c=RIGHTMOVE.UTIL.typeAheadPersister.getHistory(a);c=rightmove_autocomplete_filterOutNonMatchingLocations(c,a);var e=jQuery.grep(c,function(g,f){return g.locationIdentifier&&g.locationIdentifier.match(/^REGION/)});return jQuery.map(e,function(g,f){return g.locationIdentifier.substring(d,g.locationIdentifier.length)})}(function($){function isTermStartWithOutcode(term){return(term.length)<=2||term.match(/^[a-zA-Z]{1,2}[0-9].*$/)}function getOptions(){return{itemLengthLimit:35,delay:1,width:300,minChars:1,max:10,scroll:false,selectFirst:false,matchSubset:false,extraParams:false,mustMatch:false,cacheLength:100,formatItem:function(data,counter,max,value,term,options){var termToMatch=rightmove_autocomplete_convertTerm(term.toUpperCase());var dataToMatch=rightmove_autocomplete_convertTerm(data.toUpperCase());var itemSizeLimit=options.itemLengthLimit;if(dataToMatch.indexOf(termToMatch)===0){if(data.length>itemSizeLimit){return data.substr(0,itemSizeLimit)+"..."}return data}return false},formatMatch:function(rawValue,counter,length){return false},parse:function parse(data,originalTerm,myInput){var parsed=[];var evaluatedData=eval(data);if(evaluatedData){var locations=evaluatedData.typeAheadLocations;var i;var j;var location;var myclientpersister=RIGHTMOVE.UTIL.typeAheadPersister;var termToMatch=rightmove_autocomplete_convertTerm(originalTerm.toUpperCase());var arr=myclientpersister.getHistory(originalTerm);arr=rightmove_autocomplete_filterOutNonMatchingLocations(arr,termToMatch);for(i=0;i<arr.length;i++){arr[i].historical=true}if(locations){locations=rightmove_autocomplete_filterOutNonMatchingLocations(locations,termToMatch);for(i=0;i<locations.length;i++){location=locations[i];var unique=true;for(j=0;j<arr.length;j++){if(location.locationIdentifier==arr[j].locationIdentifier){unique=false}}if(unique){arr.push(location)}}}locations=arr;if(locations){var lastHistorical=-1;for(i=0;i<locations.length;i++){location=locations[i];if(location){parsed[parsed.length]={data:location.displayName,value:location.locationIdentifier,result:location.displayName,historical:(location.historical===true)};if(location.historical===true){lastHistorical=i}}}if(lastHistorical>-1){parsed[lastHistorical].lastHistorical=true}}else{}}return parsed},highlight:function(value,term){var termToMatch=rightmove_autocomplete_replaceWeirdCharsWithSpace(term.toUpperCase());if(getStOrSaintFromTerm(termToMatch)){termToMatch=getTermSoItMatchesValue(termToMatch,value,getStOrSaintFromTerm)}if(getAndOrSign(termToMatch)){termToMatch=getTermSoItMatchesValue(termToMatch,value,getAndOrSign)}var highlightToLength=getHighlightToLength(value,termToMatch);return"<span class='highlightLetter'>"+value.substr(0,highlightToLength)+"</span>"+value.substr(highlightToLength,value.length)}}}$.fn.extend({rightmoveautocomplete:function(urlOrData,form){var options=getOptions();var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){autoCompleter=new $.Autocompleter(this,options,form)})},result:function(handler){return this.bind("result",handler)},search:function(handler){return this.trigger("search",[handler])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(options){return this.trigger("setOptions",[options])},unautocomplete:function(){return this.trigger("unautocomplete")}});$.Autocompleter=function(input,options,form){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var currentValue;var previousValue="";var cache=$.Autocompleter.Cache(options);function getCurrentStatus(){return currentStatus}var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config,form);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false}});function selectCurrent(){var selected=select.selected();if(!selected){return false}var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v}v+=options.multipleSeparator}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return}var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue){return}previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase){currentValue=currentValue.toLowerCase()}request(currentValue,receiveData,hideResultsNow)}else{stopLoading();select.hide()}}$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev(currentValue)}else{onChange(0,true)}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next(currentValue)}else{onChange(0,true)}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp(currentValue)}else{onChange(0,true)}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown(currentValue)}else{onChange(0,true)}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(function(){select.resetSelectedCounter();currentValue=$input.val();onChange()},options.delay);break}}).focus(function(){hasFocus++}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults()}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true)}}).bind("hideAutoComplete",function(){hideResults()}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break}}}if(typeof fn=="function"){fn(result)}else{$input.trigger("result",result&&[result.data,result.value])}}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback)})}).bind("flushCache",function(){cache.flush()}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data" in arguments[1]){cache.populate()}}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete")});function trimWords(value){if(!value){return[""]}var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value)){result[i]=$.trim(value)}});return result}function lastWord(value){if(!options.multiple){return value}var words=trimWords(value);return words[words.length-1]}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length)}}function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200)}function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""))}else{$input.val("")}}})}if(wasVisible){$.Autocompleter.Selection(input,input.value.length,input.value.length)}}function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show()}else{hideResultsNow();select.display(data,q);if(!isTermStartWithOutcode(q)){select.show()}}}function request(originalTerm,success,failure){var term=originalTerm;if(!options.matchCase){term=term.toUpperCase()}term=rightmove_autocomplete_convertTerm(term);if(term!=null&&term.length<1){failure(originalTerm)}var data=cache.load(term);if(data){success(originalTerm,options.parse(data,originalTerm,$input))}else{if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={};$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term)},extraParams),success:function(data){var parsed=options.parse(data,originalTerm,$input);cache.add(term,data);success(originalTerm,parsed)}})}else{select.emptyList();failure(originalTerm)}}}function stopLoading(){$input.removeClass(options.loadingClass)}};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0]},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase){s=s.toLowerCase()}var i=s.indexOf(sub);if(i==-1){return false}return i==0||options.matchContains}function add(q,value){if(length>options.cacheLength){flush()}if(!data[q]){length++}data[q]=value}function populate(){if(!options.data){return false}var stMatchSets={},nullData=0;if(!options.url){options.cacheLength=1}stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false){continue}var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar]){stMatchSets[firstChar]=[]}var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row)}}$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value)})}setTimeout(populate,25);function flush(){data={};length=0}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length){return null}if(data[q]){return data[q]}else{var currentKey=getParentKey(q);var item;while(currentKey.length>=options.minChars){item=data[currentKey];if(item){if(eval(item).isComplete){return item}else{return null}}currentKey=getParentKey(currentKey)}return null}}}};function getAndOrSign(input){var theString=input.toUpperCase();if(theString.indexOf("&")!=-1){return" & "}if(theString.indexOf(" AND ")!=-1){return" AND "}}function getStOrSaintFromTerm(input){var theString=input.toUpperCase();var saintExpressionsTheTermCouldStartWith=["ST. ","ST.","ST ","SAINT.","SAINT "];var saintExpressionsTheTermCouldContain=[" ST. "," ST "," SAINT. "," SAINT "];for(var count=0;count<=saintExpressionsTheTermCouldStartWith.length;count++){if(theString.indexOf(saintExpressionsTheTermCouldStartWith[count])===0){return saintExpressionsTheTermCouldStartWith[count]}}for(count=0;count<=saintExpressionsTheTermCouldContain.length;count++){if(theString.indexOf(saintExpressionsTheTermCouldContain[count])!=-1){return saintExpressionsTheTermCouldContain[count]}}return null}function getHighlightToLength(valueToHighlight,termToMatch){var currentlyMatching=true;var currentTermCharIndex=0;var currentTermChar;var highlightToLength=0;var currentValueToHighlightChar;while(highlightToLength<valueToHighlight.length&&currentTermCharIndex<=termToMatch.length&&currentlyMatching){currentTermChar=termToMatch.charAt(currentTermCharIndex);currentValueToHighlightChar=valueToHighlight.charAt(highlightToLength);if(currentTermChar==currentValueToHighlightChar.toUpperCase()){highlightToLength++;currentTermCharIndex++}else{if(currentTermChar==" "){currentTermCharIndex++;var isCurrentHighlightCharNonAlphaNumeric=true;while(isCurrentHighlightCharNonAlphaNumeric){highlightToLength++;isCurrentHighlightCharNonAlphaNumeric=(/[^A-Z'0-9]/g.test(valueToHighlight.charAt(highlightToLength))&&highlightToLength<=valueToHighlight.length)}}else{currentlyMatching=false}}}return highlightToLength}function getTermSoItMatchesValue(termToMatch,value,replaceFunction){var term=replaceFunction(termToMatch);var data=replaceFunction(value.toUpperCase());if(data!=term){return termToMatch.replace(term,data)}return termToMatch}function getParentKey(key){return key.substr(0,key.length-1)}$.Autocompleter.Select=function(options,input,select,config,form){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list,currentlyDisplayedData,mouseMoved=false;function init(){if(!needsInit){return}element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);if($.browser.msie&&parseInt($.browser.version)==6){element.append("<iframe></iframe>")}list=$("<ul id='typeAheadResult'  />").appendTo(element).mouseover(function(event){if(mouseMoved&&target(event).nodeName&&target(event).nodeName.toUpperCase()=="LI"){selectItem(event,list)}}).mousemove(function(event){if(!mouseMoved&&target(event).nodeName&&target(event).nodeName.toUpperCase()=="LI"){selectItem(event,list);mouseMoved=true}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);if($(target(event))[0].id=="moreLink"){return true}select();input.focus();return false}).mousedown(function(){config.mouseDownOnSelect=true}).mouseup(function(){config.mouseDownOnSelect=false});if(options.width>0){element.css("width",options.width)}needsInit=false}function selectItem(event,list){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE)}function target(event){var element=event.target;while(element&&element.tagName!="LI"){element=element.parentNode}if(!element){return[]}return element}function moveSelect(step,currentValue){var activeItem;listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var textToDisplay;if(active===-1){textToDisplay=currentValue}else{activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);textToDisplay=currentlyDisplayedData[active].data}$(input).attr("value",textToDisplay);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight())}else{if(offset<list.scrollTop()){list.scrollTop(offset)}}}}function movePosition(step){active+=step;if(active<-1){active=listItems.size()-1}else{if(active>=listItems.size()){active=-1}}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available}function fillList(){mouseMoved=false;list.empty();var max=limitNumberOfItems(data.length);var isEmpty=true;var count;currentlyDisplayedData=new Array();for(count=0;count<max;count++){if(!data[count]){continue}var formatted=options.formatItem(data[count].data,count+1,max,data[count].value,term,options);if(formatted===false){continue}isEmpty=false;var liHtml=$("<li/>").html(options.highlight(formatted,term)).addClass(count%2==0?"ac_even":"ac_odd");if(data[count].historical){liHtml.addClass("ac_hist")}if(data[count].lastHistorical){liHtml.addClass("ac_lasthist")}var li=liHtml.appendTo(list)[0];$.data(li,"ac_data",data[count]);currentlyDisplayedData[currentlyDisplayedData.length]=data[count]}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0}if(isEmpty){var li=null;if(!isTermStartWithOutcode(term)){li=$("<li class='nomatch'>no matches found</li>").addClass(count%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",null)}}else{if(count===10){var moreLinkLi=$("<li id ='moreLink'></li>").html("<a class='more' href='#'>More...</a>").addClass(count%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(moreLinkLi,"ac_data",null);$("#moreLink").click(function(){return form.submit()})}}if($.fn.bgiframe){list.bgiframe()}}return{display:function(d,q){init();data=d;term=q;fillList()},next:function(currentValue){moveSelect(1,currentValue)},prev:function(currentValue){moveSelect(-1,currentValue)},pageUp:function(currentValue){if(active!=0&&active-8<0){moveSelect(-active,currentValue)}else{moveSelect(-8,currentValue)}},pageDown:function(currentValue){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active,currentValue)}else{moveSelect(8,currentValue)}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1},visible:function(){return element&&element.is(":visible")},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0])},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:"auto"});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight});var scrollbarsVisible=listHeight>options.scrollHeight;list.css("height",scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")))}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data")},emptyList:function(){list&&list.empty()},unbind:function(){element&&element.remove()},resetSelectedCounter:function(){active=-1}}};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select()}else{if(field.setSelectionRange){field.setSelectionRange(start,end)}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end}}}field.focus()}})(jQuery);