// JavaScript Document
			function ZoomFilter(map){
				this.map = map;
				this.run = function(){
					logit('Called: zoomfilter.run');
					var backup = this.map.cancelCentering;
					this.map.cancelCentering = true;
					updatedFilters(this.applyFilter(placemarks[this.map.name],this.getValue()));
					this.map.cancelCentering = backup;
					logit('End: zoomfilter.run');
				}
				
				//Expects an array of placemarks, returns array of all unfiltered placemarks
				this.applyFilter = function(arr,value){
					var unfiltered = new Array();
					//First reset any existing filter
					this.resetFilter(arr);
					//Now apply the new value
					for(var i = 0; i < arr.length; i++){
						if(!value.contains(new GLatLng(arr[i].latitude,arr[i].longitude))){
							arr[i].filteredBy['zoom'] = false;
						}

						arr[i].filtered = arr[i].filtered || arr[i].filteredBy['zoom'] || !arr[i].active;
						if(!arr[i].filtered)
							unfiltered.push(arr[i]);
						
					}
					return unfiltered;
				}

				//Expects an array of placemarks
				this.resetFilter = function(arr){
					for(var i = 0; i < arr.length; i++){
						//Reset this filter
						arr[i].filteredBy['zoom'] = false;
						arr[i].filtered = false;
						//Reapply Filter if there are any additional filters
					}
					this.checkFilters(arr);										
				}

				//Expects an array of placemarks - will check all filters and reset filter status based on that
				this.checkFilters = function(arr){
					for(var i = 0; i < arr.length; i++){
						arr[i].filtered = false;
						for(var j in arr[i].filteredBy){
							arr[i].filtered = arr[i].filtered || arr[i].filteredBy[j];
						}
					}
				}

				this.getValue = function(){
					var bounds = this.map.gmap.getBounds();
					return bounds;
				}
			}
