var wyA=300;var wyB=400000;var wyC=450000;var wyD=0;var wyE=0;var wyF=wyB-wyE;var wyG=wyC+wyE;var wyH=wyD;var wyI=3;var wyJ=3;var wyK=13;var wyL=new GLatLng(54.585264,-5.90772);var wyM=null;var wyN=null;var wyO=null;var wyP=null;function wyQ(){var C=(map.getBounds().getNorthEast().lat()-map.getBounds().getSouthWest().lat())*69.172;var B=(map.getBounds().getNorthEast().lng()-map.getBounds().getSouthWest().lng())*69.172;var A=0;if(C>B){wyI=(C)}else{wyI=(B)}wyI=wyI*(7/8);if(isNaN(wyI)){wyI=1}if(wyI<1){wyI=1}}function wyS(){var A=((wyJ/8)*6)/69.172;if(map.getCenter().lat()<(wyL.lat()-A)||map.getCenter().lat()>(wyL.lat()+A)||map.getCenter().lng()<(wyL.lng()-A)||map.getCenter().lng()>(wyL.lng()+A)){return false}else{return true}}var slider;var map=null;var markerManager=null;var wyAE=null;var mapListWidth=600;function wyT(){if(navigator.userAgent.indexOf("Opera")!=-1){var B=document.getElementById("map");var E=document.getElementById("bl");var A=E.offsetWidth-10;var H=E.offsetHeight-30;var J=document.getElementById("listView");var I=document.getElementById("bl");var D=I.offsetWidth-10;var G=I.offsetHeight-30-24;if(A&&H){var F=document.getElementById("map");var C=document.getElementById("bl");if(F&&F.style){F.setAttribute("width",A);F.setAttribute("height",H);F.style.width=A+"px";F.style.height=H+"px"}if(J&&J.style){J.setAttribute("width",D);J.setAttribute("height",G);J.style.width=D+"px";J.style.height=G+"px"}}}var E=document.getElementById("bl");mapListWidth=E.offsetWidth-10}var wyV="";function wyU(A){if(wyP){wyP.getLatLng(A,function(B){if(!B){wyV=""}else{wyV=B}afterLoad()})}}function load(){wyP=new GClientGeocoder();var A=unescape(gup("address"));if(A!=""){wyU(A)}else{afterLoad()}}function gup(B){B=B.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var A="[\\?&]"+B+"=([^&#]*)";var D=new RegExp(A);var C=D.exec(window.location.href);if(C==null){return""}else{return C[1]}}function afterLoad(){wyT();window.onresize=wyT;var wyW=null;if(gup("address")!=""&&wyV==""){alert("'"+gup("address")+"' not found.")}var point=gup("point");if(point!=""){wyW=point}else{if(wyV!=""){wyW=wyV}else{wyW=wyAC("wyStartPosition")}}var wyX=wyAC("wyZoom");var wyY=wyAC("wyMinValue");var wyZ=wyAC("wyMaxValue");var wyAA=wyAC("wyMinBedrooms");if(wyW!=null&&wyW!=""&&wyX!=null&&wyX!=""&&wyY!=null&&wyY!=""&&wyZ!=null&&wyZ!=""&&wyAA!=null&&wyAA!=""){var pos;eval("pos=new GLatLng"+wyW+";");wyX=parseFloat(wyX);wyY=parseFloat(wyY);wyZ=parseFloat(wyZ);wyL=pos;wyK=wyX;wyB=wyY;wyC=wyZ;wyD=wyAA;wyF=wyB-wyE;wyG=wyC+wyE;wyH=wyD}sliderInit();wyO=new Slider(0,100,50,50,13,206,25,8,"percentLoaded","images/loadingT.gif");wyO.draw();if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map"));map.enableContinuousZoom();GEvent.addListener(map,"moveend",function(){wyAB("wyStartPosition",map.getCenter(),90);wyAB("wyZoom",map.getZoom(),90);wyQ();if(!wyS()){displayNewValue()}});GEvent.addListener(map,"zoomstart",function(){if(map.getExtInfoWindow()){map.getExtInfoWindow().remove()}});GEvent.addListener(map,"zoomend",function(oldzoomlevel,zoomlevel){wyAB("wyStartPosition",map.getCenter(),90);wyAB("wyZoom",map.getZoom(),90);if(map.getExtInfoWindow()){map.getExtInfoWindow().remove()}if(AjaxObject.recordsCount>wyA&&oldzoomlevel<zoomlevel){wyQ();displayNewValue(true)}});GEvent.addListener(map,"mousemove",function(e){map.closeExtInfoWindow()});GEvent.addListener(map,"load",function(){wyQ();wyJ=wyI;wyAE={success:AjaxObject.handleSuccess,afterSuccess:showProperties,failure:AjaxObject.handleFailure,scope:AjaxObject,recordsPage:"wyDB13.php?function=getList&sI=%1&eI=%2&sP="+wyF+"&eP="+wyG+"&lt="+map.getCenter().lat()+"&lg="+map.getCenter().lng()+"&m="+wyI+"&b="+wyH,countPage:"wyDB13.php?function=count&sP="+wyF+"&eP="+wyG+"&lt="+map.getCenter().lat()+"&lg="+map.getCenter().lng()+"&m="+wyI+"&b="+wyH};showPercentLoaded(0,"loading...");window.setTimeout("AjaxObject.startRequest(wyAE)",0)});map.setCenter(wyL,wyK);map.enableScrollWheelZoom();map.enableDoubleClickZoom();map.addControl(new GLargeMapControl(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(7,7)));map.addControl(new GMapTypeControl());map.addControl(new GOverviewMapControl());map.addControl(new WYSearchHelpControl(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(80,0)));map.addControl(new google.maps.LocalSearch(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(80,12)));mgrOptions={borderPadding:40,minZoom:0,maxZoom:17,trackMarkers:true};favorites={markers:new Array(),markerManager:new MarkerManager(map,mgrOptions)};sliderInitialized=true}else{alert("Browser not compatible with Google Maps")}}var sliderInitialized=false;var valueslidermin=null;var valueslidermax=null;var bedslidermin=null;function sliderInit(){wyM=new Slider(100,900,100,10,30,400,0,8,"valuesliderbg");wyM.highlightOffset(15);wyM.highlightAddHeight(0);wyM.draw();wyN=new Slider(0,5,1,1,25,100,0,8,"bedsliderbg");wyN.draw();valueslidermin=YAHOO.widget.Slider.getHorizSlider("valuesliderbg","valuesliderthumbmin",0,400,5);valueslidermin.animate=false;setSliderValue(valueslidermin,wyB);valueslidermax=YAHOO.widget.Slider.getHorizSlider("valuesliderbg","valuesliderthumbmax",0,400,5);valueslidermax.animate=false;setSliderValue(valueslidermax,wyC);bedslidermin=YAHOO.widget.Slider.getHorizSlider("bedsliderbg","bedsliderthumbmin",0,100,20);bedslidermin.animate=false;bedslidermin.setValue(wyD*20);valueslidermin.subscribe("change",function(A){minChange()});valueslidermin.subscribe("slideEnd",function(A){minSlideEnd()});valueslidermax.subscribe("change",function(A){maxChange()});valueslidermax.subscribe("slideEnd",function(A){maxSlideEnd()});bedslidermin.subscribe("change",function(A){var B=new YAHOO.util.Element("bedFrom");B.setStyle("left",bedslidermin.getValue()+2);B.set("innerHTML",""+(bedslidermin.getValue()/20)+"+")});bedslidermin.subscribe("slideEnd",function(A){wyAB("wyMinBedrooms",(bedslidermin.getValue()/20),90);var B=new YAHOO.util.Element("bedFrom");B.setStyle("left",bedslidermin.getValue()+2);B.set("innerHTML",""+(bedslidermin.getValue()/20)+"+");displayNewValue()});minChange();maxChange()}function getSliderValue(A){if(A.getValue()==0){return 0}else{if(A.getValue()==400){return 100000000}else{return(A.getValue()*2000)+100000}}}function setSliderValue(A,B){if(B<100000){A.setValue(0)}else{if(B>900000){A.setValue(400)}else{A.setValue(Math.floor(((B-100000)/2000)),false)}}}function minChange(C){var A=new YAHOO.util.Element("valueFrom");A.setStyle("left",valueslidermin.getValue()-2);var B=(((valueslidermin.getValue()*2)+100)<=100)?" and less":"";A.set("innerHTML",((valueslidermin.getValue()*2)+100)+""+B)}function minSlideEnd(C){wyAB("wyMinValue",getSliderValue(valueslidermin),90);if(valueslidermin.valueChangeSource==2){return }if(valueslidermin.getValue()==0&&valueslidermax.getValue()==0){return }var D=valueslidermin.getValue();var E=valueslidermax.getValue();if(D>=E){D=E-5;valueslidermin.setValue(D,false)}var A=D;var F=new YAHOO.util.Element("valueFrom");F.setStyle("left",A-2);var B=(((A*2)+100)<=100)?" and less":"";F.set("innerHTML",((A*2)+100)+""+B);if(AjaxObject.recordsCount>wyA){displayNewValue(true)}else{displayNewValue()}}function maxChange(B){var C=new YAHOO.util.Element("valueTo");C.setStyle("left",valueslidermax.getValue()+1);var A=(((valueslidermax.getValue()*2)+100)>=900)?"&nbsp;plus":"";C.set("innerHTML",((valueslidermax.getValue()*2)+100)+""+A)}function maxSlideEnd(C){wyAB("wyMaxValue",getSliderValue(valueslidermax),90);if(valueslidermax.valueChangeSource==2){return }if(valueslidermin.getValue()==0&&valueslidermax.getValue()==0){return }var D=valueslidermin.getValue();var E=valueslidermax.getValue();if(E<=D){E=D+5;valueslidermax.setValue(E,false)}var B=E;var F=new YAHOO.util.Element("valueTo");F.setStyle("left",B+1);var A=(((B*2)+100)>=900)?"&nbsp;plus":"";F.set("innerHTML",((B*2)+100)+""+A);displayNewValue()}var currentCriteriaSearchID=0;var totalShown=0;function displayNewValue(G){map.closeExtInfoWindow();if(!sliderInitialized){return }currentCriteriaSearchID+=1;var A="For Sale&nbsp;";for(var B=0;B<document.thisForm.propertyStatus.length;B++){if(document.thisForm.propertyStatus[B].checked){A=document.thisForm.propertyStatus[B].value}}var F=getSliderValue(valueslidermin);var C=getSliderValue(valueslidermax);var D=bedslidermin.getValue()/20;if(!G&&F>=wyF&&C<=wyG&&D>=wyH&&wyS()){totalShown=0;toggle(currentCriteriaSearchID,F,C,D,A,0)}else{wyL=map.getCenter();wyQ();wyJ=wyI;var E=wyE;if(valueslidermax.getValue()<250||valueslidermin.getValue()<200){E=Math.round(wyE/3)}wyF=F-E;if(wyF<0){wyF=0}wyG=C+E;if(wyG>=900000){wyG=100000000}wyH=D;reloadRecords()}wyB=F;wyC=C;wyD=D}function toggle(B,G,N,I,C,A){if(!AjaxObject.list){return }var M=A+AjaxObject.chunkSize-1;if(M>=(AjaxObject.list.length-1)){M=AjaxObject.list.length-1}if(A>(AjaxObject.list.length-1)||M<A){return }var H;var D=AjaxObject.recordsCount;if(D>wyA){D=wyA}H=Math.ceil((100/D)*(A+1));if(H>100){H=100}showPercentLoaded((50+(H/2)));setPercentLoaded((50+(H/2)),"updating..");if(M<(AjaxObject.list.length-1)&&B==currentCriteriaSearchID){setTimeout("toggle("+B+","+G+","+N+","+I+',"'+C+'",'+(M+1)+")",10)}var F=AjaxObject.getChunkIFromI(A).chunk;if((G<=parseInt(AjaxObject.list[A].STARTING_PRICE)&&N>=parseInt(AjaxObject.list[M].STARTING_PRICE))){var L="";L+=I+":"+C;if(AjaxObject.chunk[F].visibility!="show"||AjaxObject.chunk[F].searchDetail!=L){var E=new Array();for(var J=A;J<=M;J++){if((I<=parseInt(AjaxObject.list[J].BEDROOMS))){totalShown++;if(!AjaxObject.list[J].visible){E.push(AjaxObject.list[J].marker);AjaxObject.list[J].visible=true}}else{if(AjaxObject.list[J].visible){setTimeout("AjaxObject.chunk["+F+"].markerManager.removeMarker(AjaxObject.list["+J+"].marker);",0);AjaxObject.list[J].visible=false}}}if(E&&E[0]){AjaxObject.chunk[F].markerManager.addMarkers(E,0,17)}setTimeout("AjaxObject.chunk["+F+"].markerManager.refresh();",0);AjaxObject.chunk[F].visibility="show";AjaxObject.chunk[F].searchDetail=L}else{totalShown+=((M-A)+1)}}else{if((G>=parseInt(AjaxObject.list[A].STARTING_PRICE)&&G<=parseInt(AjaxObject.list[M].STARTING_PRICE))||(N>=AjaxObject.list[A].STARTING_PRICE&&N<=AjaxObject.list[M].STARTING_PRICE)){var L="";var K="";if(G>=parseInt(AjaxObject.list[A].STARTING_PRICE)&&G<=parseInt(AjaxObject.list[M].STARTING_PRICE)){L+=G;K=":"}if(N>=parseInt(AjaxObject.list[A].STARTING_PRICE)&&N<=parseInt(AjaxObject.list[M].STARTING_PRICE)){L+=K+N;K=":"}L+=":"+I+":"+C;if(AjaxObject.chunk[F].searchDetail!=L){var E=new Array();for(var J=A;J<=M;J++){if((G<=parseInt(AjaxObject.list[J].STARTING_PRICE)&&N>=parseInt(AjaxObject.list[J].STARTING_PRICE))&&(I<=parseInt(AjaxObject.list[J].BEDROOMS))){totalShown++;if(!AjaxObject.list[J].visible){E.push(AjaxObject.list[J].marker);AjaxObject.list[J].visible=true}}else{if(AjaxObject.list[J].visible){setTimeout("AjaxObject.chunk["+F+"].markerManager.removeMarker(AjaxObject.list["+J+"].marker);",0);AjaxObject.list[J].visible=false}}}if(E&&E[0]){AjaxObject.chunk[F].markerManager.addMarkers(E,0,17)}setTimeout("AjaxObject.chunk["+F+"].markerManager.refresh();",0);AjaxObject.chunk[F].visibility="partial";AjaxObject.chunk[F].searchDetail=L}}else{if((G<parseInt(AjaxObject.list[A].STARTING_PRICE)&&N<parseInt(AjaxObject.list[A].STARTING_PRICE))||(G>parseInt(AjaxObject.list[M].STARTING_PRICE)&&N>parseInt(AjaxObject.list[M].STARTING_PRICE))){if(AjaxObject.chunk[F].visibility=="show"||AjaxObject.chunk[F].visibility=="partial"){AjaxObject.chunk[F].markerManager.clearMarkers();for(var J=A;J<=M;J++){AjaxObject.list[J].visible=false}setTimeout("AjaxObject.chunk["+F+"].markerManager.refresh();",0);AjaxObject.chunk[F].visibility="hide"}}}}H=Math.ceil((100/D)*(M+1));if(H>=100){H=100;setPercentLoaded(H,"complete");setTimeout("hidePercentLoaded()",100);if(AjaxObject.recordsCount>wyA){setSystemMessage("NOTE: displaying cheapest "+wyA+" properties from "+AjaxObject.recordsCount+" matching criteria. Zoom in/adjust criteria to see more.","warning")}else{setSystemMessage("displaying "+totalShown+" of "+AjaxObject.recordsCount+" properties loaded [ found within "+Math.round(wyI)+" miles from map centre ]")}addFavorites();ListView.moveTo(1)}setPercentLoaded((50+(H/2)),"updating...")}var mgrOptions="";var favorites="";function createHouseIcon(B,C){var A=new GIcon();A.image="images/icon.png";A.iconSize=new GSize(14,24);A.shadow="images/iconBackground.png";A.shadowSize=new GSize(24,30);A.iconAnchor=new GPoint(6,20);A.infoWindowAnchor=new GPoint(6,20);return A}function createFavoriteIcon(property){property.save();opts={icon:createHouseIcon(property.bedrooms,property.price/1000),clickable:true,labelText:getLabelForAmount(property.price,wyB,wyC,property.bedrooms,true),labelOffset:new GSize(-6,-20)};var marker=new LabeledMarker(new GLatLng(property.lat,property.lng),opts);marker.visible=true;favorites.markers[property.ID]=marker;eval("GEvent.addListener(marker, 'mouseover', function(marker, point) {wyAE={ success:function(o){favorites.markers["+property.ID+"].openExtInfoWindow(map, 'simple_example_window', buildInfoWindowContent(o.responseText), {paddingX:1,paddingY:1,beakOffset:3,ID:"+property.ID+"});},failure:HTMLAjaxObject2.handleFailure,htmlPage: 'wyDB13.php?function=get&I="+property.ID+"'};HTMLAjaxObject2.startRequest(wyAE);});GEvent.addListener(marker, 'click', function(marker, point) {var p = new Property("+property.ID+");p.remove();favorites.markerManager.removeMarker(favorites.markers["+property.ID+"]);favorites.markerManager.refresh();});");GEvent.addListener(marker,"mousemove",function(e){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false}else{e.preventDefault();e.stopPropagation()}});favorites.markerManager.addMarker(marker,0,17);setTimeout("favorites.markerManager.refresh();",0)}function addFavorites(){favorites.markerManager.clearMarkers();favorites.markers=new Array();var A=(new Property()).getAll();for(var B=0;B<A.length;B++){createFavoriteIcon(A[B])}}function showProperties(chunkNum,startID,endID){startID-=1;var i=0;var html;var percent;var recLoad=AjaxObject.recordsCount;if(recLoad>wyA){recLoad=wyA}percent=Math.ceil((100/recLoad)*startID);if(percent>=100){percent=100}setPercentLoaded((percent/2),"loading ("+recLoad+" of "+AjaxObject.recordsCount+" records)");var bedmin=bedslidermin.getValue()/20;var status="For Sale&nbsp;";for(var i=0;i<document.thisForm.propertyStatus.length;i++){if(document.thisForm.propertyStatus[i].checked){status=document.thisForm.propertyStatus[i].value}}var newMarkers=new Array();for(var i=startID;i<endID;i++){opts={icon:createHouseIcon(AjaxObject.list[i].BEDROOMS,AjaxObject.list[i].STARTING_PRICE/1000),clickable:true,labelText:getLabelForAmount(AjaxObject.list[i].STARTING_PRICE,wyB,wyC,AjaxObject.list[i].BEDROOMS,false),labelOffset:new GSize(-6,-20)};wyM.highlight(wyF/1000,AjaxObject.list[i].STARTING_PRICE/1000);AjaxObject.list[i].marker=new LabeledMarker(new GLatLng(AjaxObject.list[i].theLat,AjaxObject.list[i].theLng),opts);AjaxObject.list[i].visible=false;html="Searching...";eval("GEvent.addListener(AjaxObject.list[i].marker, 'mouseover', function(marker, point) {wyAE={ success:function(o){AjaxObject.list["+i+"].marker.openExtInfoWindow(map, 'simple_example_window', buildInfoWindowContent(o.responseText), {paddingX:1,paddingY:1,beakOffset:3,ID:AjaxObject.list["+i+"].ID});},failure:HTMLAjaxObject2.handleFailure,htmlPage: 'wyDB13.php?function=get&I="+AjaxObject.list[i].ID+"'};HTMLAjaxObject2.startRequest(wyAE);});GEvent.addListener(AjaxObject.list[i].marker, 'click', function(marker, point) {;var p = new Property("+AjaxObject.list[i].ID+","+AjaxObject.list[i].theLat+","+AjaxObject.list[i].theLng+","+AjaxObject.list[i].STARTING_PRICE+","+AjaxObject.list[i].BEDROOMS+");p.i = "+i+";createFavoriteIcon(p);});");GEvent.addListener(AjaxObject.list[i].marker,"mousemove",function(e){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false}else{e.preventDefault();e.stopPropagation()}})}percent=Math.ceil((100/recLoad)*endID);if(percent>=100){percent=100;if(AjaxObject.recordsCount<=wyA){wyM.highlight(wyF/1000,wyG/1000)}setPercentLoaded((percent/2),"load complete");setTimeout("displayNewValue()",0)}setPercentLoaded(((percent/2)),"loading ("+recLoad+" of "+AjaxObject.recordsCount+" records)")}function showPercentLoaded(C,B){wyO.highlight(0,C);var E=new YAHOO.util.Element("percentLoadedContainer");var D=new YAHOO.util.Element("percentLoaded");var A=new YAHOO.util.Element("percentLoadedMessage");if(B&&B!=""){A.set("innerHTML",B)}E.setStyle("visibility","visible");D.setStyle("visibility","visible")}function setPercentLoaded(C,B){wyO.highlight(0,C);var A=new YAHOO.util.Element("percentLoadedMessage");A.set("innerHTML",B)}function hidePercentLoaded(){var B=new YAHOO.util.Element("percentLoadedContainer");var A=new YAHOO.util.Element("percentLoaded");B.setStyle("visibility","hidden");A.setStyle("visibility","hidden")}function setSystemMessage(B,A){if(!A){A=""}var C=new YAHOO.util.Element("systemMessages");var E="color:#6B633D;";if(A.toString().toLowerCase()=="error"){E="color:red;"}else{if(A.toString().toLowerCase()=="warning"){E="color:#DA8B00;"}}C.set("innerHTML",B);var D=document.getElementById("systemMessages");if(typeof (D.style.cssText)=="string"){D.style.cssText=E}D.setAttribute("style",E)}function unload(){setTimeout("cleanUp(0)",0)}function cleanUp(C){if(AjaxObject.list){var B=C;var A=C+AjaxObject.biteSize;if(A>=AjaxObject.list.length){A=AjaxObject.list.length}for(var B=C;B<A;B++){AjaxObject.list[B].marker.remove();AjaxObject.list[B]=null}if(A==AjaxObject.list.length){AjaxObject.chunk=null;AjaxObject.list=null;AjaxObject=null}else{setTimeout("cleanUp("+A+")",0)}}}function reloadRecords(){if(map.getExtInfoWindow()){map.getExtInfoWindow().remove()}wyAE={success:AjaxObject.handleSuccess,afterSuccess:showProperties,failure:AjaxObject.handleFailure,scope:AjaxObject,recordsPage:"wyDB13.php?function=getList&sI=%1&eI=%2&sP="+wyF+"&eP="+wyG+"&lt="+map.getCenter().lat()+"&lg="+map.getCenter().lng()+"&m="+wyI+"&b="+wyH,countPage:"wyDB13.php?function=count&sP="+wyF+"&eP="+wyG+"&lt="+map.getCenter().lat()+"&lg="+map.getCenter().lng()+"&m="+wyI+"&b="+wyH};showPercentLoaded("reloading data");window.setTimeout("AjaxObject.startRequest(wyAE)",0)}Property=function(A,E,B,D,C){if(arguments.length<1){return }this.ID=A;if(arguments.length==1){result=this.get();if(result!=true){this.ID="";this.error=result}}else{this.lat=E;this.lng=B;this.price=D;this.bedrooms=C}};Property.prototype.toString=function(){var A="/#/";return this.ID.toString()+A+this.lat.toString()+A+this.lng.toString()+A+this.price.toString()+A+this.bedrooms.toString()};Property.prototype.fromString=function(B){var A=B.split("/#/");return new Property(A[0],A[1],A[2],A[3],A[4])};Property.prototype.isSaved=function(){var A=wyAC("wyproperties");if(A==null){return false}A=A.split(",");for(var B=0;B<A.length;B++){if(A[B]==this.ID){return true}}return false};Property.prototype.save=function(){if(!this.isSaved()){if(wyAC("wyproperties")!=null && wyAC("wyproperties")!=""){wyAB("wyproperties",wyAC("wyproperties")+","+this.ID,90)}else{wyAB("wyproperties",this.ID,90)}}wyAB("wy"+this.ID,this.toString(),90)};Property.prototype.remove=function(){var B=wyAC("wyproperties");if(B==null){return false}wyAD("wy"+this.ID);B=B.split(",");var D="";var A="";for(var C=0;C<B.length;C++){if(B[C]!=this.ID){D=D+A+B[C];A=","}}wyAB("wyproperties",D,90)};Property.prototype.get=function(){if(this.ID==null||this.ID.toString()==""){return"Please set ID to get."}if(!this.isSaved()){return"Record with id="+this.ID+" not found."}var A=this.fromString(wyAC("wy"+this.ID));this.lat=A.lat;this.lng=A.lng;this.price=A.price;this.bedrooms=A.bedrooms;return true};Property.prototype.getAll=function(){var C=new Array();var B=wyAC("wyproperties");if(B!=null&&B!=""){var E=B.split(",");for(var A=0;A<E.length;A++){var D=this.fromString(wyAC("wy"+E[A]));C[A]=D}}return C};function wyAB(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+escape(D)+A+"; path=/"}function wyAC(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return unescape(E.substring(D.length,E.length))}}return null}function wyAD(A){wyAB(A,"",-1)}function Slider(H,I,K,G,L,C,J,E,B,F){this.from=H;this.to=I;this.increment=K;this.tick=G;this.height=L;this.width=C;this.movedown=J;this.moveleft=E;this.div=B;this.img=F;this.theDiv=document.getElementById(B);if(F){var A=document.createElement("div");var D="position:absolute;top:"+(J-3)+"px;left:"+(E-7)+"px;font-size:1px;height:"+(this.height+10)+"px;width:"+(this.width+20)+";background-image: url("+F+");background-repeat:no-repeat;";if(typeof (A.style.cssText)=="string"){A.style.cssText=D}A.setAttribute("style",D);this.theDiv.appendChild(A)}this.highlightDiv=document.createElement("div");this.theDiv.appendChild(this.highlightDiv);this.highlightOffset_=0;this.highlightAddHeight_=0}Slider.prototype.highlightOffset=function(A){this.highlightOffset_=A};Slider.prototype.highlightAddHeight=function(A){this.highlightAddHeight_=A};Slider.prototype.highlight=function(G,F){this.highlightFrom=G;this.highlightTo=F;if(G<this.from){G=this.from}if(F>this.to){F=this.to}var D=this.movedown+1+this.highlightOffset_;var C=((G-this.from)*(this.width/(this.to-this.from)))+this.moveleft;var E=this.height-2+this.highlightAddHeight_;var A=((F-this.from)*(this.width/(this.to-this.from)))-C+this.moveleft;var B="background-color:#DA8B00;z-index:0;position:absolute;font-size:1px;top:"+D+"px;left:"+C+"px;height:"+E+"px;width:"+A+"px;";this.highlightDiv.style.cssText=B};Slider.prototype.draw=function(){if(this.img){return }var I=((this.width)/(((this.to-this.from)/this.increment)));var F=I/(this.increment/this.tick);var D=(this.increment/this.tick)*((this.to-this.from)/this.increment);var E=2+this.moveleft;for(var H=this.from;H<=this.to;H+=this.increment){var J=2+this.movedown;for(var G=0;G<H.toString().length;G++){var A=document.createElement("div");var C="position:absolute;top:"+J+"px;left:"+E+"px;font-size:1px;height:5px;width:10px;background-image: url(images/"+H.toString().charAt(G)+".gif);";if(typeof (A.style.cssText)=="string"){A.style.cssText=C}A.setAttribute("style",C);this.theDiv.appendChild(A);J+=5}E+=I}var E=0+this.moveleft;var J=5+this.movedown;for(var H=0;H<=D;H++){var A=document.createElement("div");if((H%(this.increment/this.tick))==0){J=4+this.movedown}else{if((H%(this.increment/this.tick/2))==0){J=Math.floor(((this.height/3)*1)+this.movedown-1)}else{J=Math.floor(((this.height/3)*2)+this.movedown-2)}}var B=this.height-J-1;var C="position:absolute;top:"+J+"px;left:"+E+"px;font-size:1px;height:"+B+"px;width:1px;background-color:white;";if(typeof (A.style.cssText)=="string"){A.style.cssText=C}A.setAttribute("style",C);this.theDiv.appendChild(A);E+=F}var A=document.createElement("div");var C="position:absolute;top:"+(this.height-2+this.movedown)+"px;left:"+(this.moveleft)+"px;font-size:1px;height:1px;width:"+(this.width+1)+"px;background-color:white;";if(typeof (A.style.cssText)=="string"){A.style.cssText=C}A.setAttribute("style",C);this.theDiv.appendChild(A)};function buildListViewWindowContent(C){var B="";var A="<a target='_blank' style='text-decoration:none;border:0px;' href='".concat(C.URL_LINK).concat("'>");B=A.concat("<table border='0' style='font-size:8pt;'><tr style='background:#6B633D;'><td>").concat(A).concat(C.ADDRESS_LINE_1.toString()).concat("<br>Bedrooms:&nbsp;").concat(C.BEDROOMS.toString()).concat("&nbsp;&nbsp;&nbsp;Reception:&nbsp;").concat(C.RECEPTION.toString()).concat("<br>&pound;").concat((C.STARTING_PRICE/1000).toString()).concat("k (approx.)&nbsp;&nbsp;&nbsp;&nbsp;Status: ").concat(C.STATUS.toString()).concat("</a>").concat("&nbsp;&nbsp;&nbsp;&nbsp;<a style='background-color:#DA8B00;color:white;font-family:Arial;font-size:8pt;font-weight:bold;' target='adminPage' href='admin.php?I=").concat(C.ID.toString()).concat("'>&nbsp;&nbsp;edit&nbsp;&nbsp;</a>").concat("&nbsp;&nbsp;&nbsp;&nbsp;<a style='background-color:#DA8B00;color:white;font-family:Arial;font-size:8pt;font-weight:bold;' href='javascript:showOnMap(").concat(C.theLat.toString()).concat(",").concat(C.theLng.toString()).concat(");").concat("'>&nbsp;&nbsp;show&nbsp;on&nbsp;map&nbsp;&gt;&nbsp;</a>").concat("</td></tr></table></a>").concat(A).concat("<table border='0' style=''><tr><td><div style='background-color:#DA8B00;color:white;font-family:Arial;font-weight:normal;font-size:7pt;font-style:italic;padding-top:1px;padding-left:4px;padding-bottom:1px;padding-right:4px;'>click on image for more details...</div>").concat(A).concat(C.PICTURE.toString().replace("result","medium").replace("<img","<img style='width:200px;' align='middle' border = '0'")).concat("</a></td></tr></table></a>").concat(A).concat("<table border='0' style='font-size:8pt;'><tr><td>").concat(A).concat(C.DESCRIPTION.toString()).concat("...</a></td></tr></table></a>");return B}var showOnMapMarker;function showOnMap(C,B){if(showOnMapMarker){map.removeOverlay(showOnMapMarker)}var A=new GLatLng(C-0.00005,B);showOnMapMarker=new GMarker(A,{title:"click to remove icon",icon:new GIcon(G_DEFAULT_ICON,"images/GIcon.png"),draggable:false});GEvent.addListener(showOnMapMarker,"click",function(){map.removeOverlay(showOnMapMarker)});map.addOverlay(showOnMapMarker);map.setCenter(A,17);showTab("one")}function buildInfoWindowContent(pJSON){eval("var properties = new Array("+pJSON+")");var content="";if(properties.length<1){content="error: property not found"}else{if(properties.length==1){var a="<a target='_blank' style='text-decoration:none;border:0px;' href='".concat(properties[0].URL_LINK).concat("'>");content=a.concat("<table border='0' style='width:311px;'><tr style='background:#6B633D;'><td>").concat(a).concat(properties[0].ADDRESS_LINE_1.toString()).concat("<br>Bedrooms:&nbsp;").concat(properties[0].BEDROOMS.toString()).concat("&nbsp;&nbsp;&nbsp;Reception:&nbsp;").concat(properties[0].RECEPTION.toString()).concat("<br>&pound;").concat((properties[0].STARTING_PRICE/1000).toString()).concat("k (approx.)&nbsp;&nbsp;&nbsp;&nbsp;Status: ").concat(properties[0].STATUS.toString()).concat("</a>").concat("&nbsp;&nbsp;&nbsp;&nbsp;<a style='background-color:#DA8B00;color:white;font-family:Arial;font-size:8pt;font-weight:bold;' target='adminPage' href='admin.php?I=").concat(properties[0].ID.toString()).concat("'>&nbsp;&nbsp;edit&nbsp;&nbsp;</a>").concat("</td></tr></table></a>").concat(a).concat("<table border='0' style='width:311px;'><tr><td><div style='width:297px;background-color:#DA8B00;color:white;font-family:Arial;font-weight:normal;font-size:7pt;font-style:italic;padding-top:1px;padding-left:4px;padding-bottom:1px;padding-right:4px;'>click on image for more details...</div>").concat(a).concat(properties[0].PICTURE.toString().replace("result","medium").replace("<img","<img align='middle' border = '0' height='201'")).concat("</a></td></tr></table></a>").concat(a).concat("<table border='0' style='width:311px;'><tr><td>").concat(a).concat(properties[0].DESCRIPTION.toString().substr(0,200)).concat("...</a></td></tr></table></a>")}else{if(properties.length>1){var html="<div style='position:absolute;left:+45px;width:260px;height:350px;text-decoration:none;' id='singleProperty'></div><div style='min-height:350px;height:350px;'><table cellspacing='2' border='0' style='width:45px;'>";for(var i=0;i<properties.length;i++){var a="<a target='_blank' style='text-decoration:none;border:0px;' href='".concat(properties[i].URL_LINK).concat("'>");var singlePropertyHTML=a.concat("<table border='0' style='width:266px;'><tr style='background:#6B633D;'><td>").concat(a).concat(properties[i].ADDRESS_LINE_1.toString()).concat("<br>Bedrooms:&nbsp;").concat(properties[i].BEDROOMS.toString()).concat("&nbsp;&nbsp;&nbsp;Reception:&nbsp;").concat(properties[i].RECEPTION.toString()).concat("<br>&pound;").concat((properties[i].STARTING_PRICE/1000).toString()).concat("k (approx.)&nbsp;&nbsp;&nbsp;&nbsp;Status: ").concat(properties[i].STATUS.toString()).concat("</a>").concat("&nbsp;&nbsp;&nbsp;&nbsp;<a style='background-color:#DA8B00;color:white;font-family:Arial;font-size:8pt;font-weight:bold;' target='adminPage' href='admin.php?I=").concat(properties[0].ID.toString()).concat("'>&nbsp;&nbsp;edit&nbsp;&nbsp;</a>").concat("</td></tr></table></a>").concat(a).concat("<table border='0' style='width:266px;'><tr><td><div style='width:252px;background-color:#DA8B00;color:white;font-family:Arial;font-weight:normal;font-size:7pt;font-style:italic;padding-top:1px;padding-left:4px;padding-bottom:1px;padding-right:4px;'>click on image or price (in list) for more details...</div>").concat(a).concat(properties[i].PICTURE.toString().replace("result","medium").replace("<img","<img align='middle' border ='0' height='201'")).concat("</a></td></tr></table></a>").concat(a).concat("<table border='0' style='width:266px;'><tr><td>").concat(a).concat(properties[i].DESCRIPTION.toString().substr(0,200)).concat("...</a></td></tr></table></a>");singlePropertyHTML=singlePropertyHTML.toString().replace(/'/g,"");var onHoverProperty="<a target='newPage' href='".concat(properties[i].URL_LINK.toString().replace("&amp;","&")).concat("' style='background:white;font-size:8pt;font-family:Arial;font-weight:normal;color:black;text-decoration:none;' onmouseover='document.getElementById(\"singleProperty\").innerHTML=\"").concat(singlePropertyHTML).concat("\";'>&nbsp;&pound;").concat((Math.round(properties[i].STARTING_PRICE/1000)).toString()).concat("k</a>");html=html.concat("<tr valign='top' style='background:white;'><td style='font-size:8pt;font-family:Arial;font-weight:normal;color:black;'>").concat(onHoverProperty).concat("</td></tr>")}html+="</table></div>";content=html}}}return content}function WYSearchHelpControl(){}WYSearchHelpControl.prototype=new GControl();WYSearchHelpControl.prototype.initialize=function(C){var A=document.createElement("div");var B=document.createElement("div");B.innerHTML='<div style=\'background-color:#6B633D;color:white;padding: 1px 4px 1px 4px;vertical-align:top;text-align:left;font-family:Arial;font-size:7pt;font-weight:normal;font-style:italic;\'>either enter an address e.g. "high street, belfast" OR type of item e.g. "primary school", "pizza" to see matching items in the local area.</div>';A.appendChild(B);C.getContainer().appendChild(A);return A};WYSearchHelpControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(70,7))};function showTab(B){map.closeExtInfoWindow();var E=document.getElementById("tabOne");var D=document.getElementById("tabTwo");var C=document.getElementById("tabOneDiv");var A=document.getElementById("tabTwoDiv");if(B=="one"){E.style.cssText="text-align:center;cursor:pointer;background-color:#6B633D;color:white;padding:2px 24px 2px 24px;width:80px;";D.style.cssText="text-align:center;cursor:pointer;background-color:#978C59;color:#dddddd;padding:2px 24px 2px 24px;width:80px;";A.style.visibility="hidden";C.style.visibility="visible"}else{D.style.cssText="text-align:center;cursor:pointer;background-color:#6B633D;color:white;padding:2px 24px 2px 24px;width:80px;";E.style.cssText="text-align:center;cursor:pointer;background-color:#978C59;color:#dddddd;padding:2px 24px 2px 24px;width:80px;";C.style.visibility="hidden";A.style.visibility="visible";ListView.moveTo(1)}}var ListView={listViewDivName:"listView",listViewSelectorDivName:"listViewSelector",numberPerPage:10,numberPagesPerScreen:100,currentStartRecord:-1,currentSearchCriteria:"",currentListViewCount:0,moveTo:function(D){var F=getSliderValue(valueslidermin);var C=getSliderValue(valueslidermax);var E=bedslidermin.getValue()/20;var B="sP="+F+"&eP="+C+"&lt="+wyL.lat()+"&lg="+wyL.lng()+"&m="+wyJ+"&beds="+bedslidermin.getValue()/20;if(this.currentStartRecord!=D||this.currentSearchCriteria!=B){var A=document.getElementById(this.listViewDivName);removeAllChildren(A);A.innerHTML="loading...";wyAE={success:HTMLAjaxObject.handleSuccess,failure:HTMLAjaxObject.handleFailure,variable:"ListView.currentListViewCount",htmlPage:"wyDB13.php?function=count&sI="+ListView.currentStartRecord+"&eI="+(ListView.currentStartRecord+ListView.numberPerPage-1)+"&sP="+F+"&eP="+C+"&lt="+wyL.lat()+"&lg="+wyL.lng()+"&m="+wyJ+"&b="+E};HTMLAjaxObject.startRequest(wyAE);this.currentStartRecord=D;this.currentSearchCriteria=B;this.getRecords(D)}},getRecords:function(B){var D=getSliderValue(valueslidermin);var A=getSliderValue(valueslidermax);var C=bedslidermin.getValue()/20;wyAE={success:function(E){ListView.display(E.responseText)},failure:HTMLAjaxObject2.handleFailure,htmlPage:"wyDB13.php?function=getList&full=true&sI="+ListView.currentStartRecord+"&eI="+(ListView.currentStartRecord+ListView.numberPerPage-1)+"&sP="+D+"&eP="+A+"&lt="+wyL.lat()+"&lg="+wyL.lng()+"&m="+wyJ+"&b="+C};HTMLAjaxObject2.startRequest(wyAE)},display:function(json){eval("var records = new Array("+json+")");var listViewDiv=document.getElementById(this.listViewDivName);ListView.displaySelector(this.currentStartRecord);removeAllChildren(listViewDiv);var newTable=document.createElement("TABLE");newTable.style.cssText="padding:0px 0px 0px 0px;margin:0px 0px 0px 0px;";var newTBody=document.createElement("TBODY");var newTR=document.createElement("TR");for(var i=0;i<records.length;i++){if(i>0&&(i%5)==0){newTBody.appendChild(newTR);newTR=document.createElement("TR")}var newDiv=document.createElement("DIV");var newTD=document.createElement("TD");newTD.style.cssText="vertical-align:top;background-color:#978C59;";newDiv.innerHTML=buildListViewWindowContent(records[i]);var css="margin:2px 2px 2px 2px;background-color:#978C59;border:0px solid white;width:207px;";if(bedslidermin.getValue()/20>records[i].BEDROOMS){css+="opacity: .3;filter: alpha(opacity=30);"}newDiv.style.cssText=css;newTD.appendChild(newDiv);newTR.appendChild(newTD)}newTBody.appendChild(newTR);newTable.appendChild(newTBody);listViewDiv.appendChild(newTable)},displaySelector:function(I){var H=this.currentListViewCount;var B=document.getElementById(this.listViewSelectorDivName);var F=(Math.floor(this.currentStartRecord/this.numberPagesPerScreen)*this.numberPagesPerScreen);var J=(Math.ceil(this.currentStartRecord/this.numberPagesPerScreen)*this.numberPagesPerScreen);if(J>H){J=H}var C=((Math.floor(this.currentStartRecord/this.numberPagesPerScreen)*this.numberPagesPerScreen)>0)?"&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:ListView.moveTo("+(F-this.numberPagesPerScreen+1)+");'>&nbsp;&nbsp;&lt;&nbsp;&lt;&nbsp;prev&nbsp;&nbsp;</a>":"";var E=((Math.ceil(this.currentStartRecord/this.numberPagesPerScreen)*this.numberPagesPerScreen)<H)?"&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:ListView.moveTo("+(J+1)+");'>&nbsp;&nbsp;next&nbsp;&gt;&nbsp;&gt;&nbsp;&nbsp;</a>":"";var A=C;var D;for(D=F;D<J;D+=this.numberPerPage){var G=(I>=(D+1)&&I<=(D+this.numberPerPage))?"style='background-color:#DA8B00;'":"";if((D+this.numberPerPage)>J){A+="&nbsp;&nbsp;<a "+G+" href='javascript:ListView.moveTo("+(D+1)+");'>&nbsp;&nbsp;"+(D+1)+"-"+J+"&nbsp;&nbsp;</a>"}else{A+="&nbsp;&nbsp;&nbsp;&nbsp;<a "+G+" href='javascript:ListView.moveTo("+(D+1)+");'>&nbsp;&nbsp;"+(D+1)+"-"+(D+this.numberPerPage)+"&nbsp;&nbsp;</a>"}}A+=E+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ "+H+" properties matching criteria in this area ]";B.innerHTML=A}};function removeAllChildren(A){if(A.hasChildNodes()){while(A.childNodes.length>=1){A.removeChild(A.firstChild)}}}function ExtInfoWindow(A,B,C,D){this.html_=C;this.marker_=A;this.infoWindowId_=B;this.options_=D==null?{}:D;this.ajaxUrl_=this.options_.ajaxUrl==null?null:this.options_.ajaxUrl;this.callback_=this.options_.ajaxCallback==null?null:this.options_.ajaxCallback;this.borderSize_=this.options_.beakOffset==null?0:this.options_.beakOffset;this.paddingX_=this.options_.paddingX==null?0+this.borderSize_:this.options_.paddingX+this.borderSize_;this.paddingY_=this.options_.paddingY==null?0+this.borderSize_:this.options_.paddingY+this.borderSize_;this.map_=null;this.container_=document.createElement("div");this.container_.style.position="relative";this.container_.style.display="none";this.contentDiv_=document.createElement("div");this.contentDiv_.id=this.infoWindowId_+"_contents";this.contentDiv_.innerHTML=this.html_;this.contentDiv_.style.display="block";this.contentDiv_.style.visibility="hidden";this.wrapperDiv_=document.createElement("div")}ExtInfoWindow.prototype=new GOverlay();ExtInfoWindow.prototype.initialize=function(map){this.map_=map;this.defaultStyles={containerWidth:this.map_.getSize().width/2,containerHeight:this.map_.getSize().height/2,borderSize:1};this.wrapperParts={tl:{t:0,l:0,w:0,h:0,domElement:null},t:{t:0,l:0,w:0,h:0,domElement:null},tr:{t:0,l:0,w:0,h:0,domElement:null},l:{t:0,l:0,w:0,h:0,domElement:null},r:{t:0,l:0,w:0,h:0,domElement:null},bl:{t:0,l:0,w:0,h:0,domElement:null},b:{t:0,l:0,w:0,h:0,domElement:null},br:{t:0,l:0,w:0,h:0,domElement:null},beak:{t:0,l:0,w:0,h:0,domElement:null},close:{t:0,l:0,w:0,h:0,domElement:null}};for(var i in this.wrapperParts){var tempElement=document.createElement("div");tempElement.id=this.infoWindowId_+"_"+i;tempElement.style.visibility="hidden";document.body.appendChild(tempElement);tempElement=document.getElementById(this.infoWindowId_+"_"+i);var tempWrapperPart=eval("this.wrapperParts."+i);tempWrapperPart.w=parseInt(this.getStyle_(tempElement,"width"));tempWrapperPart.h=parseInt(this.getStyle_(tempElement,"height"));document.body.removeChild(tempElement)}for(var i in this.wrapperParts){if(i=="close"){this.wrapperDiv_.appendChild(this.contentDiv_)}var wrapperPartsDiv=null;if(this.wrapperParts[i].domElement==null){wrapperPartsDiv=document.createElement("div");this.wrapperDiv_.appendChild(wrapperPartsDiv)}else{wrapperPartsDiv=this.wrapperParts[i].domElement}wrapperPartsDiv.id=this.infoWindowId_+"_"+i;wrapperPartsDiv.style.position="absolute";wrapperPartsDiv.style.width=this.wrapperParts[i].w+"px";wrapperPartsDiv.style.height=this.wrapperParts[i].h+"px";wrapperPartsDiv.style.top=this.wrapperParts[i].t+"px";wrapperPartsDiv.style.left=this.wrapperParts[i].l+"px";this.wrapperParts[i].domElement=wrapperPartsDiv}this.map_.getPane(G_MAP_FLOAT_PANE).appendChild(this.container_);this.container_.id=this.infoWindowId_;var containerWidth=this.getStyle_(document.getElementById(this.infoWindowId_),"width");var containerHeight=this.getStyle_(document.getElementById(this.infoWindowId_),"height");this.container_.style.width=(containerWidth==null?this.defaultStyles.containerWidth:containerWidth);this.container_.style.height=(containerHeight==null?this.defaultStyles.containerHeight:containerHeight);this.map_.getContainer().appendChild(this.contentDiv_);this.contentWidth=this.getDimensions_(this.container_).width;this.contentDiv_.style.width=this.contentWidth+"px";this.contentDiv_.style.position="absolute";this.container_.appendChild(this.wrapperDiv_);if(navigator.userAgent.indexOf("Opera")!=-1){this.wrapperParts.beak.w=28;this.wrapperParts.beak.h=38}GEvent.bindDom(this.container_,"mousedown",this,this.onClick_);GEvent.bindDom(this.container_,"mousemove",this,this.onMouseMove_);GEvent.trigger(this.map_,"extinfowindowopen");if(this.ajaxUrl_!=null){this.ajaxRequest_(this.ajaxUrl_)}};ExtInfoWindow.prototype.onClick_=function(A){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false}else{A.preventDefault();A.stopPropagation()}};ExtInfoWindow.prototype.onMouseMove_=function(A){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false}else{A.preventDefault();A.stopPropagation()}};ExtInfoWindow.prototype.remove=function(){if(this.map_.getExtInfoWindow()!=null){GEvent.trigger(this.map_,"extinfowindowbeforeclose");GEvent.clearInstanceListeners(this.container_);if(this.container_.outerHTML){this.container_.outerHTML=""}if(this.container_.parentNode){this.container_.parentNode.removeChild(this.container_)}this.container_=null;GEvent.trigger(this.map_,"extinfowindowclose");this.map_.setExtInfoWindow_(null)}};ExtInfoWindow.prototype.copy=function(){return new ExtInfoWindow(this.marker_,this.infoWindowId_,this.html_,this.options_)};ExtInfoWindow.prototype.redraw=function(C){if(!C||this.container_==null){return }var M=this.contentDiv_.offsetHeight;this.contentDiv_.style.height=M+"px";if(navigator.userAgent.indexOf("Opera")!=-1){var J=this.contentDiv_.offsetWidth;this.contentDiv_.style.width=311+"px"}this.contentDiv_.style.left=this.wrapperParts.l.w+"px";this.contentDiv_.style.top=this.wrapperParts.tl.h+"px";this.wrapperParts.tl.t=0;this.wrapperParts.tl.l=0;this.wrapperParts.t.l=this.wrapperParts.tl.w;this.wrapperParts.t.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.tl.w-this.wrapperParts.tr.w;this.wrapperParts.t.h=this.wrapperParts.tl.h;this.wrapperParts.tr.l=this.wrapperParts.t.w+this.wrapperParts.tl.w;this.wrapperParts.l.t=this.wrapperParts.tl.h;this.wrapperParts.l.h=M;this.wrapperParts.r.l=this.contentWidth+this.wrapperParts.l.w;this.wrapperParts.r.t=this.wrapperParts.tr.h;this.wrapperParts.r.h=M;this.wrapperParts.bl.t=M+this.wrapperParts.tl.h;this.wrapperParts.b.l=this.wrapperParts.bl.w;this.wrapperParts.b.t=M+this.wrapperParts.tl.h;this.wrapperParts.b.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.bl.w-this.wrapperParts.br.w;this.wrapperParts.b.h=this.wrapperParts.bl.h;this.wrapperParts.br.l=this.wrapperParts.b.w+this.wrapperParts.bl.w;this.wrapperParts.br.t=M+this.wrapperParts.tr.h;this.wrapperParts.close.l=this.wrapperParts.tr.l+this.wrapperParts.tr.w-this.wrapperParts.close.w-this.borderSize_;this.wrapperParts.close.t=this.borderSize_;this.wrapperParts.beak.l=this.borderSize_-this.wrapperParts.beak.w+28-(this.wrapperParts.beak.w/2);this.wrapperParts.beak.t=this.wrapperParts.bl.t/2-(this.wrapperParts.bl.h/2)+this.borderSize_;var D=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.container_.style.position="absolute";var A=this.marker_.getIcon();var I=(D.x+17-A.iconAnchor.x+A.infoWindowAnchor.x);var H=(D.y-this.wrapperParts.bl.h-(M/2)-10-this.wrapperParts.tl.h-A.iconAnchor.y+A.infoWindowAnchor.y+this.borderSize_);var N=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());var B=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());var K=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var Q=H;var T=(H+this.wrapperParts.bl.h+(M)+10+this.wrapperParts.tl.h+(this.borderSize_*2));if(Q<N.y){panY=N.y-Q;H+=panY;this.wrapperParts.beak.t+=(-1*panY)}else{if(T>=B.y){panY=-(T-B.y);H+=panY;this.wrapperParts.beak.t+=(-1*panY)}}var R=I+this.contentWidth+this.wrapperParts.bl.w+this.wrapperParts.tl.w+this.paddingX_;var L=0;if(R>N.x){I=(D.x-(this.contentWidth)-this.wrapperParts.tl.w-this.wrapperParts.tl.w-this.paddingX_-13-A.iconAnchor.x+A.infoWindowAnchor.x);this.wrapperParts.beak.l=this.contentWidth+this.wrapperParts.bl.w+this.wrapperParts.tl.w+this.paddingX_-(this.wrapperParts.beak.w/2)-5;L=this.wrapperParts.beak.w/2}this.container_.style.left=I+"px";for(var O in this.wrapperParts){if(O=="close"){this.wrapperDiv_.insertBefore(this.contentDiv_,this.wrapperParts[O].domElement)}var F=null;if(this.wrapperParts[O].domElement==null){F=document.createElement("div");this.wrapperDiv_.appendChild(F)}else{F=this.wrapperParts[O].domElement}F.id=this.infoWindowId_+"_"+O;F.style.position="absolute";F.style.width=this.wrapperParts[O].w+"px";F.style.height=this.wrapperParts[O].h+"px";F.style.top=this.wrapperParts[O].t+"px";F.style.left=this.wrapperParts[O].l+"px";this.wrapperParts[O].domElement=F}var P=document.createElement("div");this.wrapperDiv_.appendChild(P);var G=4;P.style.backgroundColor="black";P.style.opacity=0.01;P.style.filter="alpha(opacity=1)";P.style.position="absolute";P.style.width=(this.wrapperParts.beak.w/2)+"px";P.style.height=(this.wrapperParts.beak.h+(G*2)+18)+"px";P.style.top=(this.wrapperParts.beak.t-(G*2)-30)+"px";P.style.left=(this.wrapperParts.beak.l+L)+"px";P.style.zIndex=100;var S=this.marker_;var E=this.map_;GEvent.addDomListener(this.wrapperParts.close.domElement,"click",function(){E.closeExtInfoWindow()});this.container_.style.top=H+"px";this.container_.style.display="block";this.contentDiv_.style.visibility="visible";};ExtInfoWindow.prototype.resize=function(){var A=this.contentDiv_.cloneNode(true);A.id=this.infoWindowId_+"_tempContents";A.style.visibility="hidden";A.style.height="auto";document.body.appendChild(A);A=document.getElementById(this.infoWindowId_+"_tempContents");var E=A.offsetHeight;document.body.removeChild(A);if (E < 320) E = 320;this.contentDiv_.style.height=E+"px";var B=this.contentDiv_.offsetWidth;var D=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var C=this.wrapperParts.t.domElement.offsetHeight+this.wrapperParts.l.domElement.offsetHeight+this.wrapperParts.b.domElement.offsetHeight;var G=this.wrapperParts.t.domElement.offsetTop;this.wrapperParts.l.domElement.style.height=E+"px";this.wrapperParts.r.domElement.style.height=E+"px";var F=this.wrapperParts.b.domElement.offsetTop-E;this.wrapperParts.l.domElement.style.top=F+"px";this.wrapperParts.r.domElement.style.top=F+"px";this.contentDiv_.style.top=F+"px";windowTHeight=parseInt(this.wrapperParts.t.domElement.style.height);F-=windowTHeight;this.wrapperParts.close.domElement.style.top=F+this.borderSize_+"px";this.wrapperParts.tl.domElement.style.top=F+"px";this.wrapperParts.t.domElement.style.top=F+"px";this.wrapperParts.tr.domElement.style.top=F+"px"};ExtInfoWindow.prototype.repositionMap_=function(){var J=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());var A=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());var H=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var P=0;var N=0;var L=this.paddingX_;var K=this.paddingY_;var D=this.marker_.getIcon().infoWindowAnchor;var C=this.marker_.getIcon().iconAnchor;var F=this.wrapperParts.t.domElement;var I=this.wrapperParts.l.domElement;var Q=this.wrapperParts.b.domElement;var G=this.wrapperParts.r.domElement;var B=this.wrapperParts.beak.domElement;var M=H.y-((-D.y+10+this.borderSize_+C.y+this.getDimensions_(Q).height+(this.getDimensions_(I).height)+(this.getDimensions_(F).height)+this.paddingY_)/2);if(M<J.y){N=J.y-M}else{var R=H.y+((-D.y+10+this.borderSize_+C.y+this.getDimensions_(Q).height+(this.getDimensions_(I).height)+(this.getDimensions_(F).height)+this.paddingY_)/2);if(R>=A.y){N=-(R-A.y)}}var O=Math.round(H.x+this.getDimensions_(this.container_).width+20+this.getDimensions_(G).width+this.paddingX_+D.x-C.x);if(O>J.x){P=-(O-J.x)}else{var E=-(Math.round((this.getDimensions_(this.container_).width/2-this.marker_.getIcon().iconSize.width/2)+this.getDimensions_(I).width+this.borderSize_+this.paddingX_)-H.x-D.x+C.x);if(E<A.x){P=A.x-E}}if(P!=0||N!=0&&this.map_.getExtInfoWindow()!=null){this.map_.panBy(new GSize(P,N))}};ExtInfoWindow.prototype.ajaxRequest_=function(A){var C=this.map_;var B=this.callback_;GDownloadUrl(A,function(E,D){var F=document.getElementById(C.getExtInfoWindow().infoWindowId_+"_contents");if(E==null||D==-1){F.innerHTML='<span class="error">ERROR: The Ajax request failed to get HTML content from "'+A+'"</span>'}else{F.innerHTML=E}if(B!=null){B()}C.getExtInfoWindow().resize();GEvent.trigger(C,"extinfowindowupdate")})};ExtInfoWindow.prototype.getDimensions_=function(C){var G=this.getStyle_(C,"display");if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight}}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";B.position="absolute";B.display="block";var H=C.clientWidth;var E=C.clientHeight;B.display=A;B.position=D;B.visibility=F;return{width:H,height:E}};ExtInfoWindow.prototype.getStyle_=function(B,C){var E=false;C=this.camelize_(C);var D=B.style[C];if(!D){if(document.defaultView&&document.defaultView.getComputedStyle){var A=document.defaultView.getComputedStyle(B,null);D=A?A[C]:null}else{if(B.currentStyle){D=B.currentStyle[C]}}}if((D=="auto")&&(C=="width"||C=="height")&&(this.getStyle_(B,"display")!="none")){if(C=="width"){D=B.offsetWidth}else{D=B.offsetHeight}}return(D=="auto")?null:D};ExtInfoWindow.prototype.camelize_=function(C){var E=C.split("-"),A=E.length;if(A==1){return E[0]}var D=C.charAt(0)=="-"?E[0].charAt(0).toUpperCase()+E[0].substring(1):E[0];for(var B=1;B<A;B++){D+=E[B].charAt(0).toUpperCase()+E[B].substring(1)}return D};GMap.prototype.ExtInfoWindowInstance_=null;GMap.prototype.ClickListener_=null;GMap.prototype.InfoWindowListener_=null;GMarker.prototype.openExtInfoWindow=function(B,D,A,C){if(B==null){throw"Error in GMarker.openExtInfoWindow: map cannot be null";return false}if(D==null||D==""){throw"Error in GMarker.openExtInfoWindow: must specify a cssId";return false}B.closeInfoWindow();if(B.getExtInfoWindow()!=null){B.closeExtInfoWindow()}if(B.getExtInfoWindow()==null){B.setExtInfoWindow_(new ExtInfoWindow(this,D,A,C));if(B.ClickListener_==null){B.ClickListener_=GEvent.addListener(B,"click",function(E){if(!E&&B.getExtInfoWindow()!=null){B.closeExtInfoWindow()}})}if(B.InfoWindowListener_==null){B.InfoWindowListener_=GEvent.addListener(B,"infowindowopen",function(E){if(B.getExtInfoWindow()!=null){B.closeExtInfoWindow()}})}B.addOverlay(B.getExtInfoWindow());B.getExtInfoWindow().resize()}};GMarker.prototype.closeExtInfoWindow=function(A){A.closeExtInfoWindow()};GMap2.prototype.getExtInfoWindow=function(){return this.ExtInfoWindowInstance_};GMap2.prototype.setExtInfoWindow_=function(A){this.ExtInfoWindowInstance_=A};GMap2.prototype.closeExtInfoWindow=function(){if(this.ExtInfoWindowInstance_){this.ExtInfoWindowInstance_.remove()}};function LabeledMarker(B,A){this.latlng_=B;this.opts_=A;this.labelText_=A.labelText||"";this.labelClass_=A.labelClass||"LabeledMarker_markerLabel";this.labelOffset_=A.labelOffset||new GSize(0,0);this.clickable_=A.clickable||true;this.title_=A.title||"";this.labelVisibility_=true;if(A.draggable){A.draggable=false}GMarker.apply(this,arguments)}LabeledMarker.prototype=new GMarker(new GLatLng(0,0));LabeledMarker.prototype.initialize=function(D){GMarker.prototype.initialize.apply(this,arguments);this.map_=D;this.div_=document.createElement("div");this.div_.className=this.labelClass_;this.div_.innerHTML=this.labelText_;this.div_.style.position="absolute";this.div_.style.cursor="pointer";this.div_.title=this.title_;D.getPane(G_MAP_MARKER_PANE).appendChild(this.div_);if(this.clickable_){function A(G,F){return function(){GEvent.trigger(G,F)}}var E=["click","dblclick","mousedown","mouseup","mouseover","mouseout"];for(var C=0;C<E.length;C++){var B=E[C];GEvent.addDomListener(this.div_,B,A(this,B))}}GEvent.bindDom(this.div_,"mousemove",this,this.onMouseMove_)};LabeledMarker.prototype.onMouseMove_=function(A){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false}else{A.preventDefault();A.stopPropagation()}};LabeledMarker.prototype.redraw=function(A){GMarker.prototype.redraw.apply(this,arguments);var B=this.map_.fromLatLngToDivPixel(this.latlng_);var C=GOverlay.getZIndex(this.latlng_.lat());this.div_.style.left=(B.x+this.labelOffset_.width)+"px";this.div_.style.top=(B.y+this.labelOffset_.height)+"px";this.div_.style.zIndex=C};LabeledMarker.prototype.remove=function(){if(!this.div_){return }GEvent.clearInstanceListeners(this.div_);if(this.div_.outerHTML){this.div_.outerHTML=""}if(this.div_.parentNode){this.div_.parentNode.removeChild(this.div_)}this.div_=null;GMarker.prototype.remove.apply(this,arguments)};LabeledMarker.prototype.copy=function(){return new LabeledMarker(this.latlng_,this.opt_opts_)};LabeledMarker.prototype.show=function(){GMarker.prototype.show.apply(this,arguments);if(this.labelVisibility_){this.showLabel()}else{this.hideLabel()}};LabeledMarker.prototype.hide=function(){GMarker.prototype.hide.apply(this,arguments);this.hideLabel()};LabeledMarker.prototype.setLabelVisibility=function(A){this.labelVisibility_=A;if(!this.isHidden()){if(this.labelVisibility_){this.showLabel()}else{this.hideLabel()}}};LabeledMarker.prototype.getLabelVisibility=function(){return this.labelVisibility_};LabeledMarker.prototype.hideLabel=function(){this.div_.style.visibility="hidden"};LabeledMarker.prototype.showLabel=function(){this.div_.style.visibility="visible"};getLabelForAmount=function(H,C,G,E,L){var M="<div style='position:absolute;width:16px;height:27px;z-index:1000;'></div>";var J=""+Math.round(H/1000);var B="";if(E>4){B=".<br/>.<br/>.<br/>.<br/>+"}else{for(var F=0;F<E;F++){B+="a<br/>"}}B="<div style='z-index:1;' class='bedsText'>"+E+"</div>";if((J/1000)<1){M+="<div class='labelholder' style='background:#"+getLabelColorForAmount(H,C,G,L)+";'>"+B+"<div class='label'>";var I=0;for(var F=0;F<J.length;F++){M+="<div style='position:absolute;top:+"+I+"px;height:5px;width:10px;background-image: url(images/"+J.charAt(F)+".gif);'/>";I=5}M+="<div style='position:absolute;top:+"+I+"px;height:5px;width:10px;background-image: url(images/k.gif);'/></div></div>"}else{var D=""+Math.floor(J/1000);var K=J-(D*1000)+"";var A=3;M+="<div class='labelholder' style='background:#"+getLabelColorForAmount(H,C,G,L)+";'>"+B+"<div class='label'>";var I=0;for(var F=0;F<D.length;F++){M+="<div style='position:absolute;top:+"+I+"px;height:5px;width:10px;background-image: url(images/"+D.charAt(F)+".gif);'/>";I=5;A--}M+="<div style='position:absolute;top:+3px;height:5px;width:10px;background-image: url(images/dot.gif);'/>";for(var F=0;F<K.length;F++){if(A>0){M+="<div style='position:absolute;top:+"+I+"px;height:5px;width:10px;background-image: url(images/"+K.charAt(F)+".gif);'/>";A--}}M+="<div style='position:absolute;top:+"+I+"px;height:5px;width:10px;background-image: url(images/m.gif);'/></div></div>"}return M};getLabelColorForAmount=function(F,A,E,J){if(J){return"ECA8F0"}var G=Math.floor(F/1000);A=Math.floor(A/1000);E=Math.floor(E/1000);if(E>1000){E=1000}var C=5;var D=255;var H=5;var B=A;var K=A+Math.floor((E-A)/2);var I=E;if(G>B&&G<=K){C=5+Math.floor((255-5)*(G/(K)))}else{if(G>K&&G<=I){if((G-K)==0){D=255}else{D=255-Math.floor((255-5)*((G-(K))/(I-K)))}C=255}else{if(G>I){D=5;C=255}}}return RGB2HTML(C,D,H)};RGB2HTML=function(E,D,A){var B=A+256*D+65536*E;var C="0"+B.toString(16);C=C.substr(C.length-6);return C};var AjaxObject={list:null,chunk:null,callback:null,recordsCount:0,currentChunk:0,setupChunkNum:0,currentRecord:0,chunkSize:0,biteSize:0,triggerPoint:0,handleSuccess:function(A){if(AjaxObject.recordsCount>wyA){setSystemMessage("NOTE: restricted to "+wyA+" of "+AjaxObject.recordsCount+" records. Zoom in/adjust criteria to see more.","warning")}else{setSystemMessage(""+AjaxObject.recordsCount+" properties loaded [found within "+Math.round(wyI)+" miles from map centre]")}this.processResult(A)},handleFailure:function(A){setSystemMessage("ERROR:  AjaxObject request failed: ["+A.statusText+"] Please refresh page to continue...","error")},processResult:function(A){AjaxObject.json=A.responseText;if(AjaxObject.json==""||AjaxObject.recordsCount==0){hidePercentLoaded();return }setTimeout("AjaxObject.setupChunk(AjaxObject.setupChunkNum, AjaxObject.json)",0);if(AjaxObject.currentChunk==0){AjaxObject.currentChunk=1;setTimeout("AjaxObject.getValues("+AjaxObject.currentChunk+")",0)}},getChunk:function(A){var C={borderPadding:40,minZoom:0,maxZoom:17,trackMarkers:true};AjaxObject.chunk[A]={visibility:"hide",markerManager:new MarkerManager(map,C)};AjaxObject.chunk[A].startRecord=((AjaxObject.chunkSize*A)-(AjaxObject.chunkSize)+1);AjaxObject.chunk[A].midRecord=((AjaxObject.chunkSize*A)-(AjaxObject.chunkSize))+AjaxObject.triggerPoint;AjaxObject.chunk[A].endRecord=((AjaxObject.chunkSize*A));AjaxObject.chunk[A].loaded=false;var B=AjaxObject.callback.recordsPage;B=stringPushValues(B,new Array(AjaxObject.chunk[A].startRecord,AjaxObject.chunk[A].endRecord));YAHOO.util.Connect.asyncRequest("GET",B,AjaxObject.callback,"")},setupChunk:function(chunkNum,json){if(AjaxObject.chunk[chunkNum].loaded==true){return }AjaxObject.chunk[chunkNum].loaded=true;var a;eval("a = new Array("+json+");");AjaxObject.list=AjaxObject.list.concat(a);if(AjaxObject.chunk[chunkNum].endRecord>AjaxObject.recordsCount){AjaxObject.chunk[chunkNum].endRecord=AjaxObject.recordsCount}AjaxObject.setupChunkNum+=1},getValues:function(C){var D=AjaxObject.recordsCount;if(D>wyA){D=wyA}if(AjaxObject.list.length<(AjaxObject.chunkSize*C)&&AjaxObject.list.length<D){setTimeout("AjaxObject.getValues("+C+")",10)}else{var B=AjaxObject.currentRecord+1;var A=AjaxObject.currentRecord+AjaxObject.biteSize;if(A>AjaxObject.chunk[C].endRecord){A=AjaxObject.chunk[C].endRecord}setTimeout("AjaxObject.callback.afterSuccess("+C+","+B+","+A+")",10);AjaxObject.currentRecord=A;if(AjaxObject.currentRecord>=AjaxObject.chunk[C].midRecord&&AjaxObject.chunk[C].endRecord<D&&!AjaxObject.chunk[C+1]){setTimeout("AjaxObject.getChunk("+(AjaxObject.currentChunk+1)+")",10)}if(A<AjaxObject.chunk[C].endRecord){setTimeout("AjaxObject.getValues("+C+")",10)}else{if(A<D){AjaxObject.currentChunk+=1;setTimeout("AjaxObject.getValues("+AjaxObject.currentChunk+")",10)}else{}}}},getChunkIFromI:function(B){var A=(B%(AjaxObject.chunkSize));var C=Math.floor(B/(AjaxObject.chunkSize))+1;return{i:A,chunk:C}},getIFromChunkI:function(A,B){return((A-1)*chunkSize)+B},startRequest:function(A){this.callback=A;AjaxObject.recordsCount=-1;wyAE={success:HTMLAjaxObject.handleSuccess,failure:HTMLAjaxObject.handleFailure,variable:"AjaxObject.recordsCount",htmlPage:this.callback.countPage};HTMLAjaxObject.startRequest(wyAE);if(AjaxObject.chunk){for(var B=1;B<AjaxObject.chunk.length;B++){AjaxObject.chunk[B].markerManager.clearMarkers()}AjaxObject.chunk=null}AjaxObject.chunk=new Array(0);AjaxObject.xmlD=null;AjaxObject.currentChunk=0;AjaxObject.setupChunkNum=1;AjaxObject.currentRecord=0;AjaxObject.chunkSize=100;AjaxObject.biteSize=25;AjaxObject.triggerPoint=1;setTimeout("AjaxObject.cleanAndStart(0)",10)},cleanAndStart:function(C){if(AjaxObject.list){var B=C;var A=C+AjaxObject.chunkSize;if(A>=AjaxObject.list.length){A=AjaxObject.list.length}for(var B=C;B<A;B++){AjaxObject.list[B].marker.remove();AjaxObject.list[B]=null}if(A==AjaxObject.list.length){AjaxObject.list=new Array();AjaxObject.getChunk(1)}else{setTimeout("AjaxObject.cleanAndStart("+A+")",0)}}else{AjaxObject.list=new Array();AjaxObject.getChunk(1)}}};var HTMLAjaxObject={callback:null,handleSuccess:function(A){HTMLAjaxObject.processResult(A)},handleFailure:function(A){setSystemMessage("ERROR:  HTMLAjaxObject request failed: ["+A.statusText+"] Please refresh page to continue...","error")},processResult:function(o){if(HTMLAjaxObject.callback.div){var html=o.responseText;var el1=new YAHOO.util.Element(HTMLAjaxObject.callback.div);el1.set("innerHTML",html)}else{eval(HTMLAjaxObject.callback.variable+" = o.responseText;")}},startRequest:function(A){this.callback=A;YAHOO.util.Connect.asyncRequest("GET",HTMLAjaxObject.callback.htmlPage,HTMLAjaxObject.callback,"")}};var HTMLAjaxObject2={callback:null,handleSuccess:function(A){HTMLAjaxObject2.processResult(A)},handleFailure:function(A){setSystemMessage("ERROR:  HTMLAjaxObject2 request failed: ["+A.statusText+"] Please refresh page to continue...","error")},processResult:function(o){if(HTMLAjaxObject2.callback.div){var html=o.responseText;var el1=new YAHOO.util.Element(HTMLAjaxObject2.callback.div);el1.set("innerHTML",html)}else{eval(HTMLAjaxObject2.callback.variable+" = o.responseText;")}},startRequest:function(A){this.callback=A;YAHOO.util.Connect.asyncRequest("GET",HTMLAjaxObject2.callback.htmlPage,HTMLAjaxObject2.callback,"")}};function stringPushValues(D,E){var B=D.match(/%\d/g);var C=null;for(var A=0;A<B.length;A++){C=new RegExp("%"+(A+1));D=D.replace(C,E[A])}return D};