  function CustomMarker(latlng,  map) {
    this.latlng_ = latlng;
 
    // Once the LatLng and text are set, add the overlay to the map.  This will
    // trigger a call to panes_changed which should in turn call draw.
    this.setMap(map);
  }
 
  CustomMarker.prototype = new google.maps.OverlayView();
 
  CustomMarker.prototype.draw = function() {
    var me = this;
 
    // Check if the div has been created.
    var div = this.div_;
    if (!div) {
      // Create a overlay text DIV
      div = this.div_ = document.createElement('DIV');
      // Create the DIV representing our CustomMarker
      div.style.border = "0px solid none";
      div.style.position = "absolute";
      div.style.paddingLeft = "0px";
      div.style.cursor = 'pointer';
 
      var img = document.createElement("img");
      img.src = "/favicon.ico";
      div.appendChild(img);
      google.maps.event.addDomListener(div, "click", function(event) {
        google.maps.event.trigger(me, "click");
      });
 
      // Then add the overlay to the DOM
      var panes = this.getPanes();
      panes.overlayImage.appendChild(div);
    }
 
    // Position the overlay 
    var point = this.getProjection().fromLatLngToDivPixel(this.latlng_);
    if (point) {
      div.style.left = point.x + 'px';
      div.style.top = point.y + 'px';
    }
  };
 
  CustomMarker.prototype.remove = function() {
    // Check if the overlay was on the map and needs to be removed.
    if (this.div_) {
      this.div_.parentNode.removeChild(this.div_);
      this.div_ = null;
    }
  };
 
  CustomMarker.prototype.getPosition = function() {
   return this.latlng_;
  };
 
  var map;
  var overlay;
  function initialize() {
    var opts = {
	  scrollwheel: false,
      zoom: 13,
      center: new google.maps.LatLng(52.998127501477505,  -1.1973274171352122),
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById("map"), opts);
	
	 var contentString = '<div id="mapcontent">'+
        '<div id="mapsiteNotice">'+
        '</div>'+
        '<h1 id="firstHeading" class="firstHeading"><a href="http://www.bradrail.co.uk">Bradrail Awnings &amp; Blinds <span>Nottingham</span></a></h1>'+
        '<div id="bodyContent">'+
        '<p>7 -15 Main Street, Bulwell, Nottingham, NG6 8QH.<br/>' +
        'Nottinghamshire. East Midlands.UK</p>'+
        '<p>Showroom, Manufacturing and Head Office'+
        '<br/>Open 9.00am till 5:30pm Monday to Saturday<br/>'+
        '</p>'+
        '<p class="smalltext"><a href="http://www.bradrail.co.uk/blinds/roller-blinds">Roller Blinds <span>Nottingham</span></a> | '+
		'<a href="http://www.bradrail.co.uk/blinds/vertical-blinds">Vertical Blinds <span>Nottingham</span></a> | '+
		'<a href="http://www.bradrail.co.uk/blinds/venetian-blinds">Venetian Blinds <span>Nottingham</span></a> | '+
		'<a href="http://www.bradrail.co.uk/blinds/pleated-blinds">Pleated Blinds <span>Nottingham</span></a> | '+ 
		'<a href="http://www.bradrail.co.uk/awnings">Awnings<span> Nottingham</span></a></p>'+
        '</div>'+
        '</div>';
 
    overlay = new CustomMarker(map.getCenter(), map);
    var iw = new google.maps.InfoWindow({content: contentString, pixelOffset: new google.maps.Size(5,0)});
    iw.open(map, overlay);
    google.maps.event.addListener(overlay, "click", function() {
      iw.open(map, overlay);
    });
  }
 
