// JavaScript Document

function addMarker(longitude, latitude, description, pid, val) { 
	var marker = new GMarker(new GLatLng(latitude, longitude),Icon);
	if(val==pid)
	{
		map.addOverlay(marker);
		marker.openInfoWindowHtml(description);
		
		GEvent.addListener(marker, 'click',
		function() {
			marker.openInfoWindowHtml(description);
			}
		);
	}
	else
	{		
		GEvent.addListener(marker, 'click',
		function() {
			marker.openInfoWindowHtml(description);
			}
		);
		map.addOverlay(marker);
	}	

	//new_marker = new GMarker(point,opt)
	  //markers.push(new_marker)
}
function init(val) {
	if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("map"));
	var mapControl = new GMapTypeControl();
    map.addControl(mapControl);
    map.addControl(new GLargeMapControl());
    map.setMapType(G_SATELLITE_MAP);
	/*var customUI = map.getDefaultUI();
    customUI.controls.scalecontrol = false;
    map.setUI(customUI);*/
	map.removeMapType(G_PHYSICAL_MAP);
	map.setCenter(new GLatLng(centerLatitude, centerLongitude), startZoom);
	for(id=0;id<(markers.length-1);id++) {
	addMarker(markers[id].latitude, markers[id].longitude, markers[id].name, markers[id].pid, val);
	}
}
}