var map 	= null;
var pinid 	= 0;
var llBase	= new VELatLong(51.44031275716011, -1.411743164062491);

//var llLondon = new VELatLong(51.51702190092704, -0.08660316467285436);
var llLondon = new VELatLong(51.51408420661044, -0.13664245605468012);
var llReading = new VELatLong(51.457075495225396, -0.971592664718614);
var llWembley = new VELatLong(51.56267533626145, -0.2793037891387833);
var llMiltonKeynes = new VELatLong(52.03683826859461, -0.7641506195068314);
var llBristol = new VELatLong(51.452188391880874, -2.5967216491699067);
var llBasingstoke = new VELatLong(51.26866832920546, -1.0808229446410993);

var llLondonCentral = new VELatLong(51.52067706282812, -0.09554296731948911);
var llLondonMinories = new VELatLong(51.513176153671964, -0.07597893476486998);
var llLondonWatling = new VELatLong(51.51313609209599, -0.09389340877533891);
var llLondonRoyal = new VELatLong(51.51389391760412, -0.08624374866484989);
var llThreadneedle = new VELatLong(51.514214403893604, -0.08561074733735509);
var llWestbourne = new VELatLong(51.5159, -0.1896);
var llFleetStreet = new VELatLong(51.5143, -0.1080);
var llBristolCity = new VELatLong(51.44837346314198, -2.583762700322839);
var llBristolWest = new VELatLong(51.45727103532783, -2.607740163803095);
var llBasingstokeView = new VELatLong(51.26901067581958, -1.0754370689392047);
var llReadingSoane = new VELatLong(51.4555378857421, -0.9692537784576494);
var llMKAvebury = new VELatLong(52.037993235107145, -0.7579922676086439);
var llWembleyOW = new VELatLong(51.56203837844348, -0.2792340517044179);

var llBristolTS = new VELatLong(51.44957080196369, -2.580569386482227);
var llMiltonKeynesTS = new VELatLong(52.03452824605038, -0.7736563682556314);
var llReadingTS = new VELatLong(51.45875343603605, -0.9735131263732856);
var llBasingstokeTS = new VELatLong(51.26841324575643, -1.087110042572008);
var llWembleyTube = new VELatLong(51.563322289519164, -0.27922332286834106);

var llCentralTube = new VELatLong(51.5202865252798, -0.09757876396180234);
var llWatlingTube = new VELatLong(51.51234486875164, -0.0939095020294207);
var llRoyalTube = new VELatLong(51.513423199278506, -0.08885622024537176);
var llMinoriesTube = new VELatLong(51.5141609896686, -0.07564097642898566);

var llMinoriesZoom = new VELatLong(51.51366356669082, -0.07567852735518761);
var llWatlingZoom = new VELatLong(51.51280391350484, -0.09376734495162038);

var iCurrentZoomLevel = 7;

var layerOfficeLocs = new VEShapeLayer();
var layerOffices = new VEShapeLayer();
var layerExtras = new VEShapeLayer();
var layerOffices2 = new VEShapeLayer();

var arrOfficeLocs = new Array();
arrOfficeLocs[0] = ["London",llLondon.Latitude, llLondon.Longitude,"/image/icon/location_london.gif"];
arrOfficeLocs[1] = ["Reading",llReading.Latitude, llReading.Longitude,"/image/icon/location_reading.gif"];
arrOfficeLocs[2] = ["Wembley",llWembley.Latitude, llWembley.Longitude,"/image/icon/location_wembley.gif"];
arrOfficeLocs[3] = ["Milton Keynes",llMiltonKeynes.Latitude, llMiltonKeynes.Longitude,"/image/icon/location_mk.gif"];
arrOfficeLocs[4] = ["Bristol",llBristol.Latitude, llBristol.Longitude,"/image/icon/location_bristol.gif"];
arrOfficeLocs[5] = ["Basingstoke",llBasingstoke.Latitude, llBasingstoke.Longitude,"/image/icon/location_basingstoke.gif"];

var arrOfficeLocsInfo = new Array();
arrOfficeLocsInfo[0] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>London</b></div><img class='popupinfo' src='/image/be_office_loc_london.jpg' alt='London Offices'/><div style='padding:10px 8px 0px 8px;'>We have 6 London Office Locations<br/><br/><a href='javascript:ZoomToLocation(llLondon);'>View our London Office Locations</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficeLocsInfo[1] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Reading</b></div><img class='popupinfo' src='/image/be_office_loc_reading.jpg' alt='Reading Offices'/><div style='padding:10px 8px 0px 8px;'>We have 1 Reading Office Location<br/><br/><a href='javascript:ZoomToLocation(llReading);'>View our Reading Office Location</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficeLocsInfo[2] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Wembley</b></div><img class='popupinfo' src='/image/be_office_loc_wembley.jpg' alt='Wembley Offices'/><div style='padding:10px 8px 0px 8px;'>We have 1 Wembley Office Location<br/><br/><a href='javascript:ZoomToLocation(llWembley);'>View our Wembley Office Location</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficeLocsInfo[3] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Milton Keynes</b></div><img class='popupinfo' src='/image/be_office_loc_mk.jpg' alt='Milton Keynes Offices'/><div style='padding:10px 8px 0px 8px;'>We have 1 Milton Keynes Office Location<br/><br/><a href='javascript:ZoomToLocation(llMiltonKeynes);'>View our Milton Keynes Office Location</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficeLocsInfo[4] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Bristol</b></div><img class='popupinfo' src='/image/be_office_loc_bristol.jpg' alt='Bristol Offices'/><div style='padding:10px 8px 0px 8px;'>We have 2 Bristol Office Locations<br/><br/><a href='javascript:ZoomToLocation(llBristol);'>View our Bristol Office Locations</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficeLocsInfo[5] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Basingstoke</b></div><img class='popupinfo' src='/image/be_office_loc_basingstoke.jpg' alt='Basingstoke Offices'/><div style='padding:10px 8px 0px 8px;'>We have 1 Basingstoke Office Location<br/><br/><a href='javascript:ZoomToLocation(llBasingstoke);'>View our Basingstoke Office Location</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];

var arrOffices = new Array();
arrOffices[0] = ["Central Point",llLondonCentral.Latitude, llLondonCentral.Longitude,"/image/icon/office.gif"];
arrOffices[1] = ["150 Minories",llLondonMinories.Latitude, llLondonMinories.Longitude,"/image/icon/office.gif"];
arrOffices[2] = ["Watling Street",llLondonWatling.Latitude, llLondonWatling.Longitude,"/image/icon/office.gif"];
arrOffices[3] = ["1 Royal Exchange Ave",llLondonRoyal.Latitude, llLondonRoyal.Longitude,"/image/icon/office.gif"];
arrOffices[4] = ["Bristol CityPoint",llBristolCity.Latitude, llBristolCity.Longitude,"/image/icon/office.gif"];
arrOffices[5] = ["Bristol WestPoint",llBristolWest.Latitude, llBristolWest.Longitude,"/image/icon/office.gif"];
arrOffices[6] = ["Basingstoke ViewPoint",llBasingstokeView.Latitude, llBasingstokeView.Longitude,"/image/icon/office.gif"];
arrOffices[7] = ["Reading SoanePoint",llReadingSoane.Latitude, llReadingSoane.Longitude,"/image/icon/office.gif"];
arrOffices[8] = ["Milton Keynes 500 Avebury Boulevard",llMKAvebury.Latitude, llMKAvebury.Longitude,"/image/icon/office.gif"];
arrOffices[9] = ["Wembley 1 Olympic Way",llWembleyOW.Latitude, llWembleyOW.Longitude,"/image/icon/office.gif"];
arrOffices[10] = ["Threadneedle Street",llThreadneedle.Latitude, llThreadneedle.Longitude,"/image/icon/office.gif"];
arrOffices[11] = ["Westbourne Grove",llWestbourne.Latitude, llWestbourne.Longitude,"/image/icon/office.gif"];
arrOffices[12] = ["Fleet Street",llFleetStreet.Latitude, llFleetStreet.Longitude,"/image/icon/office.gif"];


var arrOfficesInfo = new Array();
arrOfficesInfo[0] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Central Point</b></div><img class='popupinfo' src='/image/be_office_cp.jpg' alt='Central Point Office'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=6&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'><a href='javascript:SwitchView(arrOffices[0][0]);'>View the close up satellite images!</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[1] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>150 Minories</b></div><img class='popupinfo' src='/image/be_office_min.jpg' alt='150 Minories Office'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=8&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'><a href='javascript:SwitchView(arrOffices[1][0]);'>View the close up satellite images!</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[2] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Watling Street</b></div><img class='popupinfo' src='/image/be_office_ws.jpg' alt='Watling Street Office'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=11&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'><a href='javascript:SwitchView(arrOffices[2][0]);'>View the close up satellite images!</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[3] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>1 Royal Exchange Ave</b></div><img class='popupinfo' src='/image/be_office_1re.jpg' alt='1 Royal Exchange Office'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=9&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'><a href='javascript:SwitchView(arrOffices[3][0]);'>View the close up satellite images!</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[4] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>CityPoint</b></div><img class='popupinfo' src='/image/be_office_bristol_cp.jpg' alt='CityPoint'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=1&office_id=1&maploc=bristol'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'><a href='javascript:SwitchView(arrOffices[4][0]);'>View the close up satellite images!</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[5] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>WestPoint</b></div><img class='popupinfo' src='/image/be_office_bristol_wp.jpg' alt='WestPoint'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=1&office_id=2&maploc=bristol'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'><a href='javascript:SwitchView(arrOffices[5][0]);'>View the close up satellite images!</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[6] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>ViewPoint</b></div><img class='popupinfo' src='/image/be_office_basingstoke_vp.jpg' alt='ViewPoint'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=2&office_id=3&maploc=basingstoke'>View the full office details</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[7] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>SoanePoint</b></div><img class='popupinfo' src='/image/be_office_reading_sp.jpg' alt='SoanePoint'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=3&office_id=4&maploc=reading'>View the full office details</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[8] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>500 Avebury Boulevard</b></div><img class='popupinfo' src='/image/be_office_mk_ab.jpg' alt='500 Avebury Boulevard'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=6&office_id=7&maploc=mk'>View the full office details</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[9] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>1 Olympic Way</b></div><img class='popupinfo' src='/image/be_office_wembley_ow.jpg' alt='1 Olympic Way'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=4&office_id=5&maploc=wembley'>View the full office details</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[10] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Threadneedle Street</b></div><img class='popupinfo' src='/image/be_office_threadneedle.jpg' alt='Threadneedle Street'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=12&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'><a href='javascript:SwitchView(arrOffices[10][0]);'>View the close up satellite images!</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[11] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Westbourne Grove</b></div><img class='popupinfo' src='/image/be_office_westbourne.jpg' alt='Westbourne Grove'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=13&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'><a href='javascript:SwitchView(arrOffices[11][0]);'>View the close up satellite images!</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo[12] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Fleet Street</b></div><img class='popupinfo' src='/image/be_office_fleetstreet.jpg' alt='Fleet Street'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=14&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'><a href='javascript:SwitchView(arrOffices[12][0]);'>View the close up satellite images!</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];

var arrOfficesInfo2 = new Array();
arrOfficesInfo2[0] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Central Point</b></div><img class='popupinfo' src='/image/be_office_cp.jpg' alt='Central Point Office'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=6&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[1] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>150 Minories</b></div><img class='popupinfo' src='/image/be_office_min.jpg' alt='150 Minories Office'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=8&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[2] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Watling Street</b></div><img class='popupinfo' src='/image/be_office_ws.jpg' alt='Watling Street Office'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=11&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[3] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>1 Royal Exchange Ave</b></div><img class='popupinfo' src='/image/be_office_1re.jpg' alt='1 Royal Exchange Office'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=9&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[4] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>CityPoint</b></div><img class='popupinfo' src='/image/be_office_bristol_cp.jpg' alt='CityPoint'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=1&office_id=1&maploc=bristol'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[5] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>WestPoint</b></div><img class='popupinfo' src='/image/be_office_bristol_wp.jpg' alt='WestPoint'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=1&office_id=2&maploc=bristol'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[6] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>ViewPoint</b></div><img class='popupinfo' src='/image/be_office_basingstoke_vp.jpg' alt='ViewPoint'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=2&office_id=3&maploc=basingstoke'>View the full office details</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[7] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>SoanePoint</b></div><img class='popupinfo' src='/image/be_office_reading_sp.jpg' alt='SoanePoint'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=3&office_id=4&maploc=reading'>View the full office details</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[8] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>500 Avebury Boulevard</b></div><img class='popupinfo' src='/image/be_office_mk_ab.jpg' alt='500 Avebury Boulevard'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=6&office_id=7&maploc=mk'>View the full office details</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[9] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>1 Olympic Way</b></div><img class='popupinfo' src='/image/be_office_wembley_ow.jpg' alt='1 Olympic Way'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=4&office_id=5&maploc=wembley'>View the full office details</a></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[10] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Threadneedle Street</b></div><img class='popupinfo' src='/image/be_office_threadneedle.jpg' alt='Threadneedle Street'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=12&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[11] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Westbourne Grove</b></div><img class='popupinfo' src='/image/be_office_westbourne.jpg' alt='Westbourne Grove'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=13&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];
arrOfficesInfo2[12] = ["<div style='width:156px;background-color:#d3d4d7;background-image:url(/image/be_map_info_header.gif);background-repeat:no-repeat;'><div style='padding:10px 20px 0px 0px;height:55px;'><b>Fleet Street</b></div><img class='popupinfo' src='/image/be_office_fleetstreet.jpg' alt='Fleet Street'/><div style='padding:10px 8px 0px 8px;'><a href='http://www.beoffices.com/site/rbs_be_loc_office.php?city_id=5&office_id=14&maploc=london'>View the full office details</a></div><div style='padding:10px 8px 0px 8px;'></div><br/><img src='/image/be_map_info_footer.gif'/></div>"];

var arrExtras = new Array();
arrExtras[0] = ["Bristol Train Station",llBristolTS.Latitude, llBristolTS.Longitude,"/image/icon/train.gif"];
arrExtras[1] = ["Milton Keynes Train Station",llMiltonKeynesTS.Latitude, llMiltonKeynesTS.Longitude,"/image/icon/train.gif"];
arrExtras[2] = ["Reading Train Station",llReadingTS.Latitude, llReadingTS.Longitude,"/image/icon/train.gif"];
arrExtras[3] = ["Basingstoke Train Station",llBasingstokeTS.Latitude, llBasingstokeTS.Longitude,"/image/icon/train.gif"];
arrExtras[4] = ["Wembley Tube Station",llWembleyTube.Latitude, llWembleyTube.Longitude,"/image/icon/tube.gif"];
arrExtras[5] = ["Barbican Tube Station",llCentralTube.Latitude, llCentralTube.Longitude,"/image/icon/tube.gif"];
arrExtras[6] = ["Mansion House Tube Station",llWatlingTube.Latitude, llWatlingTube.Longitude,"/image/icon/tube.gif"];
arrExtras[7] = ["Bank Tube Station",llRoyalTube.Latitude, llRoyalTube.Longitude,"/image/icon/tube.gif"];
arrExtras[8] = ["Aldgate Tube Station",llMinoriesTube.Latitude, llMinoriesTube.Longitude,"/image/icon/tube.gif"];

function GetMap()
{
	map = new VEMap('beMap');
	map.LoadMap(llBase, iCurrentZoomLevel,'h' ,false);
	map.HideDashboard();
	map.AddShapeLayer(layerOfficeLocs);
	AddOfficeLocations();

	map.AddShapeLayer(layerOffices);
	AddOffices();
	
	map.AddShapeLayer(layerOffices2);
	AddOffices2();	

	map.AddShapeLayer(layerExtras);
	AddExtras();

	layerOffices2.Hide();
	layerOffices.Hide();
	layerExtras.Hide();

	map.AttachEvent("onendzoom", ZoomHandler);
}

function ResetMap()
{
	map.SetMapStyle(VEMapStyle.Hybrid);
	iCurrentZoomLevel = 7;
	map.SetCenterAndZoom(llBase, iCurrentZoomLevel);
}

function ZoomToLocation(pLatLong)
{
	map.SetCenterAndZoom(pLatLong, 12);
}

function SwitchView(pOffice)
{
	switch (pOffice)
	{
		case "Central Point":
			map.SetCenter(llLondonCentral);
			setTimeout("map.SetMapStyle('o');",500);
			setTimeout("map.SetBirdseyeOrientation('North');",1000);	
			break; 
			
		case "150 Minories":
			map.SetCenter(llMinoriesZoom);
			setTimeout("map.SetMapStyle('o');",500);
			setTimeout("map.SetBirdseyeOrientation('West');",1000);			
			break;
			
		case "Watling Street":
			map.SetCenter(llWatlingZoom);
			setTimeout("map.SetMapStyle('o');",500);
			setTimeout("map.SetBirdseyeOrientation('West');",1000);			
			break;
			
		case "1 Royal Exchange Ave":
			map.SetCenter(llLondonRoyal);
			setTimeout("map.SetMapStyle('o');",500);
			setTimeout("map.SetBirdseyeOrientation('East');",1000);			
			break;
			
		case "Bristol CityPoint":
			map.SetCenter(llBristolCity);
			setTimeout("map.SetMapStyle('o');",500);
			setTimeout("map.SetBirdseyeOrientation('South');",1000);			
			break;
			
		case "Bristol WestPoint":
			map.SetCenter(llBristolWest);
			setTimeout("map.SetMapStyle('o');",500);
			setTimeout("map.SetBirdseyeOrientation('North');",1000);			
			break;		
			
		case "Wembley 1 Olympic Way":
			map.SetCenter(llWembleyOW);
			setTimeout("map.SetMapStyle('o');",500);
			setTimeout("map.SetBirdseyeOrientation('East');",1000);			
			break;		
			
		case "Threadneedle Street":
			map.SetCenter(llThreadneedle);
			setTimeout("map.SetMapStyle('o');",500);
			setTimeout("map.SetBirdseyeOrientation('North');",1000);			
			break;			
			
		case "Westbourne Grove":
			map.SetCenter(llWestbourne);
			setTimeout("map.SetMapStyle('o');",500);
			setTimeout("map.SetBirdseyeOrientation('North');",1000);			
			break;			
			
		case "Fleet Street":
			map.SetCenter(llFleetStreet);
			setTimeout("map.SetMapStyle('o');",500);
			setTimeout("map.SetBirdseyeOrientation('North');",1000);			
			break;					
	}		
}

function ZoomHandler(e)
{
	iCurrentZoomLevel = e.zoomLevel;

	if (iCurrentZoomLevel > 11)
	{
		layerOfficeLocs.Hide();
		layerOffices.Show();
		layerOffices2.Hide();
		layerExtras.Show();
	}
	else
	{
		if ((map.GetMapStyle = 'o')&&(iCurrentZoomLevel < 3))
		{
			layerOfficeLocs.Hide();
			layerOffices.Hide();
			layerOffices2.Show();
			layerExtras.Show();
		}
		else
		{
			layerOfficeLocs.Show();
			layerOffices.Hide();		
			layerOffices2.Hide();
			layerExtras.Hide();
		}
	}
	return true;
}

function AddOffices()
{
	var shape 		= null;
	var llOffice	= new VELatLong(arrOffices[0][1],arrOffices[0][2]);;

	for (var ii = 0; ii < arrOffices.length; ii++)
	{
		llOffice = new VELatLong(arrOffices[ii][1],arrOffices[ii][2]);
		shape = new VEShape(VEShapeType.Pushpin, llOffice);
		shape.SetCustomIcon(arrOffices[ii][3])
		map.ClearInfoBoxStyles();
		shape.SetTitle("");
		shape.SetDescription(arrOfficesInfo[ii].toString());
		pinid++;
		map.HideInfoBox();
		layerOffices.AddShape(shape);
	}
}

function AddOffices2()
{
	var shape 		= null;
	var llOffice	= new VELatLong(arrOffices[0][1],arrOffices[0][2]);;

	for (var ii = 0; ii < arrOffices.length; ii++)
	{
		llOffice = new VELatLong(arrOffices[ii][1],arrOffices[ii][2]);
		shape = new VEShape(VEShapeType.Pushpin, llOffice);
		shape.SetCustomIcon(arrOffices[ii][3])
		map.ClearInfoBoxStyles();
		shape.SetTitle("");
		shape.SetDescription(arrOfficesInfo2[ii].toString());
		pinid++;
		map.HideInfoBox();
		layerOffices2.AddShape(shape);
	}
}

function AddOfficeLocations()
{
	var shape 		= null;
	var llOfficeLoc	= new VELatLong(arrOfficeLocs[0][1],arrOfficeLocs[0][2]);;

	for (var ii = 0; ii < arrOfficeLocs.length; ii++)
	{
		llOfficeLoc = new VELatLong(arrOfficeLocs[ii][1],arrOfficeLocs[ii][2]);
		shape = new VEShape(VEShapeType.Pushpin, llOfficeLoc);
		shape.SetCustomIcon(arrOfficeLocs[ii][3])
		map.ClearInfoBoxStyles();
		shape.SetTitle("");
		shape.SetDescription(arrOfficeLocsInfo[ii].toString());
		pinid++;
		map.HideInfoBox();
		layerOfficeLocs.AddShape(shape);
	}
}

function AddExtras()
{
	var shape 		= null;
	var llExtra	= new VELatLong(arrExtras[0][1],arrExtras[0][2]);;

	for (var ii = 0; ii < arrExtras.length; ii++)
	{
		llExtra = new VELatLong(arrExtras[ii][1],arrExtras[ii][2]);
		shape = new VEShape(VEShapeType.Pushpin, llExtra);
		shape.SetCustomIcon(arrExtras[ii][3])
		map.ClearInfoBoxStyles();
		shape.SetTitle(arrExtras[ii][0]);
		//shape.SetDescription(arrOfficesInfo[ii].toString());
		pinid++;
		map.HideInfoBox();
		layerExtras.AddShape(shape);
	}
}
