function createHomePageMarker(point, index, name, shortDescript, img, imgWidth) {
	var theIcon = new GIcon(G_DEFAULT_ICON);
	mapElem = $("map_canvas");
	theIcon.image = name;
	size = new GSize(imgWidth, 20)
	theIcon.iconSize = size;
	theIcon.shadow = '';
	theIcon.imageMap = new Array(0,0, 0, (size.height -1), (size.width -1),(size.height -1), (size.width -1), 0)
	theIcon.iconAnchor = new GPoint((size.width/2), 28);
	markerOptions = { title:name, icon:theIcon};
	var marker = new GMarker(point, markerOptions);
	marker.name = name;
	marker.shortDescript = shortDescript;
	marker.img = img;
	GEvent.addListener(marker, "click", changeHomePageMapData);
	map.addOverlay(marker);
	marker.index = index;
	$("img.gmnoprint:eq(" + (index) + ")").css('backgroundImage', 'url("styles/images/home_' + name.replace(' ', '_') + '.gif")');
	return marker;
}

function changeHomePageMapData(marker)
{
	if(this == window) m = marker;
	else m = this;
	
	deselectHomePageMarkers();
	$("img.gmnoprint:eq(" + (m.index) + ")").css('backgroundPosition', '0px -20px');
	$(".gmLocationInfo h3.siteName").html(m.name);
	$(".gmLocationInfo .shortDescript").html(m.shortDescript);
	$(".gmLocationInfo img").attr("src", m.img);
	$(".gmLocationInfo img").attr("alt", m.name);
	$(".gmLocationInfo a").attr("href", '/region/' + m.name.replace(' ', '-'));

}
function deselectHomePageMarkers()
{
	for(i = 0; i < markers.length; i++)
	{
		$("img.gmnoprint:eq(" + (i) + ")").css('backgroundPosition', '0px 0px');

	}
}

$(document).ready(createHomePageMap);
