function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
function mapstyles(id,height,width,border){
   if (document.getElementById) {
      var mapstyles = document.getElementById(id);
      mapstyles.style.height = height;
      mapstyles.style.width = width;
      mapstyles.style.border = border;
   }
}

function createMarker(point, establishment, idname, html) {
		var icon = new GIcon();
		icon.image = "small_house.png";
		icon.iconSize = new GSize(26,26);
		icon.iconAnchor = new GPoint(13,13);
		icon.infoWindowAnchor = new GPoint(13,13);
		icon.transparent="small_house_trans.png";
		icon.imageMap=[0,0,0,26,26,26,26,0];

	var marker = new GMarker(point,icon);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml("<b>" + establishment + "<\/b>");
		show_mdetails('mdetails');
		document.getElementById('intro_text').innerHTML = html;
	});
	return marker;
}


function loadmap() {
	if (GBrowserIsCompatible()) {
		mapstyles('map','400px','520px','1px solid #ccc');

		var icon = new GIcon();
		icon.image = "small_house.png";
		icon.iconSize = new GSize(26,26);
		icon.iconAnchor = new GPoint(13,26);
		icon.infoWindowAnchor = new GPoint(13,13);
		icon.transparent="small_house_trans.png";
		icon.imageMap=[0,0,0,26,26,26,26,0];

		var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());

		var loc=new GLatLng(51.825,-1.25);
		map.setCenter(loc, 9);

 var point = new GLatLng(51.9934,-1.5802);
 map.addOverlay(createMarker(point, "Yerdley Farm", "yerdley", "<h3><a href='yerdley-farm/'>Yerdley Farm</a></h3><a href='yerdley-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Yerdley Farm.jpg'></a><p>The farm house and tallet barn annexe enjoy a quiet position in Vicarage Lane, Long Compton, 16 miles south of Stratford upon Avon.<p><p><h4><a href='yerdley-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

 var point = new GLatLng(52.0715,-1.477);
 map.addOverlay(createMarker(point, "Yarnhill Farm", "yarnhill", "<h3><a href='yarnhill-farm/'>Yarnhill Farm</a></h3><a href='yarnhill-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Yarnhill Farm.jpg'></a><p>We would like to welcome you to our family run beef and sheep farm which is situated on the edge of the Cotswolds near the site of the famous Battle of Edgehill, in an area of outstanding natural beauty.<p><p><h4><a href='yarnhill-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

 var point = new GLatLng(51.6775,-1.6832);
 map.addOverlay(createMarker(point, "Weston Farm", "weston", "<h3><a href='weston-farm/'>Weston Farm</a></h3><a href='weston-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Weston Farm.jpg'></a><p>We would like to welcome you to Weston Farm, where you can relax and recharge your batteries in total peace and quiet.<p><p><h4><a href='weston-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.8392,-1.0432);
 map.addOverlay(createMarker(point, "Poletrees Farm", "poletrees", "<h3><a href='poletrees-farm/'>Poletrees Farm</a></h3><a href='poletrees-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Poletrees Farm.jpg'></a><p>We welcome couples to Poletrees Farm, sitting in its wooded valley, for that quiet break.<p><p><h4><a href='poletrees-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.8255,-1.3786);
 map.addOverlay(createMarker(point, "Old Farmhouse", "old", "<h3><a href='old-farmhouse/'>Old Farmhouse</a></h3><a href='old-farmhouse/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Old Farmhouse.jpg'></a><p>Old Farmhouse dates back to 1670 and is full of charm and character with many original features. Our charming bedrooms have very comfy beds and far reaching country views over fields and sheep.<p><p><h4><a href='old-farmhouse/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.9403,-1.3099);
 map.addOverlay(createMarker(point, "Home Farm House", "homefarm", "<h3><a href='home-farm-house/'>Home Farm House</a></h3><a href='home-farm-house/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Home Farm House.jpg'></a><p>Home Farm House dates from the 1650s and stands at the edge of the charming little village of Middle Aston with sweeping views over the Cherwell Valley.<p><p><h4><a href='home-farm-house/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.7969,-1.5176);
 map.addOverlay(createMarker(point, "Hill Grove Farm", "hill", "<h3><a href='hill-grove-farm/'>Hill Grove Farm</a></h3><a href='hill-grove-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Hill Grove Farm.jpg'></a><p>Hill Grove Farm is situated on the Cotswold Borders. A 300 acre, mainly arable working farm with cattle, free range poultry, two dogs and two friendly donkeys fostered from the Donkey Sanctuary in Devon.<p><p><h4><a href='hill-grove-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.83,-1.4241);
 map.addOverlay(createMarker(point, "Forge Cottage<br>Elbie House", "hill", "<h3><a href='forge-cottage/'>Forge Cottage</a></h3><a href='forge-cottage/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Forge Cottage.jpg'></a><p>We are ideally situated in the Cotswold countryside, with footpaths and bridleways radiating from our cottage. These provide wonderful walking in open fields, woods and along riversides.<p><p><h4><a href='forge-cottage/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p><h3><a href='elbie-house/'>Elbie House</a></h3><a href='elbie-house/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Elbie House.jpg'></a><p>Elbie House is a large stone house which nestles in the peaceful hamlet of East End. Complete and extensive restoration has created a warm and luxurious home.<p><p><h4><a href='elbie-house/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.6177,-1.0694);
 map.addOverlay(createMarker(point, "Fords Farm", "fords", "<h3><a href='fords-farm/'>Fords Farm</a></h3><a href='fords-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Fords Farm.jpg'></a><p>Fords Farm is set in the heart of the village of Ewelme, famous for its C15th church, Almshouses and school - a visit that should not be missed if you have time to relax and walk around this bit of true old England.<p><p><h4><a href='fords-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.6775,-1.6832);
 map.addOverlay(createMarker(point, "Weston Farm", "westonfarm", "<h3><a href='weston-farm/'>Weston Farm</a></h3><a href='weston-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Weston Farm.jpg'></a><p>We would like to welcome you to Weston Farm, where you can relax and recharge your batteries in total peace and quiet.<p><p><h4><a href='weston-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.887,-1.6468);
 map.addOverlay(createMarker(point, "Bould Farm", "bould", "<h3><a href='bould-farm/'>Bould Farm</a></h3><a href='bould-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Bould Farm.jpg'></a><p>Our C17th Cotswold farmhouse is set in a large garden overlooking beautiful countryside.<p><p><h4><a href='bould-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.886,-1.4717);
 map.addOverlay(createMarker(point, "Banbury Hill Farm", "banbury", "<h3><a href='banbury-hill-farm/'>Banbury Hill Farm</a></h3><a href='banbury-hill-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Banbury Hill Farm.jpg'></a><p>Banbury Hill Farmhouse lies in the midst of rolling, wooded farmland of the Oxfordshire Cotswolds.<p><p><h4><a href='banbury-hill-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.8318,-1.5656);
 map.addOverlay(createMarker(point, "Potters Hill Farm", "potters", "<h3><a href='potters-hill-farm/'>Potters Hill Farm</a></h3><a href='potters-hill-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Potters Hill Farm.jpg'></a><p>Set in 15 acres of peaceful, mature parkland, supporting diverse bird and wildlife, producing wheat, barley, linseed, beans and oilseed rape with a breeding flock of 400 breeding ewes.<p><p><h4><a href='potters-hill-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(52.0147,-1.0717);
 map.addOverlay(createMarker(point, "Huntsmill Farm", "huntsmill", "<h3><a href='huntsmill-farm/'>Huntsmill Farm</a></h3><a href='huntsmill-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Huntsmill Farm.jpg'></a><p>Huntsmill Farm is situated mid-way between the Market Towns of Buckingham & Brackley, close to Stowe Gardens and Silverstone Circuit; an ideal touring base for Oxford & the Cotswolds. The farm courtyard is in a delightfully peaceful spot, overlooking rolling countryside.<p><p><h4><a href='huntsmill-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.94185748147699,-1.0702872276306152);
 map.addOverlay(createMarker(point, "Grange Farm Country Cottages", "grange", "<h3><a href='grange-farm/'>Grange Farm Country Cottages</a></h3><a href='grange-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Grange Farm Country Cottages.jpg'></a><p>Our five cottages, sensitively converted from original Victorian barns, are located in a private courtyard. Inside and out, their style reflects beautiful country charm, combined with outstanding levels of comfort. Underfloor heating, natural oak floors, tumbled marble and exposed original roof trusses and beams in all the properties. Each cottage is fitted out with a combination of contemporary practical items and luxurious character furnishings. Wi-Fi broadband is available throughout our site.<p><p><h4><a href='grange-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

var point = new GLatLng(51.7615,-1.51);
 map.addOverlay(createMarker(point, "Ducklington Farm", "ducklington", "<h3><a href='ducklington-farm/'>Ducklington Farm</a></h3><a href='ducklington-farm/'><img style='float:right; border:1px solid #AC9475; margin:5px; padding:3px;' src='i/home/Ducklington Farm.jpg'></a><p>We Look forward to welcoming you to Ducklington farmhouse for 'Bed and Breakfast'. Our family run mixed farm is situated 1.5 miles from the centre of Witney, on the edge of the Cotswolds.<p><p><h4><a href='ducklington-farm/'><img style='float:left; margin-right:5px;' src='i/arrow.gif'>Read more details</a></h4></p>"));

// Ducklington ????????????????		

	}
}
addLoadEvent(loadmap); 
