    //<![CDATA[
	var _map;
	_locations=new Array(
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array(),
					new Array()
				);
	var _SEP = "<br>";
	var _currentPlace;
	var _directions;
    function load() {
	
		//Clare
	_locations[0]['area']="Clare";
	_locations[0]['address'] = "Allied Business Services, Clonroad Business Park, Clonroad, Ennis, Co. Clare.";
	_locations[0]['telephone'] = "(065) 6822424";
	_locations[0]['fax'] = "(065) 6841933";
	_locations[0]['mobile'] = "(085) 1265865 (B Ryan)";
	_locations[0]['dname'] = "Bernard Ryan";
	_locations[0]['email'] = "alliedbs@iol.ie";
	_locations[0]['lat']=52.843398;
	_locations[0]['lng']=-8.974564;	
	_locations[0]['show'] = 1;
		//Galway
	_locations[1]['area']="Galway";
	_locations[1]['address'] = "Senator Windows Ltd., Unit 1, Oranmore Business Park, Oranmore, Co Galway.";
	_locations[1]['telephone'] = "(091) 795554";
	_locations[1]['fax'] = "(091) 795558";
	_locations[1]['mobile'] = "(087) 2660978";
	_locations[1]['dname'] = "Peter Fallon";
	_locations[1]['email'] = "senatorgalway@eircom.net";
	_locations[1]['lat']=53.278007;
	_locations[1]['lng']=-8.927679;	
	_locations[1]['show'] = 1;	
		//Mayo
	_locations[2]['area']="Mayo";
	_locations[2]['address'] = "Senator Windows, McHale Retail Park, Castlebar, Co. Mayo."
	_locations[2]['telephone'] = "(094) 9025507";
	_locations[2]['fax'] = "(094) 9025791";
	_locations[2]['mobile'] = "";
	_locations[2]['dname'] = "Ger Sheil";
	_locations[2]['email'] = "senatormayo@eircom.net";
	_locations[2]['lat']=53.854526;
	_locations[2]['lng']=-9.301686;	
	_locations[2]['show'] = 0;	
		//Meath, Westmeath and Cavan
	_locations[3]['area']="Meath, Westmeath, Offaly and Cavan";
	_locations[3]['address'] = "Senator Windows, 11E Mullaghboy Ind Est, Athboy Road, Navan, Co. Meath."
	_locations[3]['telephone'] = "(046) 9075077";
	_locations[3]['fax'] = "(046) 9076711";
	_locations[3]['mobile'] = "(086) 3833052";
	_locations[3]['dname'] = "Gary Moran";
	_locations[3]['email'] = "gary.moran@senatorwindows.com";
	_locations[3]['lat']=53.645655;
	_locations[3]['lng']=-6.708784;	
	_locations[3]['show'] = 1;
	
	
	// Carlow
	_locations[4]['area']="Carlow";
	_locations[4]['address'] = "Senator Windows, Industrial Estate, O'Brien's Road, Off Dublin Road, Carlow."
	_locations[4]['telephone'] = "(059) 9132306";
	_locations[4]['fax'] = "(059) 9141266";
	_locations[4]['mobile'] = "(087) 2569497";
	_locations[4]['dname'] = "Michael Cowman";
	_locations[4]['email'] = "senatorcarlow@eircom.net";
	_locations[4]['lat']=52.83975;
	_locations[4]['lng']=-6.910325;	
	_locations[4]['show'] = 1;
	
	// Wexford
	_locations[5]['area']="Wexford – Head Office";
	_locations[5]['address'] = "Seaview Industrial Estate, Wexford, Ireland."
	_locations[5]['telephone'] = "+353(0) 53 9141522";
	_locations[5]['fax'] = "+353(0) 53 9141524";
	_locations[5]['mobile'] = "";
	_locations[5]['dname'] = "";
	_locations[5]['email'] = "info@senatorcommercial.ie";
	_locations[5]['lat']=52.330225;
	_locations[5]['lng']=-6.45009;	
	_locations[5]['show'] = 1;	

	
	// Waterford
	_locations[6]['area']="Waterford";
	_locations[6]['address'] = "Manor Village, Cork Road, Waterford."
	_locations[6]['telephone'] = "(051) 333866";
	_locations[6]['fax'] = "(051) 333877";
	_locations[6]['mobile'] = "(087) 9106344";
	_locations[6]['dname'] = "Ned Kelly";
	_locations[6]['email'] = "waterford@senatorwindows.com";
	_locations[6]['lat']=52.246459;
	_locations[6]['lng']=-7.145405;	
	_locations[6]['show'] = 1;	
	
	// CARRICK-ON-SUIR
	//_locations[8]['area']="Carrick-On-Suir";
	//_locations[8]['address'] = "Babington Windows, Willow Crest, Lower Ballylinch, Carrick-on-Suir, Co. Tipperary."
	//_locations[8]['telephone'] = "(051) 640906";
	//_locations[8]['fax'] = "(051) 641293";
	//_locations[8]['mobile'] = "(086) 2622270";
	//_locations[8]['dname'] = "Paud Babington";
	//_locations[8]['email'] = "babingtonwindows@eircom.net";
	//_locations[8]['lat']=52.347098;
	//_locations[8]['lng']=-7.39676;	
	
	// LIMERICK
	_locations[7]['area']="Limerick";
	_locations[7]['address'] = "Unit G1 Eastway Business Park, Ballysimon Road, Limerick."
	_locations[7]['telephone'] = "(061) 414700";
	_locations[7]['fax'] = "(061) 468552";
	_locations[7]['mobile'] = "087 9237720";
	_locations[7]['dname'] = "Aidan Forde";
	_locations[7]['email'] = "limerick@senatorwindows.com";
	_locations[7]['lat']=52.652124;
	_locations[7]['lng']=-8.59251;	
	_locations[7]['show'] = 1;	
	
	// Mallow
	_locations[8]['area']="Mallow";
	_locations[8]['address'] = "Senator Windows, Bowling Green, Mallow, Co Cork"
	_locations[8]['telephone'] = "(022) 20188";
	_locations[8]['fax'] = "(022) 43507";
	_locations[8]['mobile'] = "(087) 2565270";
	_locations[8]['dname'] = "Hugh Twomey";
	_locations[8]['email'] = "";
	_locations[8]['lat']=52.138835;
	_locations[8]['lng']=-8.645124;	
	_locations[8]['show'] = 1;	
	
	// Cork
	_locations[9]['area']="Cork";
	_locations[9]['address'] = "Senator Windows Ltd, Kinsale Road Commercial Centre, Cork."
	_locations[9]['telephone'] = "(021) 4961611";
	_locations[9]['fax'] = "(021) 4963227";
	_locations[9]['mobile'] = "(086) 2457094";
	_locations[9]['dname'] = "Noel Murphy";
	_locations[9]['email'] = "senatorpvc@eircom.net";
	_locations[9]['lat']=51.872053;
	_locations[9]['lng']=-8.475051;	
	_locations[9]['show'] = 1;	
	
	// Bandon
	//_locations[10]['area']="Bandon";
	//_locations[10]['address'] = "Senator Windows, Rearour, Ballinahassig, Co. Cork."
	//_locations[10]['telephone'] = "(021) 4885284";
	//_locations[10]['fax'] = "(021) 4885284";
	//_locations[10]['mobile'] = "(087) 2599083";
	//_locations[10]['dname'] = "Michael Shanahan";
	//_locations[10]['email'] = "michaelshanahanwindows@eircom.net";
	//_locations[10]['lat']=51.897857;
	//_locations[10]['lng']=-8.471071;
	
	// Kerry
	_locations[10]['area']="Kerry";
	_locations[10]['address'] = "Senator Windows, Tralee Road, Killarney, Co. Kerry";
	_locations[10]['telephone'] = "(064) 31195";
	_locations[10]['fax'] = "(064) 30238";
	_locations[10]['mobile'] = "(087) 2695562";
	_locations[10]['dname'] = "Joe O'Carroll";
	_locations[10]['email'] = "senator.kerry@oceanfree.net";
	_locations[10]['lat']=52.06695;
	_locations[10]['lng']=-9.499655;
	_locations[10]['show'] = 1;	
	
	// DUBLIN (SANTRY)
	_locations[11]['area']="Dublin (Santry)";
	_locations[11]['address'] = "Senator Windows, Unit 15, Viscount Avenue, Airways Industrial Estate, Santry, Dublin 17";
	_locations[11]['telephone'] = "(01) 8369944";
	_locations[11]['fax'] = "(01) 8360246";
	_locations[11]['mobile'] = "";
	_locations[11]['dname'] = "";
	_locations[11]['email'] = "senator1@senator-windows.ie";
	_locations[11]['lat']=53.346555;
	_locations[11]['lng']=-6.2677;
	_locations[11]['show'] = 1;	
	
	// DUBLIN (CHURCHTOWN)
	_locations[12]['area']="Dublin (Churchtown)";
	_locations[12]['address'] = "Senator Windows, Unit 12 , Churchtown Business Park, Churchtown, Dublin 14.";
	_locations[12]['telephone'] = "(01) 2986249, <strong>Callsave</strong>: 1850 500 111";
	_locations[12]['fax'] = "(01) 2985804";
	_locations[12]['mobile'] = "";
	_locations[12]['dname'] = "Louis Ruane";
	_locations[12]['email'] = "senator1@senator-windows.ie";
	_locations[12]['lat']=53.452461;
	_locations[12]['lng']=-6.182685;
	_locations[12]['show'] = 1;	

	// DUNDALK
	_locations[13]['area']="Dundalk";
	_locations[13]['address'] = "Senator Windows Ltd, Ard Easmuinn Road, Dundalk, Co. Louth.";
	_locations[13]['telephone'] = "(042) 9333513 <strong>Callsave</strong> (1850) 214 314";
	_locations[13]['fax'] = "(042) 9333514 ";
	_locations[13]['mobile'] = "(+44) 7801 676573, (087) 1220700";
	_locations[13]['dname'] = "Jimmy McCreesh";
	_locations[13]['email'] = "senatorwindowsdundalk@yahoo.com";
	_locations[13]['lat']=54.004793;
	_locations[13]['lng']=-6.41696;
	_locations[13]['show'] = 1;	
	
	// Athlone
	_locations[14]['area']="Athlone";
	_locations[14]['address'] = "Unit 3, Centre Court, Blyry Industrial Estate, Athlone, Co. Westmeath";
	_locations[14]['telephone'] = "(090) 647 4685, (090) 647 4678";
	_locations[14]['fax'] = "(090) 647 6837";
	_locations[14]['mobile'] = "086 8702379";
	_locations[14]['dname'] = "Roy Glennon";
	_locations[14]['email'] = "";
	_locations[14]['lat']=53.431628;
	_locations[14]['lng']=-7.897668;	
	_locations[14]['show'] = 1;	
	
	// COLERAINE
	_locations[15]['area']="Colaraine";
	_locations[15]['address'] = "Senator Windows, 31 Sperrin Business Park, Ballycastle Road, Coleraine, BT52 2DH.";
	_locations[15]['telephone'] = "(028) 7034 4488";
	_locations[15]['fax'] = "(028) 7035 8777";
	_locations[15]['mobile'] = "07802 337798 (+0044 ROI)";
	_locations[15]['dname'] = "Gordon Hemphill";
	_locations[15]['email'] = "sales@senatorwindows.co.uk";
	_locations[15]['lat']=55.133078;
	_locations[15]['lng']=-6.654046;
	_locations[15]['show'] = 1;	
	
	
	// Belfast

	//_locations[16]['area']="Belfast";
	//_locations[16]['address'] = "Senator Window, Balklinahinch, Belfast ";
	//_locations[16]['telephone'] = "048 9756 4417 (048 from ROI only)";
	//_locations[16]['fax'] = "048 9756 4416";
	//_locations[16]['mobile'] = "00 44 7710 823820 ";
	//_locations[16]['dname'] = "Gerry Pettigrew";
	//_locations[16]['email'] = "belfast@senatorwindows.ie";
	//_locations[16]['lat']=54.509797;
	//_locations[16]['lng']=-5.892406;
	
	
	// THURLES
	_locations[16]['area']="Thurles";
	_locations[16]['address'] = "Pat Ryan Windows Ltd., Slievenamon Road, Thurles, Co. Tipperary.";
	_locations[16]['telephone'] = "(0504) 23188";
	_locations[16]['fax'] = "(0504) 23660";
	_locations[16]['mobile'] = "(087) 2559860";
	_locations[16]['dname'] = "Pat Ryan";
	_locations[16]['email'] = "pryanglazingsystems@eircom.net";
	_locations[16]['lat']=52.674795;
	_locations[16]['lng']=-7.812202;
	_locations[16]['show'] = 1;	
	
	// Sligo, Leitrim, Roscommon
	_locations[17]['area']="Sligo, Leitrim, Roscommon";
	_locations[17]['address'] = "Senator Windows Ltd Unit 8, Duncan’s Island, Finisklin Road, Co. Sligo.";
	_locations[17]['telephone'] = "(071) 9142288";
	_locations[17]['fax'] = "(071) 9174128";
	_locations[17]['mobile'] = "(087) 9701943 - M Merrick, (087) 2799154 - P Casey";
	_locations[17]['dname'] = "Michael Merrick ";
	_locations[17]['email'] = "senatorsligo@eircom.net";
	_locations[17]['lat']=54.298896;
	_locations[17]['lng']=-8.464966;	
	_locations[17]['show'] = 1;	


	// Kilkenny
	_locations[18]['area']="Kilkenny";
	_locations[18]['address'] = "Seskin, Windgap, Co Kilkenny"
	_locations[18]['telephone'] = "056 7770024";
	_locations[18]['fax'] = "";
	_locations[18]['mobile'] = "087 9455674";
	_locations[18]['dname'] = "Richard Landy";
	_locations[18]['email'] = "richard.landy@senatorwindows.ie";
	_locations[18]['lat']=52.460907;
	_locations[18]['lng']=-7.400415	

	//DONEGAL
	_locations[19]['area']="Donegal";
	_locations[19]['address'] = "Benroe, Bruckless, Co Donegal ";
	_locations[19]['telephone'] = "074 9722142";
	_locations[19]['fax'] = "";
	_locations[19]['mobile'] = "087 9456249";
	_locations[19]['dname'] = "Declan Sherlock";
	_locations[19]['email'] = "declan.sherlock@senatorwindows.ie";
	_locations[19]['lat']=54.640233;
	_locations[19]['lng']=-8.384814;

      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		this._map=map;
		var point;
	    var directionsPanel = document.getElementById("route");
		var directions = new GDirections(map, directionsPanel);
	    this._directions=directions;
		
		var bounds = new GLatLngBounds();

		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		
		//sort
		_locations.sort(sortByArea);
		//move wexford on top
		temp_loc = _locations.pop();
		_locations.unshift(temp_loc);
		for (var i=0; i<_locations.length; i++) {
			if (_locations[i]['area'] != 0 && _locations[i]['show'] != 0) {
				point = addPoint(map,i);
				bounds.extend(point);
				var z = document.getElementById('areas').appendChild(document.createElement("li"));
				anch = document.createElement('a')
				anch.href = '#';
				anch.onclick = new Function(
						'switchLocation(' + i + ');return false;'
				);
				a = z.appendChild(anch);
				//a.setAttribute('onClick', 'switchLocation(' + i + '); return false;');
				a.appendChild(document.createTextNode(_locations[i]['area']));
			}
			
		}
		map.setCenter(bounds.getCenter(), 7);
		
		
		
      }
	  
	  function addPoint(map,locationID) {
	  	var point = new GLatLng(_locations[locationID]['lat'], _locations[locationID]['lng']);
		var street=new GMarker(point);
		//map.setCenter(point, 13);
  		map.addOverlay(street);
		GEvent.addListener(street, "click", function() {
			map.openInfoWindow(point, getDescription(locationID));
		});
		
		return point;
	  }
	 
	}
	function showDirections(from, to) {
		_directions.load(from + " to " + to);
	}	
	function switchLocation(locationID) {
		var point=new GLatLng(_locations[locationID]['lat'], _locations[locationID]['lng']);
		 panTo(point);
		_map.openInfoWindow(point, getDescription(locationID));
	}
	function panTo(point) {
	 	_map.panTo(point);
	}
	
	function getDescription(id) {
		//var description = "<p><strong>Area:</strong> " + _locations[id]['area'] + _SEP + _locations[id]['address'] + _SEP + "<strong>Tel:</strong> " + _locations[id]['telephone'] +
		//							_SEP + "<strong>Fax:</strong> " + _locations[id]['fax'] + _SEP + "<strong>Mobile:</strong> " + _locations[id]['mobile'] + 
		//							_SEP + "<strong>Dealer\'s Name:</strong> " + _locations[id]['dname'] + _SEP + "<strong>Email:</strong> <a href='mailto:" + _locations[id]['email'] + "'>" + _locations[id]['email'] + "</a></p>";
		//without dealear name and phone no.							
		var description = "<p><strong>Area:</strong> " + _locations[id]['area'] + _SEP + _locations[id]['address'] + _SEP + "<strong>Tel:</strong> " + _locations[id]['telephone'] +
									_SEP + "<strong>Fax:</strong> " + _locations[id]['fax']  + 
									 _SEP + "<strong>Email:</strong> <a href='mailto:" + _locations[id]['email'] + "'>" + _locations[id]['email'] + "</a></p>";									
		return description;
	}
	function sortByArea(a, b) {
   		var x = a.area.toLowerCase();
	    var y = b.area.toLowerCase();
    	return ((x < y) ? -1 : ((x > y) ? 1 : 0));
	}
    //]]>
