var i = 0;
var markers = Array();

function createMarker(point, index, html, icon) {

	var marker = new GMarker(point, icon);

	marker.id = i;

	var opts = new Object();
	opts.maxWidth = 300;

	GEvent.addListener(marker, "click", function() {

		marker.openInfoWindowHtml('<div class="mappopup">' + html + '</div>', opts);
		$('ul.developments li').removeClass("on");

		$('#development_'+ index).addClass("on");

	});

	markers[i] = marker;

	i++;

	return marker;
}

function createBlankMarker(point, html) {
	var marker = new GMarker(point, icon);
	return marker;
}


function createInfo(url, title, address, telephone, image) {
	infohtml = '';
	if(image!=""){
		infohtml = '<img src="'+image+'" alt="Photograph of our development." style="float:left;margin:0 10px 10px 0;" />';
	}
	infohtml = infohtml + '<h2 style="margin: 0 0 5px 69px; font-size: 120%; width: 200px;" class="map">' + title + '</h2><p style="margin: 0 0 5px 69px; font-size: 70%; width: 200px;" class="map">' + address + '<br/>';
	if(url!=""){
		infohtml = infohtml + '<a href="' + url + '" title="Read more about ' + title + '">More detail &raquo;</a>';
	}

	infohtml = infohtml + '</p>';
	return infohtml;
}

function show(id) {
	GEvent.trigger(markers[id], 'click');

	return false;
};
