// JavaScript Document
function checkBounds() {
	// Perform the check and return if OK
	if (allowedBounds.contains(map.getCenter())) {
		return;
	}
	// It`s not OK, so find the nearest allowed point and move there
	var C = map.getCenter();
	var X = C.lng();
	var Y = C.lat();
	
	var AmaxX = allowedBounds.getNorthEast().lng();
	var AmaxY = allowedBounds.getNorthEast().lat();
	var AminX = allowedBounds.getSouthWest().lng();
	var AminY = allowedBounds.getSouthWest().lat();
	
	if (X < AminX) {X = AminX;}
	if (X > AmaxX) {X = AmaxX;}
	if (Y < AminY) {Y = AminY;}
	if (Y > AmaxY) {Y = AmaxY;}
	map.setCenter(new GLatLng(Y,X));
}

function wheelZoom(a)
{
	if (a.detail) // Firefox
	{
		if (a.detail < 0)
		{ 
			map.zoomIn(); 
		}
		else if (a.detail > 0)
		{ 
			map.zoomOut(); 
		}
	}
	else if (a.wheelDelta) // IE
	{
		if (a.wheelDelta > 0)
		{ 
			map.zoomIn(); 
		}
		else if (a.wheelDelta < 0)
		{ 
			map.zoomOut(); 
		}
	}
}
