
	window.onload=initialize;
	window.onunload=GUnload;
	
	var map;
	var counter1 = 0;
	var clickedPoints = new Array();

	// Very Basic Map setup on canvas
	function initialize() {      
		if (GBrowserIsCompatible()) {
			 // === A method for testing if a point is inside a polygon
			  // === Returns true if poly contains point
			  GPolygon.prototype.Contains = function(point) {
				var j=0;
				var oddNodes = false;
				var x = point.lng();
				var y = point.lat();
				for (var i=0; i < this.getVertexCount(); i++) {
				  j++;
				  if (j == this.getVertexCount()) {j = 0;}
				  if (((this.getVertex(i).lat() < y) && (this.getVertex(j).lat() >= y))
				  || ((this.getVertex(j).lat() < y) && (this.getVertex(i).lat() >= y))) {
					if ( this.getVertex(i).lng() + (y - this.getVertex(i).lat())
					/  (this.getVertex(j).lat()-this.getVertex(i).lat())
					*  (this.getVertex(j).lng() - this.getVertex(i).lng())<x ) {
					  oddNodes = !oddNodes
					}
				  }
				}
				return oddNodes;
			  }
		}    
	}
	

