function createPropertyMarker(
	lngLatitude,
	lngLongitude,
	strType,
	strCallout,
	strLink
)
{
	var strTypeImage = strType.toLowerCase();
	strTypeImage='images/map/'+strTypeImage.replace(/ /ig, '')+'.gif';

	var myImage = new YImage();
	myImage.src = strTypeImage;
	myImage.size = new YSize(15,15);
	myImage.offsetSmartWindow = new YCoordPoint(7,7);

	var oCentrePoint = new YGeoPoint(lngLatitude, lngLongitude);
	var oMarker = new YMarker(oCentrePoint,myImage);
	
	if (0!=strCallout.length)
		oMarker.addAutoExpand(strCallout);
		
	if (0!=strLink.length)
		YEvent.Capture(oMarker, EventsList.MouseClick, function(){window.location=strLink;});
		
	return oMarker;
}

function onClickGotoLink()
{
	window.location='http://news.bbc.co.uk';
}

function createSinglePropertyMap(
	lngLatitude,
	lngLongitude,
	strContainerName,
	intZoomLevel,
	strPropertyType,
	strTitle
)
{
	var oContainer=document.getElementById(strContainerName);
	
	//get size of the container
	var style;
	var intWidth;
	var intHeight;
	if (document.defaultView)
	{
		style=document.defaultView.getComputedStyle(oContainer, '');
		intWidth=parseInt(style.width, 10);
		intHeight=parseInt(style.height, 10);
	}
	else
	{
		intWidth=parseInt(oContainer.currentStyle.width, 10);
		intHeight=parseInt(oContainer.currentStyle.height, 10);
	}
	
	// Create a map object 
	var oMap = new YMap(oContainer, YAHOO_MAP_REG, new YSize(intWidth, intHeight));
	
	// Display the map centered on a latitude and longitude
	var oCentrePoint = new YGeoPoint(lngLatitude, lngLongitude);
	oMap.drawZoomAndCenter(oCentrePoint, intZoomLevel);
	
	// Add pan control 
	oMap.addPanControl(); 
	
	// Add zoom control 
	oMap.addZoomShort(); 
	
	oMap.addOverlay(createPropertyMarker(lngLatitude, lngLongitude, strPropertyType, strTitle, ''));
}

function createMap(
	lngLatitude,
	lngLongitude,
	strContainerName,
	intZoomLevel
)
{
	var oCentrePoint = new YGeoPoint(lngLatitude, lngLongitude);

	//get size of the container
	var style;
	var intWidth;
	var intHeight;
	var oContainer=document.getElementById(strContainerName);
	
	if (document.defaultView)
	{
		style=document.defaultView.getComputedStyle(oContainer, '');
		intWidth=parseInt(style.width, 10);
		intHeight=parseInt(style.height, 10);
	}
	else
	{
		intWidth=parseInt(oContainer.currentStyle.width, 10);
		intHeight=parseInt(oContainer.currentStyle.height, 10);
	}

	// Create a map object 
	var oMap = new YMap(oContainer, YAHOO_MAP_REG, new YSize(intWidth, intHeight));

	// Display the map centered on a latitude and longitude 
	oMap.drawZoomAndCenter(oCentrePoint, intZoomLevel);
	
	return oMap;
}


function centreMap(oMap, lngLatitude, lngLongitude)
{
	var oCentrePoint = new YGeoPoint(lngLatitude, lngLongitude);
	oMap.panToLatLon(oCentrePoint);
}

function centreMaps(oMap1, oMap2, lngLatitude, lngLongitude)
{
	centreMap(oMap1, lngLatitude, lngLongitude);
	centreMap(oMap2, lngLatitude, lngLongitude);
}