
/*

*/

createGIcon = function() {
	var icon = new GIcon();
	icon.image = '/mg/images/map_marker_00.png';
	icon.iconSize = new GSize(33, 33);
	icon.iconAnchor = new GPoint(15, 31);
	icon.infoWindowAnchor = new GPoint(15, 0);
	return icon;
}

mgZoomControl = function(){}
mgZoomControl.prototype = new GControl();
mgZoomControl.prototype.initialize = function(map) {
	var container = document.createElement('div');
	container.className = 'mzctrl';
	
	var zoomInDiv = document.createElement('div');
	zoomInDiv.id = 'gmap_iZoomin';
	zoomInDiv.innerHTML = 'Zoom In';
	zoomInDiv.title = 'Zoom In';
	container.appendChild(zoomInDiv);
	GEvent.addDomListener(zoomInDiv, "click", function() {
		map.zoomIn();
	});
	
	var zoomOutDiv = document.createElement('div');
	zoomOutDiv.id = 'gmap_iZoomout';
	zoomOutDiv.innerHTML = 'Zoom Out';
	zoomOutDiv.title = 'Zoom Out';
	container.appendChild(zoomOutDiv);
	GEvent.addDomListener(zoomOutDiv, "click", function() {
		map.zoomOut();
	});
	
	map.getContainer().appendChild(container);
	return container;
}
mgZoomControl.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10, 10));
}

mgMapTypeControl = function(){}
mgMapTypeControl.prototype = new GControl();
mgMapTypeControl.prototype.initialize = function(map) {
	var container = document.createElement('div');
	container.className = 'mtctrl';
	var _this = this;
	this.tArr = ['Map', 'Satellite', 'Hybrid'];
	
	this.mapDiv = document.createElement('div');
	this.mapDiv.id = 'gmap_iMap';
	this.mapDiv.innerHTML = this.tArr[0];
	this.mapDiv.className = 'on';
	container.appendChild(this.mapDiv);
	GEvent.addDomListener(this.mapDiv, "click", function() {
		_this.setStyle(this);
		map.setMapType(G_NORMAL_MAP);
	});
	
	this.satDiv = document.createElement('div');
	this.satDiv.id = 'gmap_iSat';
	this.satDiv.innerHTML = this.tArr[1];
	container.appendChild(this.satDiv);
	GEvent.addDomListener(this.satDiv, "click", function() {
		_this.setStyle(this);
		map.setMapType(G_SATELLITE_MAP);
	});
	
	this.hybDiv = document.createElement('div');
	this.hybDiv.id = 'gmap_iHyb';
	this.hybDiv.innerHTML = this.tArr[2];
	container.appendChild(this.hybDiv);
	GEvent.addDomListener(this.hybDiv, "click", function() {
		_this.setStyle(this);
		map.setMapType(G_HYBRID_MAP);
	});
	
	map.getContainer().appendChild(container);
	return container;
}
mgMapTypeControl.prototype.setStyle = function(type) {
	this.mapDiv.className = '';
	this.satDiv.className = '';
	this.hybDiv.className = '';
	type.className = 'on';
}
mgMapTypeControl.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10, 10));
}
