	/* 1315317996 */

// LOCATIONS JavaScript Document FOR GOOGLE MAPS

//<![CDATA[
var cm_map;
var cm_mapMarkers = [];
var cm_mapHTMLS = [];
var cm_lats = [];
var cm_longs = [];

/**
 * Loads map and calls function to load in worksheet data.
 */
function cm_load() {  
  if (GBrowserIsCompatible()) {
    // create the map
    cm_map = new GMap2(document.getElementById("map_canvas"));
    cm_map.addControl(new GSmallZoomControl());
    cm_map.addControl(new GMapTypeControl());
	cm_map.setCenter(new GLatLng(53.330873, -2.042969), 6);
	// LOAD AMCADEMY POINTS
    cm_loadPoints();
	
  } else {
    alert("Sorry, the Google Maps API is not compatible with this browser");
  } 
}

/**
 * Function called when marker on the map is clicked.
 * Opens an info window (bubble) above the marker.
 * @param {Number} markerNum Number of marker in global array
 */
function cm_markerClicked(markerNum) {
  cm_mapMarkers[markerNum].openInfoWindowHtml(cm_mapHTMLS[markerNum]);
}

/**
 * Creates marker 
 */
function cm_createMarker(point, title, html, rank) {

  var newPoint = point;
  var marker = new GMarker(newPoint);

  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
	cm_map.setCenter(marker);
  });

  return marker;
}

/**
 * Defines locations and adds markers and infowindows to map
 */
function cm_loadPoints() {

  var title = "title";
  var rank = 0;

  // DEFINE THE LATS
  var cm_lats = new Array(
  	"53.776794",
	"53.479631",
	"54.971197",
	"53.682934",
	"53.38329",
	"52.472665",
	"52.910287",
	"52.685735",
	"51.993621",
	"51.267892",
	"51.631232",
	"51.512413",
	"52.037576",
	"51.749275",
	"51.375150",
	"51.908433",
	"51.401597", 
	"50.908675", 
	"51.451052", 
	"53.378605", 
	"53.761727", 
	"51.57787", 
	"51.665051", // WATFORD
	"52.627598", 
	"53.791197", 
	"52.405008", 
	"51.900429", 
	"51.270492", 
	"50.827382", 
	"51.508876", 
	"51.876105");
  
  // DEFINE THE LONGS
  var cm_longs = new Array(
  	"-1.582181",
	"-2.2328",
	"-1.612608",
	"-1.503912",
	"-2.595477",
	"-1.926792",
	"-1.451547",
	"-2.442377",
	"-1.253251",
	"-1.077497",
	"-0.750638",
	"-0.218803",
	"-0.769668",
	"-1.258300",
	"-0.090795",
	"-0.219169",
	"-0.849054", 
	"-1.413503", 
	"-2.587602", 
	"-1.473606", 
	"-2.692916", 
	"0.18503", 
	"-0.398878", // WATFORD
	"-1.127036", 
	"-1.752616", 
	"-1.510797", 
	"-2.083174", 
	"0.523754", 
	"-0.141835", 
	"-0.596201", 
	"-0.417149");

  var html = new Array();
  html[0] = "<div class='bubble'><strong>Leeds Training Centre:</strong><br>One City West, City West Office Park, Gelderd Road, Leeds, LS12 6NJ<br>T: 0113 279 6357</div>";
  html[1] = "<div class='bubble'><strong>Manchester Training Centre:</strong><br>111 Piccadilly, Manchester, M1 2HY<br>T: 0161 236 4447</div>";
  html[2] = "<div class='bubble'><strong>Newcastle Training Centre:</strong><br>2nd Floor, 2 Cathedral Square, Groat Market, Newcastle Upon Tyne, NE1 1EH<br>T: 0191 260 5045</div>";
  html[3] = "<div class='bubble'><strong>Wakefield Training Centre:</strong><br>First Floor, 2 Burgage Square, Mulberry Way, WF1 2TS<br>T: 01924 379 714 </div>";
  html[4] = "<div class='bubble'><strong>Warrington Training Centre:</strong><br>1110 Lakeside Drive, Centre Park, Warrington, WA1 1RY<br>T: 01925 244 879</div>";
  html[5] = "<div class='bubble'><strong>Birmingham Training Centre:</strong><br>2nd Floor, Kings House, 127 Hagley Road, Birmingham, B16 8LD<br>T: 0121 455 8767</div>";
  html[6] = "<div class='bubble'><strong>Derby Training Centre:</strong><br>3a Pride Point Drive, Pride Park, Derby, DE24 8BX<br>T: 01332 342 753</div>";
  html[7] = "<div class='bubble'><strong>Telford Training Centre:</strong><br>Grosvenor House, Central Park, Telford, TF2 9TW<br>T: 01952 291 204</div>";
  html[8] = "<div class='bubble'><strong>Banbury Training Centre:</strong><br>1st Floor, Blenheim Court, George Street, Banbury, OX16 5BH<br>T: 01295 252 670</div>";
  html[9] = "<div class='bubble'><strong>Basingstoke Training Centre:</strong><br>Level 3, Belvedere, Basing View, Basingstoke, RG21 4HG<br>T: 01256 478 626</div>";
  html[10] = "<div class='bubble'><strong>High Wycombe Training Centre:</strong><br>4 Priory Road, High Wycombe, HP13 6SE<br>T: 01494 446 391</div>";
  html[11] = "<div class='bubble'><strong>West London Training Centre:</strong><br>151 Freston Road, London, W10 6TH<br>T: 0207 221 9591</div>";
  html[12] = "<div class='bubble'><strong>Milton Keynes Training Centre:</strong><br>2nd Floor, Witan Court, 324 Witan Gate West, Milton Keynes, MK9 1EJ<br>T: 01908 674451</div>";
  html[13] = "<div class='bubble'><strong>Oxford Training Centre:</strong><br>2nd Floor, 1 Cambridge Terrace, Oxford, OX1 1RR<br>T: 01865 246 973</div>";
  html[14] = "<div class='bubble'><strong>Croydon Training Centre:</strong><br>Floor 22 & 23, No 1 Croydon, 12-16 Addiscombe Road, Croydon, CR0 0XT<br>T: 0208 680 6957</div>";
  html[15] = "<div class='bubble'><strong>Stevenage Training Centre:</strong><br>1st Floor, Essex House, Meadway Corporate Centre, Rutherford Close, Stevenage, SG1 2EF<br>T: 01438 316 742</div>";
  html[16] = "<div class='bubble'><strong>Wokingham Training Centre:</strong><br>Ground Floor, Imperial House, Oaklands Park, Wokingham, RG41 2FD<br>T: 0118 978 5436</div>";
  html[17] = "<div class='bubble'><strong>Southampton Training Centre:</strong><br>2nd Floor, Grenville House, Nelson Gate, Southampton, SO15 1GX<br>T: 02380 237 162</div>";
  html[18] = "<div class='bubble'><strong>Bristol Training Centre:</strong><br>2nd Floor, 101 Victoria Street, Bristol, BS1 6PU<br>T: 0117 927 7798</div>";
  html[19] = "<div class='bubble'><strong>Sheffield Training Centre:</strong><br>Milton House, Charter Row, Sheffield, S1 3FZ<br>T: 0114 272 2646</div>";
  html[20] = "<div class='bubble'><strong>Preston Training Centre:</strong><br>1st Floor, Ringway House, Percy Street, Preston, PR1 1HQ<br>T: 01772 251 626</div>";
  html[21] = "<div class='bubble'><strong>Romford Training Centre:</strong><br>3rd Floor, St James House, 27- 43 Eastern Road, Romford, Essex, RM1 3NH<br>T: 01708 740 281</div>";
  html[22] = "<div class='bubble'><strong>Watford Training Centre:</strong><br>Egale, 80 St Albans Road, Watford, WD17 1RP<br>T: 01923 252 431</div>";
  html[23] = "<div class='bubble'><strong>Leicester Training Centre:</strong><br>4th Floor, 86-92 Regent Road, Leicester, LE1 7DD<br>T: 0116 2545 261</div>";
  html[24] = "<div class='bubble'><strong>Bradford Training Centre:</strong><br>Ground Floor, No. 1, The Interchange, Nelson Street, Bradford, BD1 5AX<br> T: 01274 723 925</div>";
  html[25] = "<div class='bubble'><strong>Coventry Training Centre:</strong><br>Portal House, 163 New Union Street, Coventry, CV1 2PL<br> T: 02476 239 131</div>";
  html[26] = "<div class='bubble'><strong>Cheltenham Training Centre:</strong><br>Ground Floor, Festival House, Jessop Avenue, Cheltenham, GL50 3SH<br>T: 01242 253 391</div>";
  html[27] = "<div class='bubble'><strong>Maidstone Training Centre:</strong><br>2nd Floor, Kestrel House, Knightrider Street, Maidstone, ME15 6LU<br>T: 01622 686 420</div>"; 
  html[28] = "<div class='bubble'><strong>Brighton Training Centre:</strong><br>1st Floor, Queensbury House, 103-109 Queens Road, Brighton, BN1 3XF<br>T: 01273 727 178</div>";
  html[29] = "<div class='bubble'><strong>Slough Training Centre:</strong><br>Beechwood House, 10 Windsor Road, Slough, SL1 2EJ<br>T: 01753 535 338</div>";
  html[30] = "<div class='bubble'><strong>Luton Training Centre:</strong><br>6th Floor, Wesley House, 19 Chapel Street, Luton, LU1 5DA<br>T: 01582 482 167</div>";

  for (i=0; i<31; i++)
  {
	var point = new GLatLng(cm_lats[i],cm_longs[i]);
	// ADD THE MARKER
	var marker = cm_createMarker(point, title, html[i], rank);
	cm_map.addOverlay(marker);
	cm_mapMarkers.push(marker);
	cm_mapHTMLS.push(html[i]);
  }
  
}

//]]>
