if(GBrowserIsCompatible()){function gmap(){this.lastmarker='';this.iwform='Enter details:<br>'+'<form action="#" onsubmit="this.process(this); return false" action="#">'+'  <textarea name="data" rows="5" cols="40"><\/textarea><br>'+'  <input type="submit" value="Submit" />'+'<\/form>';this.maparea='gmap';this.draggableCursor='default';this.center_lat=43.907787;this.center_lng=-79.359741;this.create_mark_map_click=false;this.enableScrollWheelZoom=true;this.TextualZoomControl=false;this.GMapTypeControl=false;this.MarkerClustererView=false;this.MarkerClustererViewMoveEndCallback=null;this.markers=[];this.markerClusterer=null;this.zoom=null;this.mapclick=null;this.disableDragging=false;this.ZoomControl=true;this.clusterImagePath=null;this.zoomlevel=null;this.min_zoom_level=0;this.max_zoom_level=21;this.cls_zoom_in_div='clsZoomInDiv';this.cls_zoom_out_div='clsZoomOutDiv';this.cluster_zoomlevel=1};gmap.prototype.markerClustererStyle=function(){this.styles=[[{url:this.clusterImagePath+'people35.png',height:35,width:35,opt_anchor:[0,0],opt_textColor:'#000000'},{url:this.clusterImagePath+'people45.png',height:45,width:45,opt_anchor:[0,0],opt_textColor:'#000000'},{url:this.clusterImagePath+'people55.png',height:55,width:55,opt_anchor:[0,0]}]]};gmap.prototype.createInputMarker=function(){var point=arguments[0];var marker=new GMarker(point,{draggable:true,icon:G_START_ICON});GEvent.addListener(marker,"click",function(){this.lastmarker=marker;marker.openInfoWindowHtml(iwform)});map.addOverlay(marker);marker.openInfoWindowHtml(iwform);this.lastmarker=marker;return marker};gmap.prototype.createDraggableMarker=function(){var point=arguments[0];var marker=new GMarker(point,{draggable:true});this.map.addOverlay(marker);this.lastmarker=marker;return marker};gmap.prototype.createMarker=function(){var point=arguments[0];var text=arguments[1];var marker=new GMarker(point);GEvent.addListener(marker,"click",function(){marker.openInfoWindow(document.createTextNode(text))});map.addOverlay(marker);return marker};gmap.prototype.createMap=function(){var obj=this;var map=new GMap2(document.getElementById(this.maparea),{draggableCursor:this.draggableCursor});var mt=map.getMapTypes();for(var i=0;i<mt.length;i++){mt[i].getMinimumResolution=function(){return obj.min_zoom_level};mt[i].getMaximumResolution=function(){return obj.max_zoom_level}}map.localobj=this;if(this.ZoomControl==true){if(this.TextualZoomControl){map.addControl(new TextualZoomControl())}else{map.addControl(new GLargeMapControl())}}if(this.GMapTypeControl){map.addControl(new GMapTypeControl())}map.setCenter(new GLatLng(this.center_lat,this.center_lng),8);if(this.zoom!=null){map.setZoom(this.zoom)}if(this.enableScrollWheelZoom){map.enableScrollWheelZoom()}if(this.mapclick!=null){var objtemp=this;GEvent.addListener(map,"click",function(){eval(objtemp.mapclick+'()')})}if(this.disableDragging==true){map.disableDragging()}if(this.create_mark_map_click){GEvent.addListener(map,"click",function(overlay,point){if(!overlay){createInputMarker(point)}})}this.map=map;if(this.MarkerClustererView){this.MarkerClustererViewBasicSettings()}this.moveEndCallback();return map};gmap.prototype.moveEndCallback=function(){var bounds=this.map.getBounds();var ne=bounds.getNorthEast();var sw=bounds.getSouthWest();var area_bounds=ne.lat()+':';area_bounds=area_bounds+sw.lat()+':';area_bounds=area_bounds+ne.lng()+':';area_bounds=area_bounds+sw.lng();if(this.MarkerClustererViewMoveEndCallback!=null){eval(this.MarkerClustererViewMoveEndCallback+'(\''+area_bounds+'\')')}this.changeZoomClass()};gmap.prototype.MarkerClustererViewBasicSettings=function(){this.markerClustererStyle();var objlocal=this;GEvent.addListener(this.map,"moveend",function(){objlocal.moveEndCallback()});var icon=new GIcon(G_DEFAULT_ICON);icon.image="http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,008CFF,000000&ext=.png";for(var i=0;i<location_josn_data['count'];++i){var latlng=new GLatLng(location_josn_data.record[i].latitude,location_josn_data.record[i].longitude);var marker=new GMarker(latlng,{icon:icon});this.markers.push(marker)}if(this.markerClusterer!=null){this.markerClusterer.clearMarkers()}this.markerClusterer=new MarkerClusterer(this.map,this.markers,{maxZoom:this.max_zoom_level,gridSize:null,styles:this.styles[0]})};gmap.prototype.getLastMarkerLng=function(){return lng=this.lastmarker.getPoint().lng()};gmap.prototype.getLastMarkerLat=function(){return lng=this.lastmarker.getPoint().lat()};gmap.prototype.process=function(){var form=arguments[0];var details=form.data.value;var lat=this.getLastMarkerLat();var lng=this.getLastMarkerLng();GDownloadUrl(url,function(doc){});map.closeInfoWindow();var marker=createMarker(lastmarker.getPoint(),details);GEvent.trigger(marker,"click")};gmap.prototype.readData=function(doc){lines=doc.split("\n");for(var i=0;i<lines.length;i++){if(lines[i].length>1){parts=lines[i].split("|");var lat=parseFloat(parts[0]);var lng=parseFloat(parts[1]);var details=parts[2];var point=new GLatLng(lat,lng);var marker=createMarker(point,details)}}};gmap.prototype.getNextZoomLevel=function(status){status=arguments[0];if(arguments.length>1){var z_level=arguments[1]}else{var z_level=this.zoomlevel}status=arguments[0];var current_zoom_level=this.map.getZoom();if(status=='in'){if(current_zoom_level==this.max_zoom_level){return-1}current_zoom_level=current_zoom_level+z_level;current_zoom_level=current_zoom_level>this.max_zoom_level?this.max_zoom_level:current_zoom_level}if(status=='out'){if(current_zoom_level==this.min_zoom_level){return-1}current_zoom_level=current_zoom_level-z_level;current_zoom_level=current_zoom_level<this.min_zoom_level?this.min_zoom_level:current_zoom_level}return current_zoom_level};gmap.prototype.changeZoomClass=function(){var nextzzoom=this.map.getZoom();if(this.max_zoom_level==nextzzoom){$Jq('.'+this.cls_zoom_in_div).attr('id',this.cls_zoom_in_div+'Disabled')}else{$Jq('.'+this.cls_zoom_in_div).attr('id',this.cls_zoom_in_div)}if(this.min_zoom_level==nextzzoom){$Jq('.'+this.cls_zoom_out_div).attr('id',this.cls_zoom_out_div+'Disabled')}else{$Jq('.'+this.cls_zoom_out_div).attr('id',this.cls_zoom_out_div)}};gmap.prototype.changeZoom=function(status){var nextzzoom=this.getNextZoomLevel(status);if(nextzzoom!=-1){this.map.setZoom(nextzzoom)}this.changeZoomClass()}}else{alert("Sorry, the Google Maps API is not compatible with this browser")}function TextualZoomControl(){};TextualZoomControl.prototype=new GControl();TextualZoomControl.prototype.initialize=function(map){var container=document.createElement("div");var zoomInDiv=document.createElement("div");container.appendChild(zoomInDiv);zoomInDiv.appendChild(document.createTextNode("Zoom In"));$Jq(zoomInDiv).addClass(map.localobj.cls_zoom_in_div);$Jq(zoomInDiv).attr('id',map.localobj.cls_zoom_in_div);GEvent.addDomListener(zoomInDiv,"click",function(){if(map.localobj.zoomlevel!=null){if($Jq('.'+map.localobj.cls_zoom_in_div).attr('id')==map.localobj.cls_zoom_in_div+'Disabled'){return}map.localobj.changeZoom('in')}else{map.zoomIn()}});var zoomOutDiv=document.createElement("div");container.appendChild(zoomOutDiv);zoomOutDiv.appendChild(document.createTextNode("Zoom Out"));$Jq(zoomOutDiv).addClass(map.localobj.cls_zoom_out_div);$Jq(zoomOutDiv).attr('id',map.localobj.cls_zoom_out_div);GEvent.addDomListener(zoomOutDiv,"click",function(){if(map.localobj.zoomlevel!=null){if($Jq('.'+map.localobj.cls_zoom_out_div).attr('id')==map.localobj.cls_zoom_out_div+'Disabled'){return}map.localobj.changeZoom('out')}else{map.zoomOut()}});map.getContainer().appendChild(container);return container};TextualZoomControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(7,7))};
