if (document.getElementsByTagName) {
	// Create a link to the Javascript-only stylesheet, which will primarily hide the hidden text
	var $link_element = document.createElement('link');
	$link_element.setAttribute("rel","stylesheet");
	$link_element.setAttribute("href","/sys/styles/nomap.css");
	$link_element.setAttribute("media","screen");
	$link_element.setAttribute("type","text/css");
	// Append this stylesheet link to the document
	var $head_element = document.getElementsByTagName('head')[0];
	$head_element.appendChild($link_element);
}

function mapstyles(id,height,width,border,margin){
   if (document.getElementById) {
      var mapstyles = document.getElementById(id);
      mapstyles.style.height = height;
      mapstyles.style.width = width;
      mapstyles.style.border = border;
	  mapstyles.style.margin = margin;
   }
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function loadmap() {
	mapstyles('map','300px','400px','1px solid #000','0 auto 18px');
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GOverviewMapControl());		
		var loc=new GLatLng(51.807447234789606,-1.6370058059692383); // lat and lon
		map.setCenter(loc, 17); // start map
		var marker=new GMarker(loc);
		map.addOverlay(marker);
	}
}

addLoadEvent(loadmap);
