var googleMap = null;
var directions = null;
var bannerImgEle = null;
var defaultBanner = new Image();
var directionsWindow = null;
var slideshowViewer = null;
var point22 = null;
var marker22 = null;
var markerHtml22 = '<strong>Directions to our Cottingham  - D. Partner Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_22" id="address_22" /></form><a href="#" onclick="return getDirections(22)">Get Directions</a>';
var storeImage22 = new Image();
	storeImage22.src = 'http://www.bushtyres.co.uk/library/banner_images/cottingham-banner.jpg';
	storeImage22.title = 'Cottingham MOT Centre';
	storeImage22.alt = 'Cottingham MOT Centre';
var point23 = null;
var marker23 = null;
var markerHtml23 = '<strong>Directions to our Beverley - D. Partner Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_23" id="address_23" /></form><a href="#" onclick="return getDirections(23)">Get Directions</a>';
var point20 = null;
var marker20 = null;
var markerHtml20 = '<strong>Directions to our Bridlington - D. Partner Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_20" id="address_20" /></form><a href="#" onclick="return getDirections(20)">Get Directions</a>';
var storeImage20 = new Image();
	storeImage20.src = 'http://www.bushtyres.co.uk/library/banner_images/tim-allsop.jpg';
	storeImage20.title = 'Tim Allsop';
	storeImage20.alt = 'Tim Allsop';
var point17 = null;
var marker17 = null;
var markerHtml17 = '<strong>Directions to our BAB Calibration Services  Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_17" id="address_17" /></form><a href="#" onclick="return getDirections(17)">Get Directions</a>';
var storeImage17 = new Image();
	storeImage17.src = 'http://www.bushtyres.co.uk/library/banner_images/calibration_services.jpg';
	storeImage17.title = 'Calibration Service Launched';
	storeImage17.alt = 'B.A.B launch new Calibrations Service, Call Paul Gillings on 07867 555588 for more info';
var point16 = null;
var marker16 = null;
var markerHtml16 = '<strong>Directions to our Centre Of Excellence Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_16" id="address_16" /></form><a href="#" onclick="return getDirections(16)">Get Directions</a>';
var storeImage16 = new Image();
	storeImage16.src = 'http://www.bushtyres.co.uk/library/banner_images/COE01.jpg';
	storeImage16.title = 'Centre of Excellence';
	storeImage16.alt = 'Bush Tyres Centre of Excellence';
var point7 = null;
var marker7 = null;
var markerHtml7 = '<strong>Directions to our Spilsby Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_7" id="address_7" /></form><a href="#" onclick="return getDirections(7)">Get Directions</a>';
var storeImage7 = new Image();
	storeImage7.src = 'http://www.bushtyres.co.uk/library/banner_images/SPILSBY01.jpg';
	storeImage7.title = 'Spilsby - External shot 01';
	storeImage7.alt = 'Bush Tyres Spilsby';
var point18 = null;
var marker18 = null;
var markerHtml18 = '<strong>Directions to our Spalding Commercial Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_18" id="address_18" /></form><a href="#" onclick="return getDirections(18)">Get Directions</a>';
var storeImage18 = new Image();
	storeImage18.src = 'http://www.bushtyres.co.uk/library/banner_images/spal_comm.jpg';
	storeImage18.title = 'Spalding Commercial';
	storeImage18.alt = 'Spalding Commercial';
var point13 = null;
var marker13 = null;
var markerHtml13 = '<strong>Directions to our Spalding Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_13" id="address_13" /></form><a href="#" onclick="return getDirections(13)">Get Directions</a>';
var storeImage13 = new Image();
	storeImage13.src = 'http://www.bushtyres.co.uk/library/banner_images/spalding_outside2.jpg';
	storeImage13.title = 'Spalding Store Outside 2';
	storeImage13.alt = 'Spalding';
var point5 = null;
var marker5 = null;
var markerHtml5 = '<strong>Directions to our Sleaford Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_5" id="address_5" /></form><a href="#" onclick="return getDirections(5)">Get Directions</a>';
var storeImage5 = new Image();
	storeImage5.src = 'http://www.bushtyres.co.uk/library/banner_images/sleaford01.jpg';
	storeImage5.title = 'Sleaford ';
	storeImage5.alt = 'Bush Tyres Sleaford';
var point6 = null;
var marker6 = null;
var markerHtml6 = '<strong>Directions to our Skegness Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_6" id="address_6" /></form><a href="#" onclick="return getDirections(6)">Get Directions</a>';
var storeImage6 = new Image();
	storeImage6.src = 'http://www.bushtyres.co.uk/library/banner_images/SKEGNESS01.jpg';
	storeImage6.title = 'Skegness - External shot 01';
	storeImage6.alt = 'Bush Tyres Skegness';
var point10 = null;
var marker10 = null;
var markerHtml10 = '<strong>Directions to our Scunthorpe Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_10" id="address_10" /></form><a href="#" onclick="return getDirections(10)">Get Directions</a>';
var storeImage10 = new Image();
	storeImage10.src = 'http://www.bushtyres.co.uk/library/banner_images/scunthorpe.jpg';
	storeImage10.title = 'Scunthorpe';
	storeImage10.alt = 'Scunthorpe Depot';
var point8 = null;
var marker8 = null;
var markerHtml8 = '<strong>Directions to our Louth Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_8" id="address_8" /></form><a href="#" onclick="return getDirections(8)">Get Directions</a>';
var storeImage8 = new Image();
	storeImage8.src = 'http://www.bushtyres.co.uk/library/banner_images/louth01.jpg';
	storeImage8.title = 'Louth - External shot 01';
	storeImage8.alt = 'Bush Tyres Louth';
var point3 = null;
var marker3 = null;
var markerHtml3 = '<strong>Directions to our Long Sutton Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_3" id="address_3" /></form><a href="#" onclick="return getDirections(3)">Get Directions</a>';
var storeImage3 = new Image();
	storeImage3.src = 'http://www.bushtyres.co.uk/library/banner_images/longsutton02.jpg';
	storeImage3.title = 'Long Sutton Store 2';
	storeImage3.alt = 'Long Sutton Store';
var point2 = null;
var marker2 = null;
var markerHtml2 = '<strong>Directions to our Kings Lynn Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_2" id="address_2" /></form><a href="#" onclick="return getDirections(2)">Get Directions</a>';
var storeImage2 = new Image();
	storeImage2.src = 'http://www.bushtyres.co.uk/library/banner_images/kingslynn02.jpg';
	storeImage2.title = 'Kings Lynn - External shot 02';
	storeImage2.alt = 'Bush Tyres Kings Lynn';
var point11 = null;
var marker11 = null;
var markerHtml11 = '<strong>Directions to our Hull - Stoneferry Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_11" id="address_11" /></form><a href="#" onclick="return getDirections(11)">Get Directions</a>';
var storeImage11 = new Image();
	storeImage11.src = 'http://www.bushtyres.co.uk/library/banner_images/hull01.jpg';
	storeImage11.title = 'Hull - External shot 01';
	storeImage11.alt = 'Bush Tyres Hull';
var point14 = null;
var marker14 = null;
var markerHtml14 = '<strong>Directions to our Hull - Spring Bank Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_14" id="address_14" /></form><a href="#" onclick="return getDirections(14)">Get Directions</a>';
var storeImage14 = new Image();
	storeImage14.src = 'http://www.bushtyres.co.uk/library/banner_images/hull_hiQ.jpg';
	storeImage14.title = 'Hull HiQ';
	storeImage14.alt = 'HiQ Hull';
var point21 = null;
var marker21 = null;
var markerHtml21 = '<strong>Directions to our Horncastle Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_21" id="address_21" /></form><a href="#" onclick="return getDirections(21)">Get Directions</a>';
var storeImage21 = new Image();
	storeImage21.src = 'http://www.bushtyres.co.uk/library/banner_images/horncastle02.jpg';
	storeImage21.title = 'Horncastle Branch 02';
	storeImage21.alt = 'Bush Tyres Horncastle - Head Quarters';
var point9 = null;
var marker9 = null;
var markerHtml9 = '<strong>Directions to our Grimsby Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_9" id="address_9" /></form><a href="#" onclick="return getDirections(9)">Get Directions</a>';
var storeImage9 = new Image();
	storeImage9.src = 'http://www.bushtyres.co.uk/library/banner_images/grimsby01.jpg';
	storeImage9.title = 'Grimsby - External shot 01';
	storeImage9.alt = 'Bush Tyres Grimsby';
var point1 = null;
var marker1 = null;
var markerHtml1 = '<strong>Directions to our Goole Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_1" id="address_1" /></form><a href="#" onclick="return getDirections(1)">Get Directions</a>';
var storeImage1 = new Image();
	storeImage1.src = 'http://www.bushtyres.co.uk/library/banner_images/goole.jpg';
	storeImage1.title = 'Goole';
	storeImage1.alt = 'Goole';
var point15 = null;
var marker15 = null;
var markerHtml15 = '<strong>Directions to our Bourne Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_15" id="address_15" /></form><a href="#" onclick="return getDirections(15)">Get Directions</a>';
var storeImage15 = new Image();
	storeImage15.src = 'http://www.bushtyres.co.uk/library/banner_images/bourne_banner.jpg';
	storeImage15.title = 'Bourne';
	storeImage15.alt = 'Bush Tyres in Bourne';
var point4 = null;
var marker4 = null;
var markerHtml4 = '<strong>Directions to our Boston Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_4" id="address_4" /></form><a href="#" onclick="return getDirections(4)">Get Directions</a>';
var storeImage4 = new Image();
	storeImage4.src = 'http://www.bushtyres.co.uk/library/banner_images/boston01.jpg';
	storeImage4.title = 'Bush Tyres, Boston';
	storeImage4.alt = 'Bush Tyres Boston';
var point12 = null;
var marker12 = null;
var markerHtml12 = '<strong>Directions to our Beverley Branch</strong><br />Enter your Postcode:<br /><form onsubmit="return false;" style="padding: 0px; margin:0px;"><input type="text" size="30" name="address_12" id="address_12" /></form><a href="#" onclick="return getDirections(12)">Get Directions</a>';
var storeImage12 = new Image();
	storeImage12.src = 'http://www.bushtyres.co.uk/library/banner_images/beverley01.jpg';
	storeImage12.title = 'Beverley - External shot 01';
	storeImage12.alt = 'Bush Tyres Beverley';
var markerCount = 22;

function GMapLoad() {
	bannerImgEle = document.getElementById('banner_img');
	defaultBanner.src = bannerImgEle.src;
	defaultBanner.alt = bannerImgEle.alt;
	defaultBanner.title = bannerImgEle.title;

	if (GBrowserIsCompatible()) {
		googleMap = new GMap2(document.getElementById("google_map"));
		googleMap.setCenter(new GLatLng(53.40953185308643, -0.186767578125), 6);
		googleMap.addControl(new GSmallMapControl());
		googleMap.addControl(new GMapTypeControl());

		// Create a yellow icon
		var yellowIcon = new GIcon(G_DEFAULT_ICON);
		yellowIcon.image = "/images/yellow_marker.png";
		yellowIcon.iconSize = new GSize(20, 34);
        
        var blueIcon = new GIcon(G_DEFAULT_ICON);
        blueIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
        blueIcon.iconSize = new GSize(32, 32);

        markerOptions22 = { icon:blueIcon, zIndexProcess: importanceOrder };        
        importance = 900;
		point22 = new GLatLng(53.783228, -0.407417);
		marker22 = new GMarker(point22, markerOptions22);
        marker22.importance = importance;
		GEvent.addListener(marker22, "click", function() {
			changeGoogleMap(22);
			//showStore(22);
		});
		googleMap.addOverlay(marker22);
        markerOptions23 = { icon:blueIcon, zIndexProcess: importanceOrder };        
        importance = 230;
		point23 = new GLatLng(53.846418, -0.424012);
		marker23 = new GMarker(point23, markerOptions23);
        marker23.importance = importance;
		GEvent.addListener(marker23, "click", function() {
			changeGoogleMap(23);
			//showStore(23);
		});
		googleMap.addOverlay(marker23);
        markerOptions20 = { icon:blueIcon, zIndexProcess: importanceOrder };        
        importance = 103;
		point20 = new GLatLng(54.090573, -0.203934);
		marker20 = new GMarker(point20, markerOptions20);
        marker20.importance = importance;
		GEvent.addListener(marker20, "click", function() {
			changeGoogleMap(20);
			//showStore(20);
		});
		googleMap.addOverlay(marker20);
        markerOptions17 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 101;
		point17 = new GLatLng(53.207623, -0.123569);
		marker17 = new GMarker(point17, markerOptions17);
        marker17.importance = importance;
		GEvent.addListener(marker17, "click", function() {
			changeGoogleMap(17);
			//showStore(17);
		});
		googleMap.addOverlay(marker17);
        markerOptions16 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 100;
		point16 = new GLatLng(53.207623, -0.123569);
		marker16 = new GMarker(point16, markerOptions16);
        marker16.importance = importance;
		GEvent.addListener(marker16, "click", function() {
			changeGoogleMap(16);
			//showStore(16);
		});
		googleMap.addOverlay(marker16);
        markerOptions7 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 17;
		point7 = new GLatLng(53.171169, 0.09417);
		marker7 = new GMarker(point7, markerOptions7);
        marker7.importance = importance;
		GEvent.addListener(marker7, "click", function() {
			changeGoogleMap(7);
			//showStore(7);
		});
		googleMap.addOverlay(marker7);
        markerOptions18 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 16;
		point18 = new GLatLng(52.807306, -0.147521);
		marker18 = new GMarker(point18, markerOptions18);
        marker18.importance = importance;
		GEvent.addListener(marker18, "click", function() {
			changeGoogleMap(18);
			//showStore(18);
		});
		googleMap.addOverlay(marker18);
        markerOptions13 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 15;
		point13 = new GLatLng(52.796867, -0.126257);
		marker13 = new GMarker(point13, markerOptions13);
        marker13.importance = importance;
		GEvent.addListener(marker13, "click", function() {
			changeGoogleMap(13);
			//showStore(13);
		});
		googleMap.addOverlay(marker13);
        markerOptions5 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 14;
		point5 = new GLatLng(53.003464, -0.413345);
		marker5 = new GMarker(point5, markerOptions5);
        marker5.importance = importance;
		GEvent.addListener(marker5, "click", function() {
			changeGoogleMap(5);
			//showStore(5);
		});
		googleMap.addOverlay(marker5);
        markerOptions6 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 13;
		point6 = new GLatLng(53.142065, 0.327753);
		marker6 = new GMarker(point6, markerOptions6);
        marker6.importance = importance;
		GEvent.addListener(marker6, "click", function() {
			changeGoogleMap(6);
			//showStore(6);
		});
		googleMap.addOverlay(marker6);
        markerOptions10 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 12;
		point10 = new GLatLng(53.572932, -0.619848);
		marker10 = new GMarker(point10, markerOptions10);
        marker10.importance = importance;
		GEvent.addListener(marker10, "click", function() {
			changeGoogleMap(10);
			//showStore(10);
		});
		googleMap.addOverlay(marker10);
        markerOptions8 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 11;
		point8 = new GLatLng(53.376457, -0.010662);
		marker8 = new GMarker(point8, markerOptions8);
        marker8.importance = importance;
		GEvent.addListener(marker8, "click", function() {
			changeGoogleMap(8);
			//showStore(8);
		});
		googleMap.addOverlay(marker8);
        markerOptions3 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 10;
		point3 = new GLatLng(52.77976, 0.135119);
		marker3 = new GMarker(point3, markerOptions3);
        marker3.importance = importance;
		GEvent.addListener(marker3, "click", function() {
			changeGoogleMap(3);
			//showStore(3);
		});
		googleMap.addOverlay(marker3);
        markerOptions2 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 9;
		point2 = new GLatLng(52.771607, 0.415364);
		marker2 = new GMarker(point2, markerOptions2);
        marker2.importance = importance;
		GEvent.addListener(marker2, "click", function() {
			changeGoogleMap(2);
			//showStore(2);
		});
		googleMap.addOverlay(marker2);
        markerOptions11 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 8;
		point11 = new GLatLng(53.762214, -0.327972);
		marker11 = new GMarker(point11, markerOptions11);
        marker11.importance = importance;
		GEvent.addListener(marker11, "click", function() {
			changeGoogleMap(11);
			//showStore(11);
		});
		googleMap.addOverlay(marker11);
        markerOptions14 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 7;
		point14 = new GLatLng(53.750248, -0.353515);
		marker14 = new GMarker(point14, markerOptions14);
        marker14.importance = importance;
		GEvent.addListener(marker14, "click", function() {
			changeGoogleMap(14);
			//showStore(14);
		});
		googleMap.addOverlay(marker14);
        markerOptions21 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 6;
		point21 = new GLatLng(53.207623, -0.123569);
		marker21 = new GMarker(point21, markerOptions21);
        marker21.importance = importance;
		GEvent.addListener(marker21, "click", function() {
			changeGoogleMap(21);
			//showStore(21);
		});
		googleMap.addOverlay(marker21);
        markerOptions9 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 5;
		point9 = new GLatLng(53.578743, -0.10974);
		marker9 = new GMarker(point9, markerOptions9);
        marker9.importance = importance;
		GEvent.addListener(marker9, "click", function() {
			changeGoogleMap(9);
			//showStore(9);
		});
		googleMap.addOverlay(marker9);
        markerOptions1 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 4;
		point1 = new GLatLng(53.702070, -0.889809);
		marker1 = new GMarker(point1, markerOptions1);
        marker1.importance = importance;
		GEvent.addListener(marker1, "click", function() {
			changeGoogleMap(1);
			//showStore(1);
		});
		googleMap.addOverlay(marker1);
        markerOptions15 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 3;
		point15 = new GLatLng(52.7673, -0.362538);
		marker15 = new GMarker(point15, markerOptions15);
        marker15.importance = importance;
		GEvent.addListener(marker15, "click", function() {
			changeGoogleMap(15);
			//showStore(15);
		});
		googleMap.addOverlay(marker15);
        markerOptions4 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 2;
		point4 = new GLatLng(52.983585, -0.021833);
		marker4 = new GMarker(point4, markerOptions4);
        marker4.importance = importance;
		GEvent.addListener(marker4, "click", function() {
			changeGoogleMap(4);
			//showStore(4);
		});
		googleMap.addOverlay(marker4);
        markerOptions12 = { icon:yellowIcon, zIndexProcess: importanceOrder };
        importance = 1;
		point12 = new GLatLng(53.848842, -0.410987);
		marker12 = new GMarker(point12, markerOptions12);
        marker12.importance = importance;
		GEvent.addListener(marker12, "click", function() {
			changeGoogleMap(12);
			//showStore(12);
		});
		googleMap.addOverlay(marker12);
		googleMap.setCenter(point10);
		googleMap.setZoom(15);
		marker10.openInfoWindowHtml(markerHtml10);
	}
}

function changeGoogleMap(id) {
	eval('googleMap.setCenter(point'+id+');');
	googleMap.setZoom(15);
	eval('marker'+id+'.openInfoWindowHtml(markerHtml'+id+');');
	return false;
}

function showStore(id) {
	document.getElementById('other_details').style.display = 'block';
	showStoreDetails(id, {target: 'store_details'});
	getStoreDescription(id, {target: 'store_description'});
//	getStoreServices(id, {target: 'services'});
	getStoreOpeningTimes(id, {target: 'opening_times'});
	getStoreGallerySet(id, {target: 'gallery'});

//	var storeImage = false;
//	eval('if(storeImage'+id+') { storeImage = storeImage'+id+'; }');
	if(typeof(window['storeImage'+id]) != "undefined") {
		eval('bannerImgEle.src = storeImage'+id+'.src;');
		eval('bannerImgEle.alt = storeImage'+id+'.alt;');
		eval('bannerImgEle.title = storeImage'+id+'.title;');
	}
}

function resetStoreList() {
	document.getElementById('other_details').style.display = 'none';
	showStoreList({target: 'store_details'});
	googleMap.setCenter(new GLatLng(53.40953185308643, -0.186767578125), 7);

	for(var x=1; x<=markerCount; x++){
		eval('marker'+x+'.closeInfoWindow();');
	}

	bannerImgEle.src = defaultBanner.src;
	bannerImgEle.alt = defaultBanner.alt;
	bannerImgEle.title = defaultBanner.title;

	return false;
}

function getDirections(id) {
	eval('var marker = marker'+id+';');
    
    addressEle = document.getElementById('address_'+id);

	if(addressEle.value == '') {
		alert('Please enter your Postcode');
		return false;
	}

//    url = 'http://maps.google.co.uk/maps?saddr='+escape(addressEle.value)+'&daddr='+getStoreAddress(id, {type: 'r'});
	url = 'http://maps.google.co.uk/maps?saddr='+escape(addressEle.value)+'&daddr='+marker.getPoint().lat()+','+marker.getPoint().lng();

	if(directionsWindow!=null && !directionsWindow.closed && directionsWindow.location) {
		directionsWindow.location.href = url;
	} else {
		directionsWindow = window.open(url, 'directions');
		if(!directionsWindow.opener) {
			directionsWindow.opener = self;
		}
	}

	if(window.focus) {
		directionsWindow.focus();
	}

	return false;
}

function importanceOrder (marker) {    
    return GOverlay.getZIndex(marker.getPoint().lat())
     + ((marker.importance-(marker.importance*2))*1000000);
} 

