// JavaScript Document


// this variable will collect the html which will eventualkly be placed in the side_bar
var side_bar_html = "";
    
// arrays to hold copies of the markers and html used by the side_bar
// because the function closure trick doesnt work there
var gmarkers = [];
var htmls = [];
var i = 0;
var map;
	  
//Add this block to change icons - also pass 'icon' to var marker below
var icon = new GIcon();
icon.image = "images/google_map/car.png";
icon.iconSize=new GSize(45,24); 
icon.iconAnchor=new GPoint(13,13); 
icon.infoWindowAnchor=new GPoint(13,13);  
icon.transparent="images/google_map/car_trans.png";
icon.imageMap=[0,0,0,26,26,26,26,0];

// This function zooms in or out
function setZoomLevel(a) {
	map.setZoom(map.getZoom() + a);
}

// Move map
function moveMap(dx,dy) {
	map.panDirection(dx,dy);
}

// streel level, satellite or satellite + roads
function setMapType(view){
	if (view=="G_MAP_TYPE") {map.setMapType(G_NORMAL_MAP);}
	else if (view=="G_SATELLITE_TYPE") {map.setMapType(G_SATELLITE_MAP);}
	else if(view=="G_HYBRID_TYPE") {map.setMapType(G_HYBRID_MAP);}
}

// This function picks up the click and opens the corresponding info window
function myclick(i) {
	gmarkers[i].openInfoWindowHtml(htmls[i]);
}

addLoadEvent(loadmap);