var zoom = 12;
var centerPoint = new GLatLng(38.905517,-77.071746);
var wheelZooming = false;

// --------------------------------------------------------------
// Icon for the red square displayed with the mouse wheel zoom
var baseIcon = new GIcon();
baseIcon.iconSize=new GSize(100,100);
baseIcon.iconAnchor=new GPoint(50,50);
var rectIcon = new GIcon(baseIcon, "/img/rect.png", null);

// Global variables used with the mouse wheel zoom
var mouseLatLng;
var zoomRect;
// --------------------------------------------------------------

function mouseMove(mousePt) {
  mouseLatLng = mousePt;
}

// Mouse wheel zoom - Event handler -----
function wheelZoom(event) {
	if (wheelZooming) {
		return;
	}
	wheelZooming = true;

	// zoomRect and rectIcon are global variables!!!

	zoomRect = new GMarker(mouseLatLng,{icon:rectIcon});
	map.addOverlay(zoomRect);

	if (event.cancelable) {
		event.preventDefault();
	}
	map.closeInfoWindow(); 
	if((event.detail || -event.wheelDelta) < 0) {
		window.setTimeout(function(){
			map.removeOverlay(zoomRect);
			map.zoomIn(mouseLatLng,true,true);
			wheelZooming = false;
		},200);
	} 
	else {
		window.setTimeout(function(){
			map.removeOverlay(zoomRect);
			map.zoomOut(mouseLatLng,true);
			wheelZooming = false;
		},200);
	}
	return false; 
}
// End event handler -----

