
/*
var temp = "";
for (x in obj_qry)
		temp += x + ": " + obj_qry[x] + "\n";
alert(temp);
*/

function js_init_controls() {
	loadMap();
	load_ctx();
	util_poi_get_all();
}

function loadMap() {
	if (GBrowserIsCompatible()) {
		var dmap = document.getElementById("map_5255");
		map_5255 = new GMap2(dmap);

		// directions related

		var mapui = map_5255.getDefaultUI();
		//mapui.maptypes.physical = false;
		map_5255.setUI(mapui);
		//map_5255.addMapType(G_SATELLITE_3D_MAP);

		var point_center = new GLatLng(39.5020,33.5534);
		map_5255.setCenter(point_center, 5);

		//gmc = new MarkerClusterer(map_5255);

		// ====== Restricting the range of Zoom Levels =====
		// Get the list of map types      
		var mt = map_5255.getMapTypes();
		// Overwrite the getMinimumResolution() and getMaximumResolution() methods
		for (var i=0; i<mt.length; i++) {
			mt[i].getMinimumResolution = function() {return 5;}
		}

		// ====== set up marker mouseover tooltip div ======
		tooltip_5255 = document.createElement("div");
		document.getElementById("map_5255").appendChild(tooltip_5255);
		tooltip_5255.style.visibility="hidden";

		// generate base points
		var baseIcon = new GIcon();
		baseIcon.iconSize=new GSize(32,32);
		//baseIcon.shadowSize=new GSize(56,32);
		baseIcon.iconAnchor=new GPoint(16,16);
		baseIcon.infoWindowAnchor=new GPoint(16,0);

		poi_icon = new GIcon(baseIcon, asset_url + 'img/gicon/'+poi_type+'/icon.png', null, null);
		car_icon = new GIcon(baseIcon, asset_url + 'img/gicon/car.png', null, null);
		myp_icon = new GIcon(baseIcon, asset_url + 'img/gicon/myp.png', null, null);
		//x_icon = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/pal5/icon14.png", null, "http://maps.google.com/mapfiles/kml/pal5/icon14s.png");

	} 
} 

/*
* Starts the loading of the Google Maps API, once loaded will call the specified callback Function
*/
function activateMap() {
	var script = document.createElement("script");
	script.setAttribute("src", "http://maps.google.com/maps?file=api&v=2&key="+gmap_key+"&async=2&callback=loadMap");
	script.setAttribute("type", "text/javascript");
	document.documentElement.firstChild.appendChild(script);
}

