//Postcode Anywhere Javascript API //Version 4.0 (SlipStream engine enabled) //Automatically generated on 01/01/2021 11:15:29 from WEB-2-3 //(c) 2001-2021 Postcode Anywhere (Europe) Ltd //Create a control list if necessary if (typeof(_PostcodeAnywhereControlList) == 'undefined') _PostcodeAnywhereControlList = new Array(); // Postcode Anywhere Maps Version 1.3 var MOUSE_MOVE=0,MOUSE_SELECT_RADIAL=1,MOUSE_SELECT_AREA=2;function PostcodeAnywhereMapYE44(a,f){var r=this,g=null,m=true,q=false,s=document,o="undefined",k="string",l="number",j="object",i="boolean",p="div",c="img",d="border:0px none;margin:0px;padding:0px;position:absolute;",e="font:8pt arial;color:#000;",n="2021",h="https://services.postcodeanywhere.co.uk/",b="YE44-XG96-ZR32-EY98";r.Element=a;r.Container=g;r.SurfaceLayer=g;r.TileLayer=g;r.MarkerLayer=g;r.SelectLayer=g;r.RouteLayer=g;r.ShapeLayer=g;r.Properties={X:0,Y:0,Height:0,Width:0,L:0,T:0,R:0,B:0,Bound:{X:0,Y:0,L:0,T:0,R:0,B:0,Elements:{L:0,T:0,R:0,B:0,Distance:10},Tiles:1},Zoom:{Level:0,Supported:[0.5,1,2,5,10,20,50,100,200,500,1000,2000]},Tiles:{X:0,Y:0,Size:200,Actual:0,Renderer:"PCA"}};r.Surface={X:0,Y:0,DX:0,DY:0};r.Selection={X:0,Y:0,DX:0,DY:0,Element:g};r.Mouse={Mode:MOUSE_MOVE,Scroll:q,Down:q,DragMap:q,DragTarget:g,OverMap:q,ElemX:0,ElemY:0,WinX:0,WinY:0,Delta:0,DefaultDrag:g};r.Marker={Height:36,Width:18,L:9,T:31,Red:h+"maps/red-marker.png",Green:h+"maps/green-marker.png",Blue:h+"maps/blue-marker.png",Window:{Image:h+"maps/window.png",Height:320,Width:381,T:5,B:28,L:5,R:9,Close:h+"maps/close.png",Marker:g,Element:g}};r.Shape={Colour:"#0011EE",Weight:2,Opacity:0.2};r.Route={Colour:"#0011EE",Weight:5,Opacity:0.7};r.Movement={Speed:20,Moving:q};r.Markers=[];r.Listeners=[];r.Tiles=[];r.Controls=[];r.Shapes=[];r.Routes=[];r.Destinations=[];r.Browser={IE:!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1),Opera:navigator.userAgent.indexOf("Opera")>-1,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")===-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)};r.Initialise=function(){var J=r.Properties,I=J.Tiles,A=J.Bound.Tiles,y=r.Element,t=r.Surface,z=r.Browser,D="position:absolute;",E="left:0px;top:0px;",B="height:100%;width:100%;",C="z-index:0;",w=s.createElement(p),H=s.createElement(p),x=s.createElement(p),F=s.createElement(p),u=s.createElement(p),v=s.createElement(p),G=s.createElement(p);while(y.childNodes.length>0){y.removeChild(y.childNodes[0])}I.Actual=I.Size*J.Zoom.Level;J.Height=y.offsetHeight;J.Width=y.offsetWidth;I.X=Math.ceil(J.Width/I.Size)+(A*2);I.Y=Math.ceil(J.Height/I.Size)+(A*2);y.style.position="relative";y.style.backgroundColor="#E5E3DF";w.id="container";w.style.cssText=D+E+B+"overflow:hidden;";H.id="surface";H.style.cssText=D+"left:"+t.X+"px;top:"+t.Y+"px;";x.id="tilelayer";x.style.cssText=D+C+E;v.id="routelayer";v.style.cssText=D+C+E;u.id="shapelayer";u.style.cssText=D+C+E;F.id="markerlayer";F.style.cssText=D+C+E;G.id="selectlayer";G.style.cssText=D+C+E;H.appendChild(x);H.appendChild(u);H.appendChild(v);H.appendChild(F);w.appendChild(H);w.appendChild(G);y.appendChild(w);if(window.addEventListener){y.addEventListener("mousedown",r.MouseDown,q);y.addEventListener("mouseover",r.MouseOver,q);y.addEventListener("mouseout",r.MouseOut,q);y.addEventListener("click",r.MouseClick,q);y.addEventListener("dblclick",r.MouseDblClick,q);s.addEventListener("mousemove",r.MouseMove,q);s.addEventListener("mouseup",r.MouseUp,q);window.addEventListener("resize",r.Resize,q);if(z.Gecko){y.addEventListener("DOMMouseScroll",r.MouseScroll,q)}if(z.WebKit){y.addEventListener("mousewheel",r.MouseScroll,q)}}else{y.attachEvent("onmousedown",r.MouseDown);y.attachEvent("onmouseover",r.MouseOver);y.attachEvent("onmouseout",r.MouseOut);y.attachEvent("onclick",r.MouseClick);y.attachEvent("ondblclick",r.MouseDblClick);s.attachEvent("onmousemove",r.MouseMove);s.attachEvent("onmouseup",r.MouseUp);window.attachEvent("onresize",r.Resize);y.attachEvent("onmousewheel",r.MouseScroll)}r.Container=w;r.SurfaceLayer=H;r.TileLayer=x;r.ShapeLayer=u;r.MarkerLayer=F;r.RouteLayer=v;r.SelectLayer=G;if(z.IE){s.namespaces.add("v","urn:schemas-microsoft-com:vml");s.createStyleSheet().addRule("v\\:*","behavior:url(#default#VML)")}};r.LoadTile=function(u,C){var A=s.createElement(c),v=r.Properties,z=v.Tiles,w=v.Zoom.Level,t=r.Browser,B=d;A.src=h+"maps/transparent.png";if(z.Renderer=="MASTERMAP"){A.src=h+"addresslayer2/maps/retrievetile/v1.10/image.ws?&key="+b+"&topleft="+u+","+C+"&scale="+w}else{A.src=h+"teleatlas/maps/retrievetile/v1.10/image.ws?style="+z.Renderer+"&key="+b+"&topleft="+u+","+C+"&scale="+w}B+="height:"+z.Size+"px;";B+="width:"+z.Size+"px;";B+="left:"+((u-v.X)/w)+"px;";B+="top:"+((v.Y-C)/w)+"px;";if(t.WebKit){B+="-webkit-user-select: none;"}if(t.Gecko){B+="-moz-user-select: none;"}A.style.cssText=B;return A};r.LoadMarker=function(D,C,H){var F=s.createElement(c),E=r.Marker,G=r.Properties,A=G.Zoom.Level,v=r.Browser,B=d,w=E.Height,t=E.Width,u=E.L,z=E.T;F.src=E.Red;if(typeof(H)==j){if(typeof(H.Colour)==k){F.src=h+"maps/"+H.Colour+"-marker.png"}if(typeof(H.Image)==k){F.src=H.Image}if(typeof(H.Name)==k){F.alt=H.Name;F.title=H.Name}if(typeof(H.Height)==l){w=H.Height;z=w/2}if(typeof(H.Width)==l){t=H.Width;u=t/2}if(typeof(H.Top)==l){z=H.Top}if(typeof(H.Left)==l){u=H.Left}}B+="height:"+w+"px;";B+="width:"+t+"px;";B+="left:"+(((D-G.X)/A)-u)+"px;";B+="top:"+(((G.Y-C)/A)-z)+"px;";B+="z-index:"+Math.round((G.Y-C)+(G.Tiles.Actual*G.Bound.Elements.Distance))+";";B+="cursor:pointer;";if(v.WebKit){B+="-webkit-user-select: none;"}if(v.Gecko){B+="-moz-user-select: none;"}F.style.cssText=B;if(r.Browser.IE){r.ReRenderPNG(F)}F.onclick=function(){r.FireEvent(this,"click")};return F};r.LoadGraphic=function(G,B,y,t,z){var H=r.Properties,D=r.Properties.Zoom.Level,v=G[0].X,F=G[0].Y,I=G[0].X,A=G[0].Y,J=g;for(var u in G){if(G[u].X>I){I=G[u].X}if(G[u].YA){A=G[u].Y}}I+=(5*D);F-=(5*D);v-=(5*D);A+=(5*D);if(r.Browser.IE){var E="m"+Math.round((G[0].X-H.X)/D)+" "+Math.round((H.Y-G[0].Y)/D)+" l";for(var u=1;u0){x.removeChild(x.childNodes[0])}w.src=h+"maps/transparent.png";x.appendChild(w);for(var u=0;u0){u.removeChild(u.childNodes[0])}for(var t in x){if(x[t].X>w.L&&x[t].Xw.B&&x[t].Y0){t.removeChild(t.childNodes[0])}r.CloseInfoWindow()};r.SetMarkerInfo=function(u,y,w,t,v){var x=u.Info;x.Content=y;x.Height=t;x.Width=w;x.Options=v};r.ShowMarkerInfo=function(t){r.Marker.Window.Marker=t;r.DrawInfoWindow()};r.DrawInfoWindow=function(){if(r.Marker.Window.Marker&&r.Marker.Window.Marker.Image){var E=s.createElement(p),C=s.createElement(p),u=s.createElement(c),D=[],y=[],K=r.Properties,J=K.Zoom.Level,x=r.Marker,M=x.Window.Marker,H=M.Info,P=H.Height,A=H.Width,O=x.Window,G=P+O.T+O.B,B=A+O.L+O.R,t=G/2,I=B/2,z="position:absolute;",w="height:"+t+"px;width:"+I+"px;overflow:hidden;",L=Math.round((K.Y-M.Y)+(K.Tiles.Actual*K.Bound.Elements.Distance)),v=m,F=m,Q=0;r.RemoveInfoWindow();if(typeof(H.Options)==j){if(typeof(H.Options.Frame)==i){v=H.Options.Frame}if(typeof(H.Options.Button)==i){F=H.Options.Button}if(typeof(H.Options.Padding)==l){Q=H.Options.Padding}}if(v){for(var N=0;N<4;N++){D[N]=s.createElement(p);E.appendChild(D[N])}for(var N=0;N<4;N++){y[N]=s.createElement(c);y[N].src=O.Image;D[N].appendChild(y[N])}D[0].style.cssText=z+w+"top:0px;left:0px;";y[0].style.cssText=z+"top:0px;left:0px;";D[1].style.cssText=z+w+"top:0px;left:"+I+"px;";y[1].style.cssText=z+"top:0px;left:"+-(O.Width-I)+"px;";D[2].style.cssText=z+w+"top:"+t+"px;left:0px;";y[2].style.cssText=z+"top:"+-(O.Height-t)+"px;left:0px;";D[3].style.cssText=z+w+"top:"+t+"px;left:"+I+"px;";y[3].style.cssText=z+"top:"+-(O.Height-t)+"px;left:"+-(O.Width-I)+"px;";if(r.Browser.IE){for(var N=0;N<4;N++){r.ReRenderPNG(y[N])}}}if(F){u.src=O.Close;u.onclick=r.CloseInfoWindow;u.style.cssText=z+"top:"+(O.T+2+Q)+"px;left:"+(B-O.R-15-Q)+"px;z-index:"+L+";cursor:pointer;";E.appendChild(u);if(r.Browser.IE){r.ReRenderPNG(u)}}E.style.cssText=z+"top:"+(((K.Y-M.Y)/J)-(G-3))+"px;left:"+(((M.X-K.X)/J)-(B-4))+"px;z-index:"+(L-1)+";";C.style.cssText=z+"top:5px;left:6px;height:"+P+"px;width:"+A+"px;overflow:visible;";E.appendChild(C);C.innerHTML=H.Content;r.MarkerLayer.appendChild(E);O.Element=E}};r.RemoveInfoWindow=function(){var t=r.MarkerLayer,v=r.Marker.Window;if(v.Element){for(var u in t.childNodes){if(t.childNodes[u]==v.Element){t.removeChild(v.Element)}}}};r.CloseInfoWindow=function(){r.Marker.Window.Marker=g;r.RemoveInfoWindow()};r.ParseShape=function(z,y,B,v){var u=[],x=v.Colour,A=v.Weight,w=v.Opacity;if(typeof(B)==j){if(typeof(B.Weight)==l){A=B.Weight}if(typeof(B.Colour)==k){x=B.Colour}if(typeof(B.Opacity)==l){w=B.Opacity}}for(var t in z){u.push({X:z[t][0],Y:z[t][1]})}return{Points:u,Solid:y,Weight:A,Colour:x,Opacity:w,Graphic:g}};r.AddRoute=function(u,t){r.Routes.push(r.ParseShape(u,q,t,r.Route));r.DrawRoutes()};r.DrawRoutes=function(){var t=r.RouteLayer,v=r.Properties.Bound.Elements;while(t.childNodes.length>0){t.removeChild(t.childNodes[0])}for(var u in r.Routes){var y=r.Routes[u],z=y.Points,w=[];for(var x in z){if(z[x].X>v.L&&z[x].Xv.B&&z[x].Y0){y.Graphic=r.LoadGraphic(w,q,y.Weight,y.Colour,y.Opacity);t.appendChild(y.Graphic)}}};r.ClearRoutes=function(){var t=r.RouteLayer;while(t.childNodes.length>0){t.removeChild(t.childNodes[0])}r.Routes=[]};r.AddShape=function(v,t,u){r.Shapes.push(r.ParseShape(v,t,u,r.Shape));r.DrawShapes()};r.DrawShapes=function(){var v=r.Properties.Bound.Elements,u=r.ShapeLayer;while(u.childNodes.length>0){u.removeChild(u.childNodes[0])}for(var t in r.Shapes){var x=r.Shapes[t],y=x.Points;for(var w in y){if(y[w].X>v.L&&y[w].Xv.B&&y[w].Y0){t.removeChild(t.childNodes[0])}r.Shapes=[]};r.Resize=function(){var u=r.Properties,v=u.Tiles,w=u.Bound.Tiles,t=r.Element;v.Actual=v.Size*u.Zoom.Level;u.Height=t.offsetHeight;u.Width=t.offsetWidth;v.X=Math.ceil(u.Width/v.Size)+(w*2);v.Y=Math.ceil(u.Height/v.Size)+(w*2);r.Tiles=[];r.Draw();r.FireEvent(r,"resize")};r.CentreAndZoom=function(A,z,D){var C=r.Properties,B=C.Tiles,w=C.Bound,u=w.Elements,t=r.Surface,v=r.SurfaceLayer.style;A=Math.round(A);z=Math.round(z);C.Zoom.Level=D;C.X=A-((C.Width/2)*C.Zoom.Level);C.Y=z+((C.Height/2)*C.Zoom.Level);C.L=C.X;C.T=C.Y;C.R=C.L+(C.Width*C.Zoom.Level);C.B=C.T-(C.Height*C.Zoom.Level);B.Actual=B.Size*C.Zoom.Level;w.X=(Math.floor(C.L/B.Actual)*B.Actual);w.Y=(Math.ceil(C.T/B.Actual)*B.Actual);w.L=w.X-(w.Tiles*B.Actual);w.T=w.Y+(w.Tiles*B.Actual);w.R=w.L+(C.Tiles.X*B.Actual);w.B=w.T-(C.Tiles.Y*B.Actual);u.L=w.L-(B.Actual*u.Distance);u.T=w.T+(B.Actual*u.Distance);u.R=w.R+(B.Actual*u.Distance);u.B=w.B-(B.Actual*u.Distance);t.X=0;t.Y=0;v.top=t.Y+"px";v.left=t.X+"px";r.Draw()};r.ZoomMap=function(z){var t=r.Properties,x=t.Zoom.Supported,w=t.L+((t.Width/2)*t.Zoom.Level),v=t.T-((t.Height/2)*t.Zoom.Level);for(var y in x){if(t.Zoom.Level==x[y]){var u=x[y-z];if(typeof(u)!=o){r.CentreAndZoom(w,v,u);break}}}};r.MouseZoom=function(){var u=r.Properties,z=r.Mouse,w=u.Zoom.Level,y=u.Zoom.Supported;for(var A in y){if(w==y[A]){var x=y[A-z.Delta];if(typeof(x)==o){return}}}var v=(u.L+((u.Width/2)*w))+(z.ElemX-(u.Width/2))*(w-x),t=(u.T-((u.Height/2)*w))-(z.ElemY-(u.Height/2))*(w-x);r.CentreAndZoom(v,t,x)};r.MouseStartMove=function(){var t=r.Surface,u=r.Mouse;r.ClearDestinations();t.DX=u.WinX-t.X;t.DY=u.WinY-t.Y};r.MouseMoveSurface=function(t){var u=r.Surface,v=r.Mouse;r.SetSurface(v.WinX-u.DX,v.WinY-u.DY)};r.AddDestinations=function(u){for(var t in u){r.Destinations.push({X:u[t][0],Y:u[t][1]})}};r.ClearDestinations=function(){r.Destinations=[];r.Movement.Moving=q};r.AutoMoveSurface=function(){var C=r.Properties,y=C.Zoom.Level,t=r.Surface,w=r.Destinations,u=r.Movement,v=u.Speed,B,z,x;function A(){if(!(t.X==z&&t.Y==x)&&u.Moving){var D=Math.sqrt(Math.pow((z-t.X),2)+Math.pow((x-t.Y),2)),H=(z-t.X)/D,G=(x-t.Y)/D,F=t.X+(H*v),E=t.Y+(G*v);if(Math.sqrt(Math.pow((z-t.X),2)+Math.pow((x-t.Y),2))0){w.shift();r.AutoMoveSurface()}}}if(w.length>0&&!u.Moving){B=w[0];z=(C.X-(Math.round(B.X)-((C.Width/2)*y)))/y;x=((Math.round(B.Y)+((C.Height/2)*y))-C.Y)/y;u.Moving=m;A()}};r.SetSurface=function(E,D){var t=r.Surface,H=r.Properties,G=H.Tiles,C=H.Zoom.Level,F=G.Actual,A=r.SurfaceLayer.style,w=r.TileLayer,B=H.Bound,v=B.Elements,I=q,z=q;t.X=E;t.Y=D;H.L=H.X-(t.X*C);H.T=H.Y+(t.Y*C);H.R=H.L+(H.Width*C);H.B=H.T-(H.Height*C);A.top=t.Y+"px";A.left=t.X+"px";if(B.X>H.L||B.X<(H.L-G.Actual)||B.Y>(H.T+G.Actual)||B.Y(H.R-F))||(r.Tiles[J].X(H.T))){for(var u in w.childNodes){if(w.childNodes[u]==r.Tiles[J].Image){w.removeChild(w.childNodes[u])}}if(r.Tiles[J].X>(B.R-F)){r.Tiles[J].X-=F*G.X}if(r.Tiles[J].X(B.T)){r.Tiles[J].Y-=F*G.Y}r.Tiles[J].Image=r.LoadTile(r.Tiles[J].X,r.Tiles[J].Y);w.appendChild(r.Tiles[J].Image);I=m;if(B.Lv.T||B.R>v.R||B.Bu&&v[z].XA)){v[z].Selected=m;v[z].Image.style.display=""}else{v[z].Selected=q;v[z].Image.style.display="none"}}}else{if(D.Mode==MOUSE_SELECT_RADIAL){var t=Math.sqrt(Math.pow(w,2)+Math.pow(y,2));if(r.Browser.IE){x.style.left=(C-t)+"px";x.style.top=(B-t)+"px";x.style.width=(t*2)+"px";x.style.height=(t*2)+"px"}else{x.setAttribute("r",t+"px")}for(var z in v){var G=I.L+(E.X*I.Zoom.Level)-v[z].X,F=I.T-(E.Y*I.Zoom.Level)-v[z].Y;if((Math.sqrt(Math.pow(G,2)+Math.pow(F,2)))<=(t*I.Zoom.Level)){v[z].Selected=m;v[z].Image.style.display=""}else{v[z].Selected=q;v[z].Image.style.display="none"}}}}};r.GetSelected=function(){var v=[],u=r.Markers;for(var t in u){if(u[t].Selected){v.push(u[t])}}return v};r.ClearSelection=function(){_markers=r.Markers,_selectlayer=r.SelectLayer;for(var t in _markers){_markers[t].selected=m;_markers[t].Image.style.display=""}while(_selectlayer.childNodes.length>0){_selectlayer.removeChild(_selectlayer.childNodes[0])}};r.CreateZoomControl=function(){var B={},w=s.createElement(p),v=s.createElement(c),t=s.createElement(c),C=s.createElement(c),F=d+"cursor:pointer;",z=r.Properties.Zoom.Supported.length,x=z*9,A=21+x;B.SliderY=30;B.SliderDY=0;B.ZoomIndex=0;w.id="zoomControl";w.style.cssText=d+"left:0px;top:0px;z-index:0;";if(r.Browser.WebKit){w.style.cssText+="-webkit-user-select: none"}if(r.Browser.Gecko){w.style.cssText+="-moz-user-select: none"}v.src=h+"maps/zoom-in.png";v.style.cssText=F+"top:10px;left:10px;";t.src=h+"maps/zoom-out.png";t.style.cssText=F+"top:"+(30+x)+"px;left:10px;";C.src=h+"maps/zoom-slider.png";C.style.cssText=F+"top:"+B.SliderY+"px;left:11px;";for(var y=0;yA){B.SliderY=A}C.style.top=B.SliderY+"px"}function G(){var J=Math.round((B.SliderY-30)/9);if(J!=B.ZoomIndex){r.ZoomMap(B.ZoomIndex-J)}}function u(){var J=r.Mouse.ElemY,K=0;if(J<30){J=30}if(J>A){J=A}K=Math.round((J-30)/9);r.ZoomMap(B.ZoomIndex-K)}r.Listeners.push({Object:r,Event:"redraw",Code:E,System:m});r.Listeners.push({Object:C,Event:"down",Code:D,System:m});r.Listeners.push({Object:C,Event:"drag",Code:I,System:m});r.Listeners.push({Object:C,Event:"up",Code:G,System:m});B.Container=w;B.ButtonIn=v;B.ButtonOut=t;B.Slider=C;r.Controls.push(B);return B};r.CreateCopyright=function(){var u=document.createElement(p),v={},t=d;t+="bottom:4px;right:4px;height:10px;";t+=e;u.style.cssText=t;if(r.Properties.Tiles.Renderer=="MASTERMAP"){u.innerHTML="©"+n+" Postcode Anywhere - Map data ©"+n+" Crown Copyright"}else{u.innerHTML="©"+n+" Postcode Anywhere - Map data ©"+n+" Tele Atlas"}r.Element.appendChild(u);v.Element=u;r.Controls.push(v);return v};r.CreateLogo=function(){var v=document.createElement(c),t={},u=d;v.src=h+"maps/pca_logo.png";u+="top:4px;right:4px";v.style.cssText=u;r.Element.appendChild(v);r.ReRenderPNG(v);t.Element=v;r.Controls.push(t);return t};r.CreateScaleView=function(){var v=document.createElement(p),u=document.createElement(p),z={},y=d,w=d,t=r.Properties.Tiles.Size/2;w+="bottom:5px;left:4px;width:"+t+"px;text-align:center;";w+=e;u.style.cssText=w;y+="bottom:4px;left:4px;height:3px;width:"+t+"px;";y+="border: 1px solid #000000;border-top:0;overflow:hidden;font-size:0;";v.style.cssText=y;r.Element.appendChild(u);r.Element.appendChild(v);function x(){var A=r.Properties.Tiles.Actual/2;if(A>=1000){A/=1000;A+="k"}A+="m";u.innerHTML=A}r.Listeners.push({Object:r,Event:"redraw",Code:x,System:m});z.Bar=v;z.Text=u;r.Controls.push(z);return z};r.ClearControls=function(){var v=r.Element.childNodes,t=[];for(var u=0;uOne moment please...

"); } this._FindCallBack = function(response) { var _strHtml=""; var _intCounter=0; //Test for an error if (response.length==1 && typeof(response[0].error_number) != 'undefined') { //Show the error message if (response[0].error_number=="7" || response[0].error_number=="11") { this._SetControlHtml("

Sorry, we were unable to understand that location. Please click on cancel and check your spelling.

"); } else { this._SetControlHtml("

" + response[0].message + "

"); } } else { //Check if there were any items found if (response.length==0) { this._SetControlHtml("

Sorry, no matching items found.

"); } else if (response.length==1) { this.StoredNearest(response[_intCounter].id); } else { _strHtml = ""; _strHtml += ""; for (_intCounter=0; _intCounter" + response[_intCounter].description + ""; } _strHtml += "
Which one did you mean?
"; this._SetControlHtml(_strHtml); } } } this._StoredNearestCallBack = function(response) { var _strHtml=""; var _intCounter=0; var _objMarker; //Test for an error if (response.length==1 && typeof(response[0].error_number) != 'undefined') { //Show the error message if (response[0].error_number=="7" || response[0].error_number=="11") { this._SetControlHtml("

Sorry, we were unable to find your address. Please click on cancel and enter your address manually.

"); } else { this._SetControlHtml("

" + response[0].message + "

"); } } else { //Check if there were any items found if (response.length==0) { this._SetControlHtml("

Sorry, no matching items found.

"); } else { //Store the results for later this.m_objResults = response; if (!this.HideMap) { //Add the pins onto the Google Map if (this.UseGoogleMaps) { //Add the pins onto the Google Map this.Map.clearOverlays(); this.m_objPins.length = response.length; for (_intCounter=0; _intCounter"; _strHtml += "" + this.m_objResults[_intCounter].name + " "; _strHtml += "" + this.m_objResults[_intCounter].distance + " mile(s)"; _strHtml += ""; } _strHtml += ""; this._SetControlHtml(_strHtml); } this.SelectStore = function(what) { var _strHtml=""; //Display details in the side panel _strHtml = "
"; _strHtml += "" + this.m_objResults[what].name + ""; _strHtml += "

" + this.m_objResults[what].description; _strHtml += "

" + this.m_objResults[what].distance + " mile(s) away"; _strHtml += "

"; _strHtml += "
"; this._SetControlHtml(_strHtml); //Centre the map on the store if (!this.HideMaps) { if (this.UseGoogleMaps) { this.GoogleMap.panTo(new GLatLng(this.m_objResults[what].wgs84_latitude, this.m_objResults[what].wgs84_longitude)) } else { this.Map.CentreAndZoom(this.m_objResults[what].grid_east_m*1, this.m_objResults[what].grid_north_m*1, 2); } } //Call the callback //this.CallBack(this.m_objResults[what]); } this._IsSecure = function() { return (window.location.protocol=="https:"); } this._IsVisible = function() { return (this.m_pnlControl.style.display==""); } this._LogoImage = function() { var _intVersion=0; var _blnAddLogo=true; if (navigator.userAgent.indexOf("MSIE")!=-1) { _intVersion = parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)); if (_intVersion>6) _blnAddLogo = false; } else if (navigator.userAgent.indexOf("Firefox")!=-1) { _blnAddLogo = false; } if (!this.ShowLogo) _blnAddLogo = false; if (_blnAddLogo) { if (this._IsSecure()) { return 'https://services.postcodeanywhere.co.uk/popups/flat_logo.png'; } else { return 'http://services.postcodeanywhere.co.uk/popups/flat_logo.png'; } } else { if (this._IsSecure()) { return 'https://services.postcodeanywhere.co.uk/popups/spacer.gif'; } else { return 'http://services.postcodeanywhere.co.uk/popups/spacer.gif'; } } } this._BackgroundImage = function() { if (this._IsSecure()) { if (this.ShowLogo) return 'https://services.postcodeanywhere.co.uk/popups/popup_store_background.png' else return 'https://services.postcodeanywhere.co.uk/popups/popup_store_background_nologo.png'; } else { if (this.ShowLogo) return 'http://services.postcodeanywhere.co.uk/popups/popup_store_background.png' else return 'http://services.postcodeanywhere.co.uk/popups/popup_store_background_nologo.png'; } } this._ImageBase = function() { if (this._IsSecure()) { return 'https://services.postcodeanywhere.co.uk/popups/'; } else { return 'http://services.postcodeanywhere.co.uk/popups/'; } } this._PcaMap = function(e, n) { if (this._IsSecure()) this.m_pnlMap.innerHTML="" else this.m_pnlMap.innerHTML=""; } this._BackgroundStyles = function() { var _intVersion=0; var _blnColourBackground=true; if (navigator.userAgent.indexOf("MSIE")!=-1) { _intVersion = parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)); if (_intVersion>6) _blnColourBackground = false; } else if (navigator.userAgent.indexOf("Firefox")!=-1) { _blnColourBackground = false; } if (_blnColourBackground) return ";background-color:#e4e4b7;border:solid 1px black;" else return ";background-image:url(" + this._BackgroundImage() + ");"; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //Constructor //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //The interior control this.m_pnlControl = document.createElement("DIV"); this.m_pnlControl.style.zIndex=1000; this.m_pnlControl.style.position="absolute"; this.m_pnlControl.style.top="0px"; this.m_pnlControl.style.left="0px"; this.m_pnlControl.style.width="740px"; this.m_pnlControl.style.height="402px"; this.m_pnlControl.style.display="none"; this.m_pnlControl.style.padding="0"; this.m_pnlControl.style.margin="0"; //Bind to the control list this.m_intUid = _PostcodeAnywhereControlList.length _PostcodeAnywhereControlList[this.m_intUid] = this; _PostcodeAnywhereControlList.length += 1; //Build the HTML var _strHtml=""; if (navigator.userAgent.indexOf("MSIE")!=-1) { //_strMapWidth = "402px"; //_strButtonWidth = "404px"; _strMapWidth = "372px"; _strButtonWidth = "374px"; } else { _strMapWidth = "372px"; _strButtonWidth = "374px"; } if (this.HideMap) { _strHtml+="
" _strHtml+="
" _strHtml+="
"; _strHtml+="
"; _strHtml+=" "; _strHtml+=" "; _strHtml+=" " _strHtml+=" "; _strHtml+="
" _strHtml+="
" _strHtml+="
" _strHtml+="
"; _strHtml+="
Powered by PCA Predict
"; _strHtml+="
" _strHtml+="
"; _strHtml+="
" _strHtml+="
" _strHtml+="
" _strHtml+="
" } else { _strHtml+="
" _strHtml+="
" _strHtml+="
"; _strHtml+="
"; _strHtml+=" "; _strHtml+=" "; _strHtml+=" " _strHtml+=" " _strHtml+=" "; _strHtml+="
" _strHtml+="
" _strHtml+="
" _strHtml+="
" _strHtml+="
" _strHtml+="
"; _strHtml+="
Powered by PCA Predict
"; _strHtml+="
" _strHtml+="
"; _strHtml+="
" _strHtml+="
" _strHtml+="
" _strHtml+="
" } this.m_pnlControl.innerHTML=_strHtml; //Bind into the document document.body.appendChild (this.m_pnlControl); this.m_pnlLocations = document.getElementById("pcaLocations_" + this.m_intUid); this.m_pnlMap = document.getElementById("pcaMap_" + this.m_intUid); this.m_pnlButtonBar = document.getElementById("pcaButtonBar_" + this.m_intUid); //Check if GM is available if (this.UseGoogleMaps && typeof(GMap2) =='undefined') { alert("Can't find the Google Maps API on this page - please make sure it's present and declared before Postcode Anywhere") } } if (self.location.protocol=='https:') { var pcaBaseUrlYE44 = 'https://services.postcodeanywhere.co.uk/popups'; } else { var pcaBaseUrlYE44 = 'http://services.postcodeanywhere.co.uk/popups'; } var pcaLicenseKeyYE44 = 'YE44-XG96-ZR32-EY98'; var pcaAccountCodeYE44 = 'DEMOC11112'; var pcaMachineIdYE44 = ''; var pcaSetupServiceYE44 = pcaBaseUrlYE44 + '/setup.aspx'; var pcaReturnUrlYE44 = self.location; var pcaTokenYE44 = 'YE44'; var objControlYE44=null; function pcaSetupYE44() { var objWindow; var strOptions; var strUrl; if (document.forms.length == 0) alert("Your must have at least one HTML FORM tag on your page before you can set up Postcode Anywhere.") else { strUrl = pcaSetupServiceYE44+'?account_code='+escape(pcaAccountCodeYE44)+'&license_key='+escape(pcaLicenseKeyYE44)+'&token='+escape(pcaTokenYE44)+'&machineId='+escape(pcaMachineIdYE44)+pcaFormFieldsYE44()+'&return_to='+escape(pcaReturnUrlYE44); objWindow='PCA'; strOptions='toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width=580,height=550'; window.open(strUrl, objWindow, strOptions); } }; function pcaGetFieldYE44(what) { var intFieldCounter=0; for (intFormCounter=0; intFormCounter <= document.forms.length-1 ; intFormCounter++) { for (elementCounter=0; elementCounter <= document.forms[intFormCounter].length-1 ; elementCounter++) { if (document.forms[intFormCounter].elements[elementCounter].name==what) { return document.forms[intFormCounter].elements[elementCounter].value; }; }; }; }; function pcaFormFieldsYE44() { var strFieldList = ""; var intFieldCounter=0; for (intFormCounter=0; intFormCounter <= document.forms.length-1 ; intFormCounter++) { for (elementCounter=0; elementCounter <= document.forms[intFormCounter].length-1 ; elementCounter++) { strFieldList = strFieldList + "&field" + intFieldCounter + "=" + escape(document.forms[intFormCounter].elements[elementCounter].name); intFieldCounter++; }; }; return (strFieldList); } function pcaStartYE44() { //Create the control if necessary if (!objControlYE44) { objControlYE44 = new PostcodeAnywhereStoreLocaterYE44(); }; //Start the search objControlYE44.Find(pcaGetFieldYE44("postcode")); }; document.write(" "); document.write("");