﻿//<![CDATA[
if (GBrowserIsCompatible()) {

    var map = new GMap2(document.getElementById("map"));
    //Create Co-ordinates
    var ASlng = 0.094099;
    var ASlat = 53.174555;
    var showPoint = new GLatLng(ASlat, ASlng);
    //Add Controls and centre map
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.addControl(new GOverviewMapControl);
    map.setCenter(showPoint, 16);
    //create logo image
    var icon = new GIcon();
    icon.image = "googleMap/s.png"; icon.shadow = "googleMap/sShadow.png";
    icon.iconSize = new GSize(46, 19);
    icon.shadowSize = new GSize(46, 19);
    icon.iconAnchor = new GPoint(20, 5);
    icon.infoWindowAnchor = new GPoint(15, 5);
    var ASmarker = new GMarker(showPoint, icon);
    //create html
    var html = '<div id="mapTxt">' +
		'<div id="title"><strong>LRHA Ltd</strong><br />Markime House<br />Pooles Lane<br />Spilsby<br />Lincolnshire<br />PE23 5EY</div></div>';
    var html0 = '';
    var html1 = '';
    var html2 = '';
    //var html0 = '<br />Directions: <a href="javascript:tohere();">To LRHA</a> - <a href="javascript:fromhere();">From LRHA</a></div>';
    //var html1 = '<br />Directions: To LRHA</b> - <a href="javascript:fromhere();">From LRHA</a><br>Start address or Postcode:<form action="http://maps.google.co.uk/maps" method="get" target="_blank" style="margin:0px;"><input type="text" name="saddr" id="saddr" value="" class="formele" style="width:150px;" /> <INPUT value="Get Directions" TYPE="SUBMIT" class="formbtn" style="width:150px;" />' +
	//	'<input type="hidden" name="daddr" value="' + ASlat + ',' + ASlng + "(LRHA)" + '"/></form></div>';
    //var html2 = '<br />Directions: <a href="javascript:tohere();">To LRHA</a> - <b>From LRHA</b><br>End address or Postcode:<form action="http://maps.google.co.uk/maps" method="get"" target="_blank" style="margin:0px;"><input type="text" name="daddr" id="daddr" value="" class="formele" style="width:150px;" /> <INPUT value="Get Directions" TYPE="SUBMIT" class="formele" style="width:150px;" />' +
	//	'<input type="hidden" name="saddr" value="' + ASlat + ',' + ASlng + "(LRHA)" + '" /></form></div>';

    //Add Logo and Info Window
    function AScreateMarker(showPoint) {
        map.addOverlay(ASmarker);
        ASmarker.openInfoWindowHtml(html + html0);
        GEvent.addListener(ASmarker, "click", function() {
            ASmarker.openInfoWindowHtml(html + html0);
        });
        return ASmarker;
    }
    AScreateMarker(showPoint);
    function tohere() {
        ASmarker.openInfoWindowHtml(html + html1);
    }
    function fromhere() {
        ASmarker.openInfoWindowHtml(html + html2);
    }


} else {
    document.getElementById("map").innerHTML = "Sorry, your browser isn't compatible with Google Maps";
}

//]]>