function Loc(x, y, t, p, d) {
	this.lx = x;
	this.ly = y;
	this.title = t;
	this.photo = p;
	this.desc = d;
}

var map;

function start_map() {
	if (GBrowserIsCompatible()) {
	    map = new GMap2(document.getElementById("map_canvas"));
	    map.addControl(new GMenuMapTypeControl());
	    map.addControl(new GSmallMapControl());
	    map.addControl(new GNavLabelControl(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT));
	    map.enableScrollWheelZoom();
	    map.setCenter(new GLatLng(47.000000,2.50145), 5);
	    arrLoc.each(function(it){
	    	var point = new GLatLng(it.lx, it.ly);
		    map.addOverlay(new GMarker(point,{clickable:false}));
	    });
	}
}

function switch_map(id) {
	it = arrLoc[id];
    //map.panTo(new GLatLng(it.lx, it.ly));
    map.setCenter(new GLatLng(it.lx, it.ly), 13);
    str = '';
    if (it.photo) {
    	str = '<img src="'+it.photo+'" style="float:left" />'+'<h4 style="margin-left:60px">'+it.title+'</h4><p style="margin-left:60px">'+it.desc+'</p>'
    } else {
    	str = '<h4>'+it.title+'</h4><p>'+it.desc+'</p>';
    }
    map.openInfoWindowHtml(map.getCenter(), str);
}
window.addEvent('load', function() {
	start_map();
});

function center_map() {
	map.setCenter(new GLatLng(47.000000,2.50145), 5);
}
