//<![CDATA[
var preload1=new Image(),preload2=new Image(),preload3=new Image(),preload4=new Image(),preload5=new Image(),preload6=new Image(),preload7=new Image(),preload8=new Image(),preload9=new Image();preload1.src='/IMG/icon-sb.png';preload2.src='/IMG/icon-sb1.png';preload3.src='/IMG/icon-sb2.png';preload4.src='/IMG/icon-sb3.png';preload5.src='/IMG/icon-sb4.png';preload6.src='/IMG/icon-sb5.png';preload7.src='/IMG/icon-sb-over.png';preload8.src='/IMG/icon-emm.png';preload9.src='/IMG/icon-emm-over.png';function createCursorPos(e){var pt=osMap.getLonLatFromViewPortPx(e.xy);var east=Math.floor(pt.lon);var easts=(east+1000000).toString().slice(1);var north=Math.floor(pt.lat);var norths=(north+10000000).toString().slice(1);var lonlat=grid.getLonLatFromMapPoint(pt);var lati=lonlat.lat.toFixed(5);var latis=lati.toString()+'0000000';latis=latis.slice(0,8);var long=lonlat.lon.toFixed(5);var dir;if(long>=0){dir='E'}else{dir='W';long=-long};var longs=long.toString()+'0000000';longs=longs.slice(0,7);crds.setHTML("<div id=\"coordbox\" class=\"coords\">"+easts+"E&nbsp;&nbsp;"+norths+"N<br>"+longs+"&deg;"+dir+"&nbsp;&nbsp;&nbsp;&nbsp;"+latis+"&deg;N<\/div>");do_chk_size();if((east<0)||(north<0)||(east>700000)||(north>1300000)){_eid('coordbox').style.visibility='hidden'}else{_eid('coordbox').style.visibility='visible'}};function chk_height(){var current_height,current_width;if(window.innerHeight){current_height=window.innerHeight;current_width=window.innerWidth}else{current_height=document.documentElement.clientHeight;current_width=document.documentElement.clientWidth};if(current_height<700)current_height=700;if(current_width<600)current_width=600;osdiv._curr_height=current_height-100;osdiv.style.height=osdiv._curr_height+'px';mapdiv._curr_height=current_height-100;mapdiv.style.height=mapdiv._curr_height+'px';pandiv._curr_height=current_height-100;pandiv.style.height=pandiv._curr_height+'px';if((document.URL.indexOf('GVA')>0)||(document.URL.indexOf('client')>0)){current_width=current_width+170};_eid('os_holder').style.height=current_height-90+'px';osdiv._curr_width=current_width-200;osdiv.style.width=osdiv._curr_width+'px';mapdiv._curr_width=current_width-200;mapdiv.style.width=mapdiv._curr_width+'px';pandiv._curr_width=current_width-200;pandiv.style.width=pandiv._curr_width+'px';_eid('optbox').style.top=(current_height-416)+'px';_eid('osmapsrchbox').style.top=(current_height-202)+'px';try{_eid('osmapsrchbox2').style.top=(current_height-232)+'px'}catch(e){};if(typeof crds=="object"){crds.setPosition(new OpenLayers.Pixel(100,current_height-172))}if(typeof osMap=="object")osMap.updateSize()};function do_chk_size(){chk_height();gmap.checkResize()};function save_gmap_state(){if(typeof OpenSpace!='object'||typeof OpenLayers!='object'||typeof _mJavascriptVersion=='undefined'){return};var lonlat=gmap.getCenter();var ty=gmap.getCurrentMapType();if(ty==google.maps.PHYSICAL_MAP){ty=3}else if(ty==google.maps.HYBRID_MAP){ty=2}else if(ty==google.maps.SATELLITE_MAP){ty=1}else{ty=0};var zm=gmap.getZoom();setosmapparams(lonlat.lng(),lonlat.lat(),zoom_gm[zm<=16?zm:16],ty);setosmapparamsemm(lonlat.lng(),lonlat.lat(),zoom_gm[zm<=16?zm:16],ty)};function save_osmap_state(){if(typeof OpenSpace!='object'||typeof OpenLayers!='object'||typeof _mJavascriptVersion=='undefined'){return};var pt=osMap.getCenter();var lonlat=grid.getLonLatFromMapPoint(pt);var zm=osMap.getZoom();var ty=gmap.getCurrentMapType();gmap.setCenter(new google.maps.LatLng(lonlat.lat,lonlat.lon),zoom_os[zm<=12?zm:12],ty);srv.getTileCount(tileresults);if(ty==google.maps.PHYSICAL_MAP){ty=3}else if(ty==google.maps.HYBRID_MAP){ty=2}else if(ty==google.maps.SATELLITE_MAP){ty=1}else{ty=0};setosmapparams(lonlat.lon,lonlat.lat,zm,ty);setosmapparamsemm(lonlat.lon,lonlat.lat,zm,ty)};function toggleOS(){if(typeof OpenSpace!='object'||typeof OpenLayers!='object'||typeof _mJavascriptVersion=='undefined'){alert('One of Ordnance Survey or Google Maps data server is currently unavailable!');return};mapdiv=_eid('google_map0');osdiv=_eid('os_canvas');pandiv=_eid("pano");osboxdiv=_eid('os-search-box');if(pandiv.style.visibility=='visible'){alert('Switch off Street View first!');return};if(osdiv.style.visibility!='hidden'){save_osmap_state();osdiv.style.visibility='hidden';osdiv.style.display='none';mapdiv.style.visibility='visible';mapdiv.style.display='block';osboxdiv.style.visibility='hidden';osboxdiv.style.display='none';_eid('optbox').style.visibility='hidden';_eid('optbox').style.display='none';osdiv.style.height='0px';osdiv.style.width='0px';osdiv.style.left='0px';mapdiv.style.width=mapdiv._curr_width+'px';chk_height();gmap.checkResize();gmap.addControl(minigm);gmap.addControl(large_map_control,new google.maps.ControlPosition(google.maps.ANCHOR_TOP_LEFT,new google.maps.Size(8,8)));mapdiv.style.borderWidth='2px';mapdiv.style.borderStyle='solid';mapdiv.style.borderColor='#000';var pt=osMap.getCenter();var lonlat=grid.getLonLatFromMapPoint(pt);var zm=osMap.getZoom();gmap.setCenter(new google.maps.LatLng(lonlat.lat,lonlat.lon),zoom_os[zm<=12?zm:12],gmap.getCurrentMapType())}else{gmap.removeControl(large_map_control);gmap.removeControl(minigm);save_gmap_state();mapdiv.style.visibility='hidden';mapdiv.style.display='none';osdiv.style.visibility='visible';osdiv.style.display='block';osboxdiv.style.visibility='visible';osboxdiv.style.display='block';_eid('optbox').style.display='block';var cntr=gmap.getCenter();var zm=gmap.getZoom();mapdiv.style.height='0px';mapdiv.style.width='0px';osdiv.style.left='0px';chk_height();osdiv.style.borderWidth='2px';osdiv.style.borderStyle='solid';osdiv.style.borderColor='#000';var mP=grid.getMapPointFromLonLat(new OpenLayers.LonLat(cntr.lng(),cntr.lat()));osMap.setCenter(mP,zoom_gm[zm<=16?zm:16])}};function togglePano(){if(typeof OpenSpace!='object'||typeof OpenLayers!='object'||typeof _mJavascriptVersion=='undefined'){alert('One of Ordnance Survey or Google Maps data server is currently unavailable!');return};if(osdiv.style.visibility!='hidden'){alert('Switch off OS Maps first!');return};if(mapdiv.style.visibility=='hidden'){pandiv.style.visibility='hidden';pandiv.style.display='none';mapdiv.style.width=mapdiv._curr_width+'px';osdiv.style.left='0px';osdiv.style.top='0px';pandiv.style.height='0px';pandiv.style.width='0px';if(typeof myPano!='undefined')myPano.remove();mapdiv.style.visibility='visible';mapdiv.style.display='block';chk_height()}else if(pandiv.style.visibility=='hidden'){mapdiv.style.visibility='hidden';mapdiv.style.display='none';mapdiv.style.height='0px';mapdiv.style.width='0px';osdiv.style.left='0px';osdiv.style.top='0px';pandiv.style.width=pandiv._curr_width+'px';pandiv.style.visibility='visible';pandiv.style.display='block';chk_height();if(typeof myPano!='undefined')myPano.remove();myPano=new google.maps.StreetviewPanorama(pandiv);myPano.setLocationAndPOV(saved_loc)}else{alert('Please first zoom in close-up to streets highlighted in blue')};gmap.checkResize()};function showPanoData(panoData){if(panoData.code!=200){return};zm=gmap.getZoom();if(zm>10){new_loc=panoData.location.latlng;saved_loc=new_loc;gmap.setCenter(new_loc,zm,gmap.getCurrentMapType());mapdiv.style.visibility='hidden';mapdiv.style.display='none';pandiv.style.visibility='visible';pandiv.style.display='block';mapdiv.style.height='0px';mapdiv.style.width='0px';osdiv.style.left='0px';osdiv.style.top='0px';pandiv.style.width=pandiv._curr_width+'px';chk_height();if(typeof myPano!='undefined')myPano.remove();myPano=new google.maps.StreetviewPanorama(pandiv);myPano.setLocationAndPOV(new_loc)}else{alert('Please first zoom in close-up to streets highlighted in blue')};gmap.checkResize()};function do_copyright_fix(){var copycoll=_ecn('OpenSpaceControlCopyrightCollection')[0];if(copycoll!=null){copycoll.style.position='absolute';copycoll.style.bottom='2px';copycoll.style.left='4px';copycoll.style.lineHeight='14px';copycoll.style.textAlign='center';copycoll.style.padding='2px';copycoll.style.width='284px';copycoll.style.background="#ffffff";copycoll.style.borderColor="#888888";copycoll.style.borderWidth="1px";copycoll.style.borderStyle="solid";copycoll.className=''}};function fix_os_logos(){if(typeof OpenSpace!='object'||typeof OpenLayers!='object')return;var m='-10px',w='122px',h='82px',ww='112px',hh='72px',rw='108px',rh='68px';osMap.addControl(new OpenSpace.Control.PoweredBy());OpenSpace.Control.Copyright.getDefaultCopyright=function(){var bounds=new OpenSpace.MapBounds(0,0,800000,1300000);return new OpenSpace.Control.Copyright("&nbsp;<a href=\"http://openspace.ordnancesurvey.co.uk/openspace/developeragreement.html#enduserlicense\" target=\"_blank\">OS OpenData</a> &#169; 2012 Ordnance Survey<br>Software &#169; 2012 <a href=\"http://www.secret-bases.co.uk/\" target=\"_blank\">www.secret-bases.co.uk</a>&nbsp;",bounds)};osMap.addControl(new OpenSpace.Control.CopyrightCollection());minios.maximizeControl();minios.ovmap.resolutions=[2500,1000,500,200,100,50,25,10,5,2,1];do_copyright_fix();if(_eid('OpenSpaceControlPoweredBy')!=null){_eid('OpenSpaceControlPoweredBy').style.position='absolute';_eid('OpenSpaceControlPoweredBy').style.bottom='16px';_eid('OpenSpaceControlPoweredBy').style.left='0px'};if(_eid('OpenSpaceControlPoweredBy_innerImage')!=null){_eid('OpenSpaceControlPoweredBy_innerImage').style.position='absolute';_eid('OpenSpaceControlPoweredBy_innerImage').style.bottom='0px';_eid('OpenSpaceControlPoweredBy_innerImage').style.left='0px'};var miniback=_ecn('OpenSpaceControlOverviewMapBackground')[0];if(miniback!=null){miniback.style.position='absolute';miniback.style.right='0px';miniback.style.left='';miniback.style.top='';miniback.style.bottom='0px';miniback.style.width=w;miniback.style.height=h;miniback.style.marginTop=m;miniback.style.marginBottom='0px';miniback.style.marginRight='0px';miniback.style.marginLeft=m;miniback.style.zIndex='-1';miniback.style.background='#504D4D'};miniback=_ecn('olMap')[1];if(miniback!=null){miniback.style.position='relative';miniback.style.left='';miniback.style.top='';miniback.style.right='0px';miniback.style.bottom='0px';miniback.style.width=ww;miniback.style.height=hh};miniback=_ecn('OpenSpaceControlOverviewMapContainer')[0];if(miniback!=null){miniback.style.position='absolute';miniback.style.left='';miniback.style.top='';miniback.style.right='0px';miniback.style.bottom='0px';miniback.style.width=ww;miniback.style.height=hh;miniback.style.marginTop='0px';miniback.style.marginBottom='0px';miniback.style.marginRight='0px';miniback.style.marginLeft='0px'};miniback=_ecn('OpenSpaceControlOverviewMapElement')[0];if(miniback!=null){miniback.style.position='absolute';miniback.style.left='';miniback.style.top='';miniback.style.right='0px';miniback.style.bottom='0px';miniback.style.width=ww;miniback.style.height=hh;miniback.style.marginTop='0px';miniback.style.marginBottom='0px';miniback.style.marginRight='0px';miniback.style.marginLeft='0px';miniback.style.borderWidth='2px';miniback.style.borderStyle='solid';miniback.style.borderColor='#fff'};miniback=_ecn('OpenSpaceControlOverviewMapExtentRectangle')[0];if(miniback!=null){miniback.style.position='absolute';miniback.style.top='0px';miniback.style.left='0px';miniback.style.right='';miniback.style.bottom='';miniback.style.width=rw;miniback.style.height=rh}};function do_add_events(){if(typeof OpenSpace!='object'||typeof OpenLayers!='object'){gmap.addControl(minigm);gmap.addControl(large_map_control,new google.maps.ControlPosition(google.maps.ANCHOR_TOP_LEFT,new google.maps.Size(8,8)))}else{fix_os_logos();if(osMap.getZoom()==0){osMap.zoomIn(1);osMap.zoomOut(1)}else{osMap.zoomOut(1);osMap.zoomIn(1)};osicon0=new OpenSpace.Icon("/IMG/icon-sb.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon1=new OpenSpace.Icon("/IMG/icon-sb1.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon2=new OpenSpace.Icon("/IMG/icon-sb2.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon3=new OpenSpace.Icon("/IMG/icon-sb3.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon4=new OpenSpace.Icon("/IMG/icon-sb4.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon5=new OpenSpace.Icon("/IMG/icon-sb5.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon6=new OpenSpace.Icon("/IMG/icon-comah-lower.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon7=new OpenSpace.Icon("/IMG/icon-comah-top.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon8=new OpenSpace.Icon("/IMG/icon-nuke.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon9=new OpenSpace.Icon("/IMG/icon-gvs.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon10=new OpenSpace.Icon("/IMG/icon-hirta.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon11=new OpenSpace.Icon("/IMG/icon-epa.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon12=new OpenSpace.Icon("/IMG/icon-data.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon13=new OpenSpace.Icon("/IMG/icon-trains.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon14=new OpenSpace.Icon("/IMG/icon-airports-small.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));osicon15=new OpenSpace.Icon("/IMG/icon-airports-large.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0));def_gicon=new google.maps.Icon();def_gicon.iconSize=new google.maps.Size(24,24);def_gicon.shadowSize=new google.maps.Size(0,0);def_gicon.iconAnchor=new google.maps.Point(12,12);def_gicon.infoWindowAnchor=new google.maps.Point(12,0);crds=new OpenSpace.Layer.ScreenOverlay("coords");crds.setPosition(new OpenLayers.Pixel(100,532));do_chk_size();osMap.addLayer(crds);crds.setHTML('<div><\/div>');srv=new OpenSpace.SupportService();_eid('osmapsrchbox').style.display='block';try{_eid('osmapsrchbox2').style.display='block'}catch(e){};srv.getTileCount(tileresults)}};function plot_radius(east,north){osMap.destroyFeatures();var vectorLayer=osMap.getVectorLayer();var n=360;var step=2*Math.PI/n;var rad=20000;var op=0.4;for(var r=0;r<5;r++){var fop=op;if(r>0){fop=0.0};var style_polygon={strokeColor:"#000000",strokeOpacity: 0.5,strokeWidth: 2,fillColor:"#eeeeee",fillOpacity:fop};var points=[];for(var p=0;p<n;p++){var angle=step*p;var pt=new OpenLayers.Geometry.Point(east+rad*(Math.cos(angle)),north+rad*(Math.sin(angle)));points.push(pt)};rad=rad-5000;if(rad==0){rad=1000};var linearRing=new OpenLayers.Geometry.LinearRing(points);var polygonFeature=new OpenLayers.Feature.Vector(linearRing,null,style_polygon);vectorLayer.addFeatures([polygonFeature])}};function do_events(){if(typeof gmap=='object'&&typeof osMap=='object'){setTimeout("do_add_events()",500)}else{setTimeout("do_events()",500)}};var osGazEntries;function os_search_ready(pcode_result){enable_controls();try{_eid('gmaplogopadid2').style.display='none';_eid('gmaplogopadid').style.display='none'}catch(e){};if(pcode_result.substr(0,19)=="No results returned"){do_os_search();return};var ep=pcode_result.indexOf('Eastings=');var np=pcode_result.indexOf('Northings=');var estngs=parseInt(pcode_result.substr(ep+9));var nrthngs=parseInt(pcode_result.substr(np+10));var pt=osMap.getCenter();if((ep>=0)&&(np>=0))pt=new OpenSpace.MapPoint(estngs,nrthngs);var marker_html='<div class="oswind">'+pcode_result;marker_html+='</div>';osMap.setCenter(pt,12);plot_radius(estngs,nrthngs);osMap.openInfoWindow(null,pt,marker_html,new OpenLayers.Size(300,200))};function do_os_search_new(){disable_controls(true);do_AJAX("pcode.js?pc="+_eid('os-query2').value,os_search_ready)};function locsel(opt){var opbox=_eid('optbox');enable_controls();opbox.style.visibility='hidden';if(opt>0){_eid('os-query').value=osGazEntries[opt-1].name;osMap.setCenter(osGazEntries[opt-1].location,7);var cent=osGazEntries[opt-1].location;cent=cent.toString();var eastpos=cent.indexOf('eastings=')+9;var northpos=cent.indexOf('northings=')+10;var eastings=Math.round(parseFloat(cent.substring(eastpos,northpos-1))).toString();var northings=Math.round(parseFloat(cent.substr(northpos))).toString();if((document.URL.indexOf('GVA')>0)||(document.URL.indexOf('client')>0)){plot_radius(parseInt(eastings),parseInt(northings))}};var marker_html='<div class="oswind">'+osGazEntries[opt-1].name;if(osGazEntries[opt-1].name!=osGazEntries[opt-1].county){marker_html+=','+osGazEntries[opt-1].county};marker_html+='<br><br>'+osGazEntries[opt-1].location+'</div>';osMap.openInfoWindow(null,osGazEntries[opt-1].location,marker_html,new OpenLayers.Size(300,200))};function gazOptions(opts){try{_eid('gmaplogopadid2').style.display='none';_eid('gmaplogopadid').style.display='none'}catch(e){};_eid('os-query').focus();var opbox=_eid('optbox');opbox.innerHTML='';opbox.style.display='block';var optlength=opts.length;if(optlength==0){opbox.style.visibility='hidden';postcodeService.getLonLat(_eid('os-query').value,onResult);return};if(optlength==1){var cent=opts[0].location;cent=cent.toString();var eastpos=cent.indexOf('eastings=')+9;var northpos=cent.indexOf('northings=')+10;var eastings=Math.round(parseFloat(cent.substring(eastpos,northpos-1))).toString();var northings=Math.round(parseFloat(cent.substr(northpos))).toString();enable_controls();opbox.style.visibility='hidden';osMap.setCenter(opts[0].location,7);if((document.URL.indexOf('GVA')>0)||(document.URL.indexOf('client')>0)){plot_radius(parseInt(eastings),parseInt(northings))};var marker_html='<div class="oswind">'+opts[0].name;if(opts[0].name!=opts[0].county){marker_html+=','+opts[0].county};marker_html+='<br><br>'+opts[0].location+'</div>';osMap.openInfoWindow(null,opts[0].location,marker_html,new OpenLayers.Size(300,200));return};var optlist=document.createElement("div");var optlink=document.createElement("a");var optitem=document.createElement("div");optitem.className='omd';optlink.href="javascript:locsel(0)";optlink.appendChild(document.createTextNode('CLOSE'));optitem.appendChild(optlink);optlist.appendChild(optitem);osGazEntries=new Array();for(var i=0;i<optlength;i++){var vl=opts[i];optitem=document.createElement("div");optitem.className='omd';optlink=document.createElement("a");var sval=vl.name+','+vl.county;if((vl.type!='UNKNOWN')&&(vl.type!='OTHER')&&(vl.type!='CITY')&&(vl.type!='TOWN')){sval+=' ('+vl.type.toLowerCase()+')'};optlink.appendChild(document.createTextNode(sval));var numi=i+1;optlink.href="javascript:locsel("+numi+")";optitem.appendChild(optlink);optlist.appendChild(optitem);osGazEntries.push(opts[i])};if(optlength==100){optitem=document.createElement("div");optitem.className='omd2';optitem.appendChild(document.createTextNode('(showing first 100 matches only)'));optlist.appendChild(optitem)};optitem=document.createElement("div");optitem.className='omd';optlink=document.createElement("a");optlink.href="javascript:locsel(0)";optlink.appendChild(document.createTextNode('CLOSE'));optitem.appendChild(optlink);optlist.appendChild(optitem);opbox.appendChild(optlist);if(optlength>=2)opbox.style.visibility='visible'};function onResult(postcodeCentre){enable_controls();if(postcodeCentre!=null){osMap.setCenter(postcodeCentre,9);var marker_html='<div class="oswind">'+_eid('os-query').value.toUpperCase();var pcode=postcodeCentre.toString();var eastpos=pcode.indexOf('eastings=')+9;var northpos=pcode.indexOf('northings=')+10;var eastings=Math.round(parseFloat(pcode.substring(eastpos,northpos-1))).toString();var northings=Math.round(parseFloat(pcode.substr(northpos))).toString();if((northings=="NaN")||(eastings=="NaN")){alert("Not found");return};marker_html+='<br>OS Eastings='+eastings+'<br>OS Northings='+northings+'</div>';if((document.URL.indexOf('GVA')>0)||(document.URL.indexOf('client')>0)){plot_radius(parseInt(eastings),parseInt(northings))};osMap.openInfoWindow(null,postcodeCentre,marker_html,new OpenLayers.Size(300,200))}else{alert('Not found')}};function do_os_search(){disable_controls(true);_eid('optbox').style.visibility='hidden';osGaz.getLocations(_eid('os-query').value,gazOptions)};function enable_controls(){osMap.controls[0].activate();osMap.controls[1].activate()};function disable_controls(flag){if(flag){try{_eid('gmaplogopadid').style.display='block';_eid('gmaplogopadid2').style.display='block'}catch(e){}};osMap.controls[0].deactivate();osMap.controls[1].deactivate()};function clear_search_box(){_eid('os-query').focus();disable_controls(false);_eid('optbox').style.visibility='hidden';_eid('os-query').value=""};function clear_search_box2(){_eid('os-query2').focus();disable_controls(false);_eid('os-query2').value=""};function parseData(req){features=new OpenLayers.Format.KML({extractStyles:true}).read(req.responseText)};function remove_mks_os(mrk,mmm){var n=100,i=mmm;_eid('gmaplogopadid').style.display='block';_eid('gmaplogopadid2').style.display='block';do {osMap.removeMarker(mrk[i])}while((n--)&&(i--));mmm=mmm-100;if(mmm<0){clearInterval(_mt);_mt=0};return mmm};function remove_mks_gmap(mrk,mmm){var i=mmm,n=100;do {gmap.removeOverlay(mrk[i])}while((n--)&&(i--));mmm=mmm-100;if(mmm<0){clearInterval(_mt2);_mt2=0;_eid('gmaplogopadid').style.display='none';_eid('gmaplogopadid2').style.display='none'};return mmm};function add_mks_os(mrk,mmm){var n=500,i=mmm;_eid('gmaplogopadid').style.display='block';_eid('gmaplogopadid2').style.display='block';do{osMap.getMarkerLayer().addMarker(mrk[i])}while((n--)&&(i--));mmm=mmm-500;if(mmm<0){clearInterval(_mt);_mt=0};return mmm};function add_mks_gmap(mrk,mmm){var n=0,i=mmm;do{
//gmap.addOverlay(mrk[i])
}while((n--)&&(i--));mmm=mmm-500;if(mmm<0){clearInterval(_mt2);_mt2=0;_eid('gmaplogopadid').style.display='none';_eid('gmaplogopadid2').style.display='none'};return mmm};function remove_tmp_marker(m){osMap.removeMarker(m);osMap.destroyFeatures()};function add_tmp_marker(){var cent=osMap.getCenter();tmp_mk=osMap.createMarker(cent,new OpenSpace.Icon("/IMG/icon-tmp.png",new OpenLayers.Size(24,24),new OpenLayers.Pixel(-12,-12),null,new OpenLayers.Pixel(12,0)));plot_radius(cent.getEasting(),cent.getNorthing());return tmp_mk};function add_in(marks,mk){marks.push(mk)};function remove_all_markers(mmm){var ft,feat=mmm,n=500;_eid('gmaplogopadid').style.display='block';_eid('gmaplogopadid2').style.display='block';do{if(all_os_markers_active[feat]){ft=all_os_markers[feat];osMap.removeMarker(ft);ft=all_gmap_markers[feat];gmap.removeOverlay(ft)}}while((n--)&&(feat--));mmm=mmm-500;if(mmm<0){clearInterval(_mt2);_mt2=0;clearInterval(_mt);_mt=0;_eid('gmaplogopadid').style.display='none';_eid('gmaplogopadid2').style.display='none';for(var i=0;i<21;i++){icon_toggles[i]=1}};return mmm};function os_marker_callback(text,os_marker){var id,x,y,name,desc,resp;resp=text;if(resp!="No result"){id=resp.substr(0,resp.indexOf('::'));id=id-1;resp=resp.substr(resp.indexOf('::')+2);name=resp.substr(0,resp.indexOf('::'));resp=resp.substr(resp.indexOf('::')+2);desc=resp.substr(0,resp.indexOf('::'));resp=resp.substr(resp.indexOf('::')+2);y=parseFloat(resp.substr(0,resp.indexOf('::')));resp=resp.substr(resp.indexOf('::')+2);x=parseFloat(resp.substr(0,resp.indexOf('::')));resp=resp.substr(resp.indexOf('::')+2);os_marker.icon.imageDiv.title=name;os_marker.eventObj.html='<div class="oswind">'+name+'<br><br>'+desc+'</div>';gmap.addOverlay(all_gmap_markers[os_marker._callback]);gmap_marker_callback(text,all_gmap_markers[os_marker._callback]);};os_marker._called=true;};function gmap_marker_callback(text,gmap_marker){var id,x,y,name,desc,resp;resp=text;if (resp!="No result"){id=resp.substr(0,resp.indexOf('::'));id=id-1;resp=resp.substr(resp.indexOf('::')+2);name=resp.substr(0,resp.indexOf('::'));resp=resp.substr(resp.indexOf('::')+2);desc=resp.substr(0,resp.indexOf('::'));resp=resp.substr(resp.indexOf('::')+2);y=parseFloat(resp.substr(0,resp.indexOf('::')));resp=resp.substr(resp.indexOf('::')+2);x=parseFloat(resp.substr(0,resp.indexOf('::')));resp=resp.substr(resp.indexOf('::')+2);gmap_marker.bindInfoWindowHtml(name+'<br><br>'+desc)};gmap_marker._called=true;};function process_markers(mmm){var step=500;_eid('tiles').innerHTML=mmm;for(var feat=mmm;(feat<features.length)&&(feat<mmm+step);feat++){var ft=features[feat];var geo=ft.geometry;var mP=grid.getMapPointFromLonLat(new OpenLayers.LonLat(geo.x,geo.y));var attr=ft.attributes;var osicon,osicon_path=ft.style.externalGraphic;var icon_path=osicon_path.substr(osicon_path.indexOf('IMG')+4);switch(icon_path){case"icon-sb.png":break;case"icon-sb1.png":osicon=osicon1.clone();if(sb1_num==0){sb1_start=feat};sb1_num++;break;case"icon-sb2.png":osicon=osicon2.clone();if(sb2_num==0){sb2_start=feat};sb2_num++;break;case"icon-sb3.png":osicon=osicon3.clone();if(sb3_num==0){sb3_start=feat};sb3_num++;break;case"icon-sb4.png":osicon=osicon4.clone();if(sb4_num==0){sb4_start=feat};sb4_num++;break;case"icon-sb5.png":osicon=osicon5.clone();if(sb5_num==0){sb5_start=feat};sb5_num++;break;case"icon-comah-lower.png":osicon=osicon6.clone();if(low_num==0){low_start=feat};low_num++;break;case"icon-comah-top.png":osicon=osicon7.clone();if(top_num==0){top_start=feat};top_num++;break;case"icon-nuke.png":osicon=osicon8.clone();if(nuke_num==0){nuke_start=feat};nuke_num++;break;case"icon-gvs.png":osicon=osicon9.clone();if(gvs_num==0){gvs_start=feat};gvs_num++;break;case"icon-hirta.png":osicon=osicon10.clone();if(hirta_num==0){hirta_start=feat};hirta_num++;break;case"icon-rtm.png":osicon=osicon10.clone();if(hirta_num==0){hirta_start=feat};hirta_num++;break;case"icon-epa.png":osicon=osicon11.clone();if(epa_num==0){epa_start=feat};epa_num++;break;case"icon-epa2.png":osicon=osicon11.clone();if(epa2_num==0){epa2_start=feat};epa2_num++;break;case"icon-epa3.png":osicon=osicon11.clone();if(epa3_num==0){epa3_start=feat};epa3_num++;break;case"icon-epa4.png":osicon=osicon11.clone();if(epa4_num==0){epa4_start=feat};epa4_num++;break;case"icon-epa5.png":osicon=osicon11.clone();if(epa5_num==0){epa5_start=feat};epa5_num++;break;case"icon-epa6.png":osicon=osicon11.clone();if(epa6_num==0){epa6_start=feat};epa6_num++;break;case"icon-data.png":osicon=osicon12.clone();if(data_num==0){data_start=feat};data_num++;break;case"icon-trains.png":osicon=osicon13.clone();if(trains_num==0){trains_start=feat};trains_num++;break;case"icon-airports-small.png":osicon=osicon14.clone();if(airports_small_num==0){airports_small_start=feat};airports_small_num++;break;case"icon-airports-large.png":osicon=osicon15.clone();if(airports_large_num==0){airports_large_start=feat};airports_large_num++;break;default:osicon=osicon0.clone();break};if(icon_path!='icon-sb.png'){if((document.URL.indexOf('GVA')>0)||(document.URL.indexOf('client')>0)){var os_htm='<div class="oswind"><\/div>';}else{var os_htm='<div class="oswind">'+attr.name+attr.description+'<\/div>';};var os_marker=osMap.createMarker(mP,osicon,os_htm,popSize);os_marker._callback=feat;os_marker._called=false;if((document.URL.indexOf('GVA')>0)||(document.URL.indexOf('client')>0))os_marker.events.register('mouseover',os_marker,function(){if (!this._called){var text=do_AJAX("markers.php?"+(this._callback).toString());os_marker_callback(text,this)}});var gicon=new google.maps.Icon();gicon.image=osicon_path;gicon.shadow=osicon_path;gicon.iconSize=def_gicon.iconSize;gicon.shadowSize=def_gicon.shadowSize;gicon.iconAnchor=def_gicon.iconAnchor;gicon.infoWindowAnchor=def_gicon.infoWindowAnchor;var point=new google.maps.LatLng(geo.y,geo.x);var desc="";var gmap_marker=new google.maps.Marker(point,{clickable:true,title:desc,icon:gicon});gmap_marker._called=false;gmap_marker._callback=feat;if((document.URL.indexOf('GVA')>0)||(document.URL.indexOf('client')>0))google.maps.Event.addListener(gmap_marker,'mouseover',function(){if (!this._called){var text=do_AJAX("markers.php?"+(this._callback).toString());gmap_marker_callback(text,this)}});};switch(icon_path){case"icon-sb.png":break;case"icon-sb1.png":add_in(sb1_os_markers,os_marker);add_in(sb1_gmap_markers,gmap_marker);break;case"icon-sb2.png":add_in(sb2_os_markers,os_marker);add_in(sb2_gmap_markers,gmap_marker);break;case"icon-sb3.png":add_in(sb3_os_markers,os_marker);add_in(sb3_gmap_markers,gmap_marker);break;case"icon-sb4.png":add_in(sb4_os_markers,os_marker);add_in(sb4_gmap_markers,gmap_marker);break;case"icon-sb5.png":add_in(sb5_os_markers,os_marker);add_in(sb5_gmap_markers,gmap_marker);break;case"icon-comah-lower.png":add_in(low_os_markers,os_marker);add_in(low_gmap_markers,gmap_marker);break;case"icon-comah-top.png":add_in(top_os_markers,os_marker);add_in(top_gmap_markers,gmap_marker);break;case"icon-nuke.png":add_in(nuke_os_markers,os_marker);add_in(nuke_gmap_markers,gmap_marker);break;case"icon-gvs.png":add_in(gvs_os_markers,os_marker);add_in(gvs_gmap_markers,gmap_marker);break;case"icon-hirta.png":add_in(hirta_os_markers,os_marker);add_in(hirta_gmap_markers,gmap_marker);break;case"icon-rtm.png":add_in(hirta_os_markers,os_marker);add_in(hirta_gmap_markers,gmap_marker);break;case"icon-epa.png":add_in(epa_os_markers,os_marker);add_in(epa_gmap_markers,gmap_marker);break;case"icon-epa2.png":add_in(epa2_os_markers,os_marker);add_in(epa2_gmap_markers,gmap_marker);break;case"icon-epa3.png":add_in(epa3_os_markers,os_marker);add_in(epa3_gmap_markers,gmap_marker);break;case"icon-epa4.png":add_in(epa4_os_markers,os_marker);add_in(epa4_gmap_markers,gmap_marker);break;case"icon-epa5.png":add_in(epa5_os_markers,os_marker);add_in(epa5_gmap_markers,gmap_marker);break;case"icon-epa6.png":add_in(epa6_os_markers,os_marker);add_in(epa6_gmap_markers,gmap_marker);break;case"icon-trains.png":add_in(trains_os_markers,os_marker);add_in(trains_gmap_markers,gmap_marker);break;case"icon-airports-large.png":add_in(airports_large_os_markers,os_marker);add_in(airports_large_gmap_markers,gmap_marker);break;case"icon-airports-small.png":add_in(airports_small_os_markers,os_marker);add_in(airports_small_gmap_markers,gmap_marker);break;case"icon-data.png":add_in(data_os_markers,os_marker);add_in(data_gmap_markers,gmap_marker);break;default:add_in(sb1_os_markers,os_marker);add_in(sb1_gmap_markers,gmap_marker);break};if(icon_path!='icon-sb.png'){all_os_markers_active.push(1);all_os_markers.push(os_marker);all_gmap_markers.push(gmap_marker)}};mmm=mmm+step;if(mmm>=features.length){_eid('tiles').innerHTML="Total number of markers loaded: "+features.length;clearInterval(_mt);_mt=0;clearInterval(_mt2);_mt2=0;try{_eid('gmaplogopadid2').style.display='none';_eid('gmaplogopadid').style.display='none';_eid('gmaplogopadid').innerHTML='Processing';_eid('gmaplogopadid2').innerHTML='Processing'}catch(e){};osMap.events.register("mousemove",osMap,createCursorPos);_t_resize=setInterval("do_chk_size()",2000);osMap.events.register("moveend",osMap,function(){srv.getTileCount(tileresults)})};return mmm};function load_os_markers(){if(typeof features=='object'){setTimeout("do_os_markers()",500)}else{setTimeout("load_os_markers()",500)}};function do_os_markers(){try{_eid('gmaplogopadid').innerHTML='Loading markers';_eid('gmaplogopadid2').innerHTML='Loading markers';_eid('gmaplogopadid2').style.display='block';_eid('gmaplogopadid').style.display='block'}catch(e){};grid=new OpenSpace.GridProjection();popSize=new OpenLayers.Size(325,200);_mt=0;_mt2=0;all_os_markers=[];all_os_markers_active=[];all_gmap_markers=[];epa_start=0;epa_num=0;epa2_start=0;epa2_num=0;epa3_start=0;epa3_num=0;epa4_start=0;epa4_num=0;epa5_start=0;epa5_num=0;epa6_start=0;epa6_num=0;sb_start=0;sb_num=0;sb1_start=0;sb1_num=0;sb2_start=0;sb2_num=0;sb3_start=0;sb3_num=0;sb4_start=0;sb4_num=0;sb5_start=0;sb5_num=0;low_start=0;low_num=0;top_start=0;top_num=0;hirta_start=0;hirta_num=0;gvs_start=0;gvs_num=0;nuke_start=0;nuke_num=0;data_num=0;data_start=0;airports_large_num=0;airports_large_start=0;airports_small_num=0;airports_small_start=0;trains_num=0;trains_start=0;epa_os_markers=[];epa2_os_markers=[];epa3_os_markers=[];epa4_os_markers=[];epa5_os_markers=[];epa6_os_markers=[];top_os_markers=[];low_os_markers=[];hirta_os_markers=[];nuke_os_markers=[];gvs_os_markers=[];sb1_os_markers=[];sb2_os_markers=[];sb3_os_markers=[];sb4_os_markers=[];sb5_os_markers=[];airports_large_os_markers=[];airports_small_os_markers=[];data_os_markers=[];trains_os_markers=[];epa_gmap_markers=[];epa2_gmap_markers=[];epa3_gmap_markers=[];epa4_gmap_markers=[];epa5_gmap_markers=[];epa6_gmap_markers=[];top_gmap_markers=[];low_gmap_markers=[];hirta_gmap_markers=[];nuke_gmap_markers=[];gvs_gmap_markers=[];sb1_gmap_markers=[];sb2_gmap_markers=[];sb3_gmap_markers=[];sb4_gmap_markers=[];sb5_gmap_markers=[];airports_large_gmap_markers=[];airports_small_gmap_markers=[];trains_gmap_markers=[];data_gmap_markers=[];mmm=0;if(navigator.userAgent.toLowerCase().indexOf("chrome")>0){_mt=setInterval("mmm=process_markers(mmm)",100)}else{_mt=setInterval("mmm=process_markers(mmm)",2000)}};function tileresults(tilecount,tilemax){_eid('tiles').innerHTML='OS data usage: '+tilecount+' map tiles / daily max '+tilemax;if(tilecount>(tilemax-100)){osMap.baseLayer.url='http://www.old-maps.co.uk/wms'}};function pcoderesults(count,maxcount){var id=_eid('tiles');id.innerHTML=id.innerHTML+count+' / '+maxcount+' postcodes,'};function gazresults(count,maxcount){var id=_eid('tiles');id.innerHTML=id.innerHTML+count+' / '+maxcount+' gazetteer look-ups';id.style.display='block'};
//]]>
