var map;

function load() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
	}
}

function setCenter(lat, lon, zoom) {
	map.setCenter(new GLatLng(lat, lon), zoom);
}


function getCanvasSize() {
	var chunks = document.location.pathname.match(/([a-z0-9\/]*\.php)/i);
	var baseUrl = chunks[1] + "?";

	var width;
	var height;
	
	//all browsers
	if (self.innerWidth) {
		width = self.innerWidth;
		height = self.innerHeight;
	}
	//IEs
	else if (document.body){
		width = document.body.clientWidth;
		height = document.body.clientHeight;
	}
	//IE 6 in Strict Mode
	else if (document.documentElement && document.documentElement.clientWidth) {
		width = document.documentElement.clientWidth;
		height = document.documentElement.clientHeight;
	}
	
	url = baseUrl + "ajaxCanvasSize="+width+"x"+height;
}