
//This file contains functions for checkboxes in the map menu
//Arts locations from Shrimatee
function arts_cb()
{
	var arts_cb=document.getElementById("arts_cb");
	if(arts_cb.checked==true)
	{
		mtype="arts"; //Sets current marker type to boat_ramps
		icon=icons[41];	//Sets current icon to boat ramps
		GDownloadUrl('data/stpete_arts_locations.txt',process_it);//Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<arts_markers.length;i++)
		{
			map.removeOverlay(arts_markers[i]);	//Remove markers from map
			counter[33]=0; //Reset counter for boat ramps
		}
	}
}
//Art locations opportunities from Shrimatee
function arts_opportunity_cb()
{
	var arts_opportunity_cb=document.getElementById("arts_opportunity_cb");
	if(arts_opportunity_cb.checked==true)
	{
		mtype="arts_opp"; //Sets current marker type to boat_ramps
		icon=icons[42];	//Sets current icon to boat ramps
		GDownloadUrl('data/stpete_artsopp_locations.txt',process_it2);//Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<arts_opps_markers.length;i++)
		{
			map.removeOverlay(arts_opps_markers[i]);	//Remove markers from map
			counter[34]=0; //Reset counter for boat ramps
		}
	}
}
//Arts destinations from Nick
function arts_dest_cb()
{
	var arts_dest_cb=document.getElementById("arts_dest_cb");
	if(arts_dest_cb.checked==true)
	{
		mtype="arts_dest";	
		icon=icons[7];	
		GDownloadUrl('data/arts_dest.xml', process_rss); 
	}
	else
	{
		for(i=0;i<arts_dest_markers.length;i++)
		{
			map.removeOverlay(arts_dest_markers[i]); 
			counter[35]=0; 
		}
	}
}
function baywalk_cb()
{
	//loading(1); //Shows //loading box.
	var baywalk_cb=document.getElementById("baywalk_cb");
	if(baywalk_cb.checked==true)
	{
		mtype="baywalk"; //Sets current marker type to baywalk
		icon=icons[0]; //Sets current icon to baywalk
		GDownloadUrl('data/stpete_baywalk.txt',process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		map.removeOverlay(baywalk_marker); //Removes marker from map
		//loading(0); //Hides //loading box
	}
}
//End
//Function for cona polygon checkbox
function biz_cb()
{
	//loading(1); //Shows //loading box
	var biz_cb=document.getElementById("biz_cb");
	if(biz_cb.checked==true)
	{
		if(document.getElementById("council_districts_cb").checked==true)
		{
			document.getElementById("council_districts_cb").checked=false;
			council_districts_cb();
		}
		if(document.getElementById("nbrhd_assn_cb").checked==true)
		{
			document.getElementById("nbrhd_assn_cb").checked=false;
			nbrhd_assn_cb();
		}
		if(document.getElementById("police_districts_cb").checked==true)
		{
			document.getElementById("police_districts_cb").checked=false;
			police_districts_cb();
		}
		if(document.getElementById("city_poly_cb").checked==true)
		{
			document.getElementById("city_poly_cb").checked=false;
			city_poly_cb();
		}
		if(document.getElementById("fico_cb").checked==true)
		{
			document.getElementById("fico_cb").checked=false;
			fico_cb();
		}
		if(document.getElementById("cona_cb").checked==true)
		{
			document.getElementById("cona_cb").checked=false;
			cona_cb();
		}
	mtype="biz_labels"
	GDownloadUrl('data/stpete_bus_assn_labels.txt',process_biz);
    var centreLat=27.782233860819332;
    var centreLon=-82.67725852213809;
    var initialZoomLevel=7;
    var n_buttonText="Map"; //Text that shows up on the button for the custom layer (n=normal, s=sat, h=hybrid)
    var s_buttonText="Satellite";
    var h_buttonText="Hybrid";
    var mapBounds=new GLatLngBounds(new GLatLng(27.64443093887601,-82.7669365527896),new GLatLng(27.920036782762658,-82.58758049148658));
    var opacity=0.5;

      var copyrightCollection = new GCopyrightCollection("GMapCreator");
      copyrightCollection.addCopyright(
          new GCopyright("CASA",
          new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)),
          0,
          "<a href=\"http://www.casa.ucl.ac.uk\">CASA</a>")
        );

     function customGetTileURL(a,b) {
      //converts tile x,y into keyhole string
      if (b>15) { return "biz_poly-tiles/blank-tile.png"; };

      var c=Math.pow(2,b);
      var x=360/c*a.x-180;
      var y=180-360/c*a.y;
      var x2=x+360/c;
      var y2=y-360/c;
      var lon=x; //Math.toRadians(x); //would be lon=x+lon0, but lon0=0 degrees
      var lat=(2.0*Math.atan(Math.exp(y/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var lon2=x2;
      var lat2=(2.0*Math.atan(Math.exp(y2/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var tileBounds=new GLatLngBounds(new GLatLng(lat2,lon),new GLatLng(lat,lon2));

      if (!tileBounds.intersects(mapBounds)) { return "biz_poly-tiles/blank-tile.png"; };
        var d=a.x;
        var e=a.y;
        var f="t";
        for(var g=0;g<b;g++){
            c=c/2;
            if(e<c){
                if(d<c){f+="q"}
                else{f+="r";d-=c}
            }
            else{
                if(d<c){f+="t";e-=c}
                else{f+="s";d-=c;e-=c}
            }
        }
        return "biz_poly-tiles/"+f+".png"
    }
		var tilelayer = new GTileLayer(copyrightCollection , 0, 17);
        	tilelayer.getTileUrl = customGetTileURL;
        	tilelayer.isPng = function() { return false; };
        	tilelayer.getOpacity = function() { return opacity; };
    		biz_tilelayer = new GTileLayerOverlay(tilelayer);
		map.addOverlay(biz_tilelayer);
     	}
	else
	{
		for(i=0;i<biz_labels_markers.length;i++)
		{
			map.removeOverlay(biz_labels_markers[i]); //Removes police districts labels from map
		}
		map.removeOverlay(biz_tilelayer); //Removes city poly from map
	}
}
//End
//Function for Boat Ramps checkbox
function boat_ramps_cb()
{
	//loading(1); //Shows //loading box
	var boat_ramps_cb=document.getElementById("boat_ramps_cb");
	if(boat_ramps_cb.checked==true)
	{
		mtype="boat_ramps"; //Sets current marker type to boat_ramps
		icon=icons[25];	//Sets current icon to boat ramps
		GDownloadUrl('data/stpete_boat_ramps.txt',process_it);//Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<boat_ramp_markers.length;i++)
		{
			map.removeOverlay(boat_ramp_markers[i]);	//Remove markers from map
			counter[16]=0; //Reset counter for boat ramps
		}
		//loading(0);
	}
}
//End
//Function for City Hall checkbox
function city_hall_cb()
{
	//loading(1); //Shows //loading box
	var city_hall_cb=document.getElementById("city_hall_cb");
	if(city_hall_cb.checked==true)
	{
		mtype="city_hall"; //Sets current marker type to city_hall
		icon=icons[1]; //Sets current icon to city_hall
		GDownloadUrl('data/stpete_cityhall.txt',process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		map.removeOverlay(city_hall_marker); //Removes marker from map
		//loading(0); //Hides //loading box
	}
}
//End
//Function for city limit line checkbox
function city_limit_line_cb()
{
	//loading(1); //Shows //loading box
	var city_limit_line_cb=document.getElementById("city_limit_line_cb");
	if(city_limit_line_cb.checked==true)
		{
		var request=GXmlHttp.create();
		var done=false;
		request.open("GET", "data/stpete_city_limits.xml", true); //Pulls data from XML file
		request.onreadystatechange = function()
		{
			if(request.readyState==4)
			{
				var xmlDoc=GXml.parse(request.responseText);
				var lines=xmlDoc.documentElement.getElementsByTagName("line");
				for (var a=0;a<lines.length;a++)
				{
					var colour=lines[a].getAttribute("colour");	//Sets line color from XML file
					var width =parseFloat(lines[a].getAttribute("width")); //Sets line width from XML file
					var points=lines[a].getElementsByTagName("point");
					var pts=[];
					for (var i=0;i<points.length;i++)
					{
						pts[i]=new GLatLng(parseFloat(points[i].getAttribute("lat")),
						parseFloat(points[i].getAttribute("lng")));
					}
					city_limit_line[a]=new GPolyline(pts,colour,width);
					map.addOverlay(city_limit_line[a]);	//Add lines to map
				}
				//loading(0); //Hides //loading box        
        		}
		}
		request.send(null);
	}
	else
	{
		for(i=0;i<city_limit_line.length;i++)
		{
			map.removeOverlay(city_limit_line[i]); //Removes city limit line from map
		}
		//loading(0); //Hides //loading box
	}
}
//End
//Function for city polygon checkbox
function city_poly_cb()
{
	//loading(1); //Shows //loading box
	var city_poly_cb=document.getElementById("city_poly_cb");
	if(city_poly_cb.checked==true)
	{
		if(document.getElementById("council_districts_cb").checked==true)
		{
			document.getElementById("council_districts_cb").checked=false;
			council_districts_cb();
		}
		if(document.getElementById("nbrhd_assn_cb").checked==true)
		{
			document.getElementById("nbrhd_assn_cb").checked=false;
			nbrhd_assn_cb();
		}
		if(document.getElementById("police_districts_cb").checked==true)
		{
			document.getElementById("police_districts_cb").checked=false;
			police_districts_cb();
		}
		if(document.getElementById("fico_cb").checked==true)
		{
			document.getElementById("fico_cb").checked=false;
			fico_cb();
		}
		if(document.getElementById("biz_cb").checked==true)
		{
			document.getElementById("biz_cb").checked=false;
			biz_cb();
		}
		if(document.getElementById("cona_cb").checked==true)
		{
			document.getElementById("cona_cb").checked=false;
			cona_cb();
		}
    var centreLat=27.782233860819332;
    var centreLon=-82.67725852213809;
    var initialZoomLevel=7;
    var n_buttonText="Map"; //Text that shows up on the button for the custom layer (n=normal, s=sat, h=hybrid)
    var s_buttonText="Satellite";
    var h_buttonText="Hybrid";
    var mapBounds=new GLatLngBounds(new GLatLng(27.64443093887601,-82.7669365527896),new GLatLng(27.920036782762658,-82.58758049148658));
    var opacity=0.25;

      var copyrightCollection = new GCopyrightCollection("GMapCreator");
      copyrightCollection.addCopyright(
          new GCopyright("CASA",
          new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)),
          0,
          "<a href=\"http://www.casa.ucl.ac.uk\">CASA</a>")
        );

    function customGetTileURL(a,b) {
      //converts tile x,y into keyhole string
      if (b>15) { return "stpete_poly-tiles/blank-tile.png"; };

      var c=Math.pow(2,b);
      var x=360/c*a.x-180;
      var y=180-360/c*a.y;
      var x2=x+360/c;
      var y2=y-360/c;
      var lon=x; //Math.toRadians(x); //would be lon=x+lon0, but lon0=0 degrees
      var lat=(2.0*Math.atan(Math.exp(y/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var lon2=x2;
      var lat2=(2.0*Math.atan(Math.exp(y2/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var tileBounds=new GLatLngBounds(new GLatLng(lat2,lon),new GLatLng(lat,lon2));

      if (!tileBounds.intersects(mapBounds)) { return "stpete_poly-tiles/blank-tile.png"; };
        var d=a.x;
        var e=a.y;
        var f="t";
        for(var g=0;g<b;g++){
            c=c/2;
            if(e<c){
                if(d<c){f+="q"}
                else{f+="r";d-=c}
            }
            else{
                if(d<c){f+="t";e-=c}
                else{f+="s";d-=c;e-=c}
            }
        }
        return "stpete_poly-tiles/"+f+".png"
    }
		var tilelayer = new GTileLayer(copyrightCollection , 0, 17);
        	tilelayer.getTileUrl = customGetTileURL;
        	tilelayer.isPng = function() { return false; };
        	tilelayer.getOpacity = function() { return opacity; };
    		city_tilelayer = new GTileLayerOverlay(tilelayer);
		map.addOverlay(city_tilelayer);
                //loading(0); //Hides //loading box 
	}
	else
	{
		map.removeOverlay(city_tilelayer); //Removes city poly from map
		//loading(0); //Hides //loading box
	}
}
//End
//Function for city webcams
function city_webcam_cb()
{
	//loading(1); //Shows //loading box
	var city_webcams_cb=document.getElementById("city_webcams_cb");
	if(city_webcams_cb.checked==true)
	{
		mtype="webcam"; //Sets current marker type to webcams
		icon=icons[22]; //Sets current icon to webcam camera
		GDownloadUrl('data/stpete_webcams.txt',process_webcam); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<webcam_markers.length;i++)
		{
			map.removeOverlay(webcam_markers[i]); //Removes webcam markers from map
			counter[14]=0; //Reset counter for web cam
		}
		//loading(0); //Hides //loading box
	}
}
//End
//Function for council  districts checkbox
function council_districts_cb()
{
	////loading(1); //Shows //loading box
	var council_districts_cb=document.getElementById("council_districts_cb");
	if(council_districts_cb.checked==true)
	{
		if(document.getElementById("city_poly_cb").checked==true)
		{
			document.getElementById("city_poly_cb").checked=false;
			city_poly_cb();
		}
		if(document.getElementById("nbrhd_assn_cb").checked==true)
		{
			document.getElementById("nbrhd_assn_cb").checked=false;
			nbrhd_assn_cb();
		}
		if(document.getElementById("police_districts_cb").checked==true)
		{
			document.getElementById("police_districts_cb").checked=false;
			police_districts_cb();
		}
		if(document.getElementById("cona_cb").checked==true)
		{
			document.getElementById("cona_cb").checked=false;
			cona_cb();
		}
		if(document.getElementById("biz_cb").checked==true)
		{
			document.getElementById("biz_cb").checked=false;
			biz_cb();
		}
		if(document.getElementById("fico_cb").checked==true)
		{
			document.getElementById("fico_cb").checked=false;
			fico_cb();
		}
		mtype="council_labels";	//Sets current marker type to council_labels
		GDownloadUrl('data/stpete_council_labels.txt',process_zoom); //Pass text to 'process_that' and create labels
    var centreLat=27.782233860819332;
    var centreLon=-82.67725852213809;
    var initialZoomLevel=7;
    var n_buttonText="Map"; //Text that shows up on the button for the custom layer (n=normal, s=sat, h=hybrid)
    var s_buttonText="Satellite";
    var h_buttonText="Hybrid";
    var mapBounds=new GLatLngBounds(new GLatLng(27.644793549317658,-82.76698029899677),new GLatLng(27.92078626527356,-82.58753223350386));
    var opacity=0.25;

      var copyrightCollection = new GCopyrightCollection("GMapCreator");
      copyrightCollection.addCopyright(
          new GCopyright("CASA",
          new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)),
          0,
          "<a href=\"http://www.casa.ucl.ac.uk\">CASA</a>")
        );

    function customGetTileURL(a,b) {
      //converts tile x,y into keyhole string
      if (b>15) { return "council_polys-tiles/blank-tile.png"; };

      var c=Math.pow(2,b);
      var x=360/c*a.x-180;
      var y=180-360/c*a.y;
      var x2=x+360/c;
      var y2=y-360/c;
      var lon=x; //Math.toRadians(x); //would be lon=x+lon0, but lon0=0 degrees
      var lat=(2.0*Math.atan(Math.exp(y/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var lon2=x2;
      var lat2=(2.0*Math.atan(Math.exp(y2/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var tileBounds=new GLatLngBounds(new GLatLng(lat2,lon),new GLatLng(lat,lon2));

      if (!tileBounds.intersects(mapBounds)) { return "council_polys-tiles/blank-tile.png"; };
        var d=a.x;
        var e=a.y;
        var f="t";
        for(var g=0;g<b;g++){
            c=c/2;
            if(e<c){
                if(d<c){f+="q"}
                else{f+="r";d-=c}
            }
            else{
                if(d<c){f+="t";e-=c}
                else{f+="s";d-=c;e-=c}
            }
        }
        return "council_polys-tiles/"+f+".png"
    }

		var tilelayer = new GTileLayer(copyrightCollection , 0, 17);
        	tilelayer.getTileUrl = customGetTileURL;
        	tilelayer.isPng = function() { return false; };
        	tilelayer.getOpacity = function() { return opacity; };
    		council_tilelayer = new GTileLayerOverlay(tilelayer);
		map.addOverlay(council_tilelayer); 
	}
	else
	{
		for(i=0;i<council_label_markers.length;i++)
		{
			map.removeOverlay(council_label_markers[i]); //Removes council districts labels from map
			counter[0]=0; //Reset counter for council districts
		}
		map.removeOverlay(council_tilelayer); //Removes council districts from map
		////loading(0); //Hides //loading box
	}
}
//End
//Function for cona polygon checkbox
function cona_cb()
{
	//loading(1); //Shows //loading box
	var cona_cb=document.getElementById("cona_cb");
	if(cona_cb.checked==true)
	{
		if(document.getElementById("council_districts_cb").checked==true)
		{
			document.getElementById("council_districts_cb").checked=false;
			council_districts_cb();
		}
		if(document.getElementById("nbrhd_assn_cb").checked==true)
		{
			document.getElementById("nbrhd_assn_cb").checked=false;
			nbrhd_assn_cb();
		}
		if(document.getElementById("police_districts_cb").checked==true)
		{
			document.getElementById("police_districts_cb").checked=false;
			police_districts_cb();
		}
		if(document.getElementById("city_poly_cb").checked==true)
		{
			document.getElementById("city_poly_cb").checked=false;
			city_poly_cb();
		}
		if(document.getElementById("fico_cb").checked==true)
		{
			document.getElementById("fico_cb").checked=false;
			fico_cb();
		}
		if(document.getElementById("biz_cb").checked==true)
		{
			document.getElementById("biz_cb").checked=false;
			biz_cb();
		}
	mtype="cona_labels";
      icon=icons[26]; //Sets current icon to city_hall
    	GDownloadUrl('data/cona.txt',process_it2); 
    var centreLat=27.782233860819332;
    var centreLon=-82.67725852213809;
    var initialZoomLevel=7;
    var n_buttonText="Map"; //Text that shows up on the button for the custom layer (n=normal, s=sat, h=hybrid)
    var s_buttonText="Satellite";
    var h_buttonText="Hybrid";
    var mapBounds=new GLatLngBounds(new GLatLng(27.64443093887601,-82.7669365527896),new GLatLng(27.920036782762658,-82.58758049148658));
    var opacity=0.5;

      var copyrightCollection = new GCopyrightCollection("GMapCreator");
      copyrightCollection.addCopyright(
          new GCopyright("CASA",
          new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)),
          0,
          "<a href=\"http://www.casa.ucl.ac.uk\">CASA</a>")
        );

     function customGetTileURL(a,b) {
      //converts tile x,y into keyhole string
      if (b>15) { return "cona/blank-tile.png"; };

      var c=Math.pow(2,b);
      var x=360/c*a.x-180;
      var y=180-360/c*a.y;
      var x2=x+360/c;
      var y2=y-360/c;
      var lon=x; //Math.toRadians(x); //would be lon=x+lon0, but lon0=0 degrees
      var lat=(2.0*Math.atan(Math.exp(y/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var lon2=x2;
      var lat2=(2.0*Math.atan(Math.exp(y2/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var tileBounds=new GLatLngBounds(new GLatLng(lat2,lon),new GLatLng(lat,lon2));

      if (!tileBounds.intersects(mapBounds)) { return "cona/blank-tile.png"; };
        var d=a.x;
        var e=a.y;
        var f="t";
        for(var g=0;g<b;g++){
            c=c/2;
            if(e<c){
                if(d<c){f+="q"}
                else{f+="r";d-=c}
            }
            else{
                if(d<c){f+="t";e-=c}
                else{f+="s";d-=c;e-=c}
            }
        }
        return "cona/"+f+".png"
    }
		var tilelayer = new GTileLayer(copyrightCollection , 0, 17);
        	tilelayer.getTileUrl = customGetTileURL;
        	tilelayer.isPng = function() { return false; };
        	tilelayer.getOpacity = function() { return opacity; };
    		cona_tilelayer = new GTileLayerOverlay(tilelayer);
		map.addOverlay(cona_tilelayer);
            ////loading(0); //Hides //loading box 
	}
	else
	{
		map.removeOverlay(cona_tilelayer);
		map.removeOverlay(cona_label_markers); //Removes city poly from map
		////loading(0);
	}
	////loading(0);	
}
//End
//Function for colleges checkbox
function colleges_cb()
{
	////loading(1); //Shows //loading box
	var colleges_cb=document.getElementById("colleges_cb");
	if(colleges_cb.checked==true)
	{
		mtype="colleges"; //Sets current marker type to colleges
		icon=icons[2]; //Sets current icon to colleges
		GDownloadUrl('data/stpete_schools_college.txt',process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<college_markers.length;i++)
		{
			map.removeOverlay(college_markers[i]); //Removes college markers from map
			counter[1]=0; //Reset counter for colleges
		}
		//loading(0); //Hides //loading box
	}
}
//End
//Function for community centers checkbox
function community_centers_cb()
{
	//loading(1); //Shows //loading box
	var community_centers_cb=document.getElementById("community_centers_cb");
	if(community_centers_cb.checked==true)
	{
		mtype="community_centers"; //Sets current marker type to community centers
		icon=icons[13]; //Sets current icon to community_centers
		GDownloadUrl('data/stpete_community_centers.txt',process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<community_center_markers.length;i++)
		{
			map.removeOverlay(community_center_markers[i]); // Removes community center markers from map
			counter[2]=0; //Reset counter for community centers
		}
		//loading(0); //Hides //loading box
	}
}
//End
//Function for community resource centers checkbox
function community_resource_centers_cb()
{
	//loading(1); //Shows //loading box
	var community_resource_centers_cb=document.getElementById("community_resource_centers_cb");
	if(community_resource_centers_cb.checked==true)
	{
		mtype="community_resource_centers"; //Sets current marker type to police resource centers
		icon=icons[12]; //Sets current icon to community_resource_centers
		GDownloadUrl('data/stpete_police_resource.txt',process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<community_resource_center_markers.length;i++)
		{
			map.removeOverlay(community_resource_center_markers[i]); //Remove markers from map
			counter[3]=0; //Reset counter for police resource centers
		}
		//loading(0); //Hides //loading box
	}
}
//End
function fico_cb()
{
	//loading(1); //Shows //loading box
	var fico_cb=document.getElementById("fico_cb");
	if(fico_cb.checked==true)
	{
		if(document.getElementById("council_districts_cb").checked==true)
		{
			document.getElementById("council_districts_cb").checked=false;
			council_districts_cb();
		}
		if(document.getElementById("nbrhd_assn_cb").checked==true)
		{
			document.getElementById("nbrhd_assn_cb").checked=false;
			nbrhd_assn_cb();
		}
		if(document.getElementById("police_districts_cb").checked==true)
		{
			document.getElementById("police_districts_cb").checked=false;
			police_districts_cb();
		}
		if(document.getElementById("cona_cb").checked==true)
		{
			document.getElementById("cona_cb").checked=false;
			cona_cb();
		}
		if(document.getElementById("city_poly_cb").checked==true)
		{
			document.getElementById("city_poly_cb").checked=false;
			city_poly_cb();
		}
		if(document.getElementById("biz_cb").checked==true)
		{
			document.getElementById("biz_cb").checked=false;
			biz_cb();
		}
		mtype="fico_labels";
		icon=icons[27];
		GDownloadUrl('data/fico.txt',process_it2);
    var centreLat=27.782233860819332;
    var centreLon=-82.67725852213809;
    var initialZoomLevel=7;
    var n_buttonText="Map"; //Text that shows up on the button for the custom layer (n=normal, s=sat, h=hybrid)
    var s_buttonText="Satellite";
    var h_buttonText="Hybrid";
    var mapBounds=new GLatLngBounds(new GLatLng(27.72015952432736,-82.71426702900513),new GLatLng(27.784582134431258,-82.62316214147083));
    var opacity=0.5;
    var copyrightCollection = new GCopyrightCollection("GMapCreator");
      copyrightCollection.addCopyright(
          new GCopyright("CASA",
          new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)),
          0,
          "<a href=\"http://www.casa.ucl.ac.uk\">CASA</a>")
        );
 	 function customGetTileURL(a,b) {
      //converts tile x,y into keyhole string
      if (b>15) { return "FICO/blank-tile.png"; };
      var c=Math.pow(2,b);
      var x=360/c*a.x-180;
      var y=180-360/c*a.y;
      var x2=x+360/c;
      var y2=y-360/c;
      var lon=x; //Math.toRadians(x); //would be lon=x+lon0, but lon0=0 degrees
      var lat=(2.0*Math.atan(Math.exp(y/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var lon2=x2;
      var lat2=(2.0*Math.atan(Math.exp(y2/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var tileBounds=new GLatLngBounds(new GLatLng(lat2,lon),new GLatLng(lat,lon2));

      if (!tileBounds.intersects(mapBounds)) { return "FICO/blank-tile.png"; };
        var d=a.x;
        var e=a.y;
        var f="t";
        for(var g=0;g<b;g++){
            c=c/2;
            if(e<c){
                if(d<c){f+="q"}
                else{f+="r";d-=c}
            }
            else{
                if(d<c){f+="t";e-=c}
                else{f+="s";d-=c;e-=c}
            }
        }
        return "FICO/"+f+".png"
    	}
		var tilelayer = new GTileLayer(copyrightCollection , 0, 17);
        	tilelayer.getTileUrl = customGetTileURL;
        	tilelayer.isPng = function() { return false; };
        	tilelayer.getOpacity = function() { return opacity; };
    		fico_tilelayer = new GTileLayerOverlay(tilelayer);
		map.addOverlay(fico_tilelayer);
            //loading(0); //Hides //loading box 
	}
	else
	{
		map.removeOverlay(fico_tilelayer); //Removes city poly from map
		map.removeOverlay(fico_label_markers);
		//loading(0); //Hides //loading box
	}
	//loading(0);
}
//End
//Function for firestations checkbox
function firestations_cb()
{
	//loading(1); //Shows //loading box
	var firestations_cb=document.getElementById("firestations_cb");
	if(firestations_cb.checked==true)
	{
		mtype="firestations"; //Sets current marker type to firestations
		icon=icons[5]; //Sets current icon to firestations
		GDownloadUrl('data/stpete_firestations.txt',process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<firestation_markers.length;i++)
		{
			map.removeOverlay(firestation_markers[i]);	//Remove markers from map
			counter[4]=0; //Reset counter for fire stations
		}
		//loading(0);
	}
}
//End
//Function for hotels
function hotels_cb()
{
      ////loading(1); //Shows //loading box
      var hotels_cb=document.getElementById("hotels_cb");
	if(hotels_cb.checked==true)
	{
			var once_per_session=1
			function get_cookie(Name) {
 			var search = Name + "="
  			var returnvalue = "";
  			if (document.cookie.length > 0) {
    			offset = document.cookie.indexOf(search)
    			if (offset != -1) { // if cookie exists
      			offset += search.length
      			// set index of beginning of value
      			end = document.cookie.indexOf(";", offset);
      			// set index of end of cookie value
      			if (end == -1)
         		end = document.cookie.length;
      			returnvalue=unescape(document.cookie.substring(offset, end))
      			}
   			}
  			return returnvalue;
			}
			function alertornot(){
			if (get_cookie('alerted_2')==''){
			loadalert()
			document.cookie="alerted_2=yes"
			}
			}
			function loadalert(){
			alert(alertrestaurant)
			}
			if (once_per_session==0)
			loadalert()
			else
			alertornot()
            //loading(1); //Shows //loading box
		GDownloadUrl('data/stpete_hotels_bnb.txt',process_h1);	//Pass text to 'process_h1' and create markers

		GDownloadUrl('data/stpete_hotels_local.txt',process_h2);	//Pass text to 'process_h2' and create markers

		GDownloadUrl('data/stpete_hotels_national.txt',process_h3);	//Pass text to 'process_h3' and create markers

	      //loading(0);
      }
	else
	{
		for(i=0;i<hotel_markers_1.length;i++)
		{
			map.removeOverlay(hotel_markers_1[i]);	//Remove markers from map
			counter[17]=0; //Reset counter for restaurants
		}
		for(i=0;i<hotel_markers_2.length;i++)
		{
			map.removeOverlay(hotel_markers_2[i]);	//Remove markers from map
			counter[18]=0; //Reset counter for restaurants
		}
		for(i=0;i<hotel_markers_3.length;i++)
		{
			map.removeOverlay(hotel_markers_3[i]);	//Remove markers from map
			counter[19]=0; //Reset counter for restaurants
		}
	}
}

//End
//Function for libraries checkbox
function libraries_cb()
{
	//loading(1);	//Shows //loading box
	var libraries_cb=document.getElementById("libraries_cb");
	if(libraries_cb.checked==true)
	{
		mtype="libraries"; //Sets current marker type to libraries
		icon=icons[6]; //Sets current icon to libraries
		GDownloadUrl('data/stpete_libraries.txt',process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<library_markers.length;i++)
		{
			map.removeOverlay(library_markers[i]); //Remove markers from map
			counter[5]=0; //Reset counter for libraries
		}
		//loading(0); //Hides //loading box
	}
}
//End
//Function for museums checkbox
function museums_cb()
{
	//loading(1); //Shows //loading box
	var museums_cb=document.getElementById("museums_cb");
	if(museums_cb.checked==true)
	{
		mtype="museums"; //Sets current marker type to museums
		icon=icons[7]; //Sets current icon to museums
		GDownloadUrl('data/stpete_museums.txt',process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<museum_markers.length;i++)
		{
			map.removeOverlay(museum_markers[i]); //Remove markers from map
			counter[6]=0; //Reset counter for muesums
		}
		//loading(0); //Hides //loading box
	}
}
//End
//Function for Municipal Services Center checkbox
function municipal_services_cb()
{
	//loading(1); //Shows //loading box
	var municipal_services_cb=document.getElementById("municipal_services_cb");
	if(municipal_services_cb.checked==true)
	{
		mtype="municipal_services"; //Sets current marker type to municipal_services
		icon=icons[8]; //Sets current icon to municipal_services
		GDownloadUrl('data/stpete_municipal_services.txt',process_it);	//Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<municipal_services_markers.length;i++)
		{
			map.removeOverlay(municipal_services_markers[i]); //Remove markers from map
			counter[24]=0; //Reset counter for muesums
		}
		//loading(0); //Hides //loading box
	}
}

//End
//Function for neighborhood associations checkbox
var na = new GGeoXml("http://mapguide.stpete.org/stpetegoogle/kml/nbrhds.kml");

function nbrhd_assn_cb()
{
	//loading(1); //Shows //loading box
	var nbrhd_assn_cb=document.getElementById("nbrhd_assn_cb");
	if(nbrhd_assn_cb.checked==true)
	{
		if(document.getElementById("council_districts_cb").checked==true)
		{
			document.getElementById("council_districts_cb").checked=false;
			council_districts_cb();
		}
		if(document.getElementById("city_poly_cb").checked==true)
		{
			document.getElementById("city_poly_cb").checked=false;
			city_poly_cb();
		}
		if(document.getElementById("police_districts_cb").checked==true)
		{
			document.getElementById("police_districts_cb").checked=false;
			police_districts_cb();
		}
		if(document.getElementById("fico_cb").checked==true)
		{
			document.getElementById("fico_cb").checked=false;
			fico_cb();
		}
		if(document.getElementById("biz_cb").checked==true)
		{
			document.getElementById("biz_cb").checked=false;
			biz_cb();
		}
		if(document.getElementById("cona_cb").checked==true)
		{
			document.getElementById("cona_cb").checked=false;
			cona_cb();
		}
		GDownloadUrl('data/stpete_neighborhood_labels.txt',process_na1);	//Pass text to 'process_r1' and create markers
		GDownloadUrl('data/stpete_neighborhood_labels22.txt',process_na2);

		{
			var request = GXmlHttp.create();
			request.open("GET", "data/DRCA.xml", true); //Pulls data from XML file
			request.onreadystatechange = function()
			{
				if(request.readyState==4)
				{
					var xmlDoc=GXml.parse(request.responseText);
					var lines=xmlDoc.documentElement.getElementsByTagName("line");
					for (var a=0;a<lines.length;a++)
					{
						var colour=lines[a].getAttribute("colour");	//Sets line color from XML file
						var width =parseFloat(lines[a].getAttribute("width"));//Sets line width from XML file.
						var opacity=lines[a].getAttribute("opacity");
						var points=lines[a].getElementsByTagName("point");
						var pts=[];
						for (var i=0;i<points.length;i++)
						{
							pts[i]=new GLatLng(parseFloat(points[i].getAttribute("lat")),
							parseFloat(points[i].getAttribute("lng")));
						}
						DRCA=new GPolyline(pts,colour,width,opacity);
						map.addOverlay(DRCA);	//Adds lines to map
					}
					//loading(0);         
        			}
			}
		request.send(null);
		}
		map.addOverlay(na);
	}
	else
	{
		for(i=0;i<na_markers_1.length;i++)
		{
			map.removeOverlay(na_markers_1[i]);	//Remove markers from map
			counter[28]=0; //Reset counter for restaurants
		}
		for(i=0;i<na_markers_2.length;i++)
		{
			map.removeOverlay(na_markers_2[i]);	//Remove markers from map
			counter[29]=0; //Reset counter for restaurants
		}
		map.removeOverlay(na);
		map.removeOverlay(DRCA); //Remove lines from map
		//loading(0);
	}
}

//Function for The Pier checkbox
function pier_cb()
{
	//loading(1); //Shows //loading box
	var pier_cb=document.getElementById("pier_cb");
	if(pier_cb.checked==true)
	{
		mtype="pier"; //Sets current marker type to pier
		icon=icons[9]; //Sets current icon to pier
		GDownloadUrl('data/stpete_pier.txt',process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		map.removeOverlay(pier_marker);	//Remove marker from map
		//loading(0); //Hides //loading box
	}
}
//End
//Function for The Pinellas Trail checkbox
function pinellas_trail_cb()
{
	//loading(1); //Shows //loading box
	var pinellas_trail_cb=document.getElementById("pinellas_trail_cb");
	if(pinellas_trail_cb.checked==true)
		{
		var request = GXmlHttp.create();
		request.open("GET", "data/stpete_pine_trail.xml", true); //Pulls data from XML file
		request.onreadystatechange = function()
		{
			if(request.readyState==4)
			{
				var xmlDoc=GXml.parse(request.responseText);
				var lines=xmlDoc.documentElement.getElementsByTagName("line");
				for (var a=0;a<lines.length;a++)
				{
					var colour=lines[a].getAttribute("colour");	//Sets line color from XML file
					var width =parseFloat(lines[a].getAttribute("width"));//Sets line width from XML file.
					var points=lines[a].getElementsByTagName("point");
					var pts=[];
					for (var i=0;i<points.length;i++)
					{
						pts[i]=new GLatLng(parseFloat(points[i].getAttribute("lat")),
						parseFloat(points[i].getAttribute("lng")));
					}
					pinellas_trail=new GPolyline(pts,colour,width);
					map.addOverlay(pinellas_trail);	//Adds lines to map
				}
				//loading(0);         
        		}
		}
		request.send(null);
	}
	else
	{
		map.removeOverlay(pinellas_trail); //Remove lines from map
		//loading(0); //Hides //loading box
	}
}
//End
function places_cb()
{
	//loading(1); //Shows //loading box
	var places_cb=document.getElementById("places_cb");
	if(places_cb.checked==true)
	{
		mtype="places"; //Sets current marker type to museums
		icon=icons[0]; //Sets current icon to museums
		GDownloadUrl('data/stpete_places.txt',process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<places_markers.length;i++)
		{
			map.removeOverlay(places_markers[i]); //Remove markers from map
			counter[23]=0; //Reset counter for muesums
		}
		//loading(0); //Hides //loading box
	}
}
//End
//Function for police districts checkbox
function police_districts_cb()
{
	//loading(1); //Shows //loading box
	var police_districts_cb=document.getElementById("police_districts_cb");
	if(police_districts_cb.checked==true)
	{
		if(document.getElementById("council_districts_cb").checked==true)
		{
			document.getElementById("council_districts_cb").checked=false;
			council_districts_cb();
		}
		if(document.getElementById("nbrhd_assn_cb").checked==true)
		{
			document.getElementById("nbrhd_assn_cb").checked=false;
			nbrhd_assn_cb();
		}
		if(document.getElementById("city_poly_cb").checked==true)
		{
			document.getElementById("city_poly_cb").checked=false;
			city_poly_cb();
		}
		if(document.getElementById("biz_cb").checked==true)
		{
			document.getElementById("biz_cb").checked=false;
			biz_cb();
		}
		if(document.getElementById("cona_cb").checked==true)
		{
			document.getElementById("cona_cb").checked=false;
			cona_cb();
		}
		if(document.getElementById("fico_cb").checked==true)
		{
			document.getElementById("fico_cb").checked=false;
			fico_cb();
		}
	mtype="districts"
	GDownloadUrl('data/stpete_police_districts.txt',process_zoom);
	var centreLat=27.782233860819332;
    var centreLon=-82.67725852213809;
    var initialZoomLevel=7;
    var n_buttonText="Map"; //Text that shows up on the button for the custom layer (n=normal, s=sat, h=hybrid)
    var s_buttonText="Satellite";
    var h_buttonText="Hybrid";
    var mapBounds=new GLatLngBounds(new GLatLng(27.687049699556578,-82.76882159803307),new GLatLng(27.92078626527356,-82.58111819269335));
    var opacity=0.25;

      var copyrightCollection = new GCopyrightCollection("GMapCreator");
      copyrightCollection.addCopyright(
          new GCopyright("CASA",
          new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)),
          0,
          "<a href=\"http://www.casa.ucl.ac.uk\">CASA</a>")
        );

    function customGetTileURL(a,b) {
      //converts tile x,y into keyhole string
      if (b>15) { return "police_districts-tiles/blank-tile.png"; };
      var c=Math.pow(2,b);
      var x=360/c*a.x-180;
      var y=180-360/c*a.y;
      var x2=x+360/c;
      var y2=y-360/c;
      var lon=x; //Math.toRadians(x); //would be lon=x+lon0, but lon0=0 degrees
      var lat=(2.0*Math.atan(Math.exp(y/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var lon2=x2;
      var lat2=(2.0*Math.atan(Math.exp(y2/180*Math.PI))-Math.PI/2.0)*180/Math.PI; //in degrees
      var tileBounds=new GLatLngBounds(new GLatLng(lat2,lon),new GLatLng(lat,lon2));

      if (!tileBounds.intersects(mapBounds)) { return "police_districts-tiles/blank-tile.png"; };
        var d=a.x;
        var e=a.y;
        var f="t";
        for(var g=0;g<b;g++){
            c=c/2;
            if(e<c){
                if(d<c){f+="q"}
                else{f+="r";d-=c}
            }
            else{
                if(d<c){f+="t";e-=c}
                else{f+="s";d-=c;e-=c}
            }
        }
        return "police_districts-tiles/"+f+".png"
    }
		var tilelayer = new GTileLayer(copyrightCollection , 0, 17);
        	tilelayer.getTileUrl = customGetTileURL;
        	tilelayer.isPng = function() { return false; };
        	tilelayer.getOpacity = function() { return opacity; };
    		police_districts_tilelayer = new GTileLayerOverlay(tilelayer);
		map.addOverlay(police_districts_tilelayer); 
		//loading(0);
	}
	else
	{
		for(i=0;i<district_markers.length;i++)
		{
			map.removeOverlay(district_markers[i]); //Removes police districts labels from map
			counter[10]=0; //Reset counter for police districts
		}
		map.removeOverlay(police_districts_tilelayer); //Removes police districts from map
		//loading(0); //Hides //loading box
	}
	//loading(0);
}
//End

/**************************************/
//new for kml
function recycle_primary_cb()
{
	var recycle_primary_cb=document.getElementById("recycle_primary_cb");
	if(recycle_primary_cb.checked==true)
		{
			map.addOverlay(kmlRecycleprim)
		}
	else
		{
			map.removeOverlay(kmlRecycleprim)
		}
}
function recycle_private_cb()
{
	var recycle_private_cb=document.getElementById("recycle_private_cb");
	if(recycle_private_cb.checked==true)
		{
			map.addOverlay(kmlRecyclepriv)
		}
	else
		{
			map.removeOverlay(kmlRecyclepriv)
		}
}
function recycle_public_cb()
{
	var recycle_public_cb=document.getElementById("recycle_public_cb");
	if(recycle_public_cb.checked==true)
		{
			map.addOverlay(kmlRecyclepub)
		}
	else
		{
			map.removeOverlay(kmlRecyclepub)
		}
}
//Function for Restaurants checkbox
function restaurants_cb() 
{     
	var restaurants_cb=document.getElementById("restaurants_cb");
	if(restaurants_cb.checked==true)
	{           
			//loading(1);
                  var once_per_session=1
			function get_cookie(Name) {
 			var search = Name + "="
  			var returnvalue = "";
  			if (document.cookie.length > 0) {
    			offset = document.cookie.indexOf(search)
    			if (offset != -1) { // if cookie exists
      		offset += search.length
      		// set index of beginning of value
      		end = document.cookie.indexOf(";", offset);
      		// set index of end of cookie value
      		if (end == -1)
         		end = document.cookie.length;
      		returnvalue=unescape(document.cookie.substring(offset, end))
      		}
   			}
  			return returnvalue;
			}
			function alertornot(){
			if (get_cookie('alerted_1')==''){
			loadalert()
			document.cookie="alerted_1=yes"
			}
			}
			function loadalert(){
			alert(alertrestaurant)
			}
			if (once_per_session==0)
			loadalert()
			else
			alertornot()
loading();
  		
		GDownloadUrl('data/stpete_restaurants_chain.txt',process_r1);	//Pass text to 'process_r1' and create markers
		GDownloadUrl('data/stpete_restaurants_dining.txt',process_r2);	//Pass text to 'process_r2' and create markers
		GDownloadUrl('data/stpete_restaurants_foodspirits.txt',process_r3);	//Pass text to 'process_r3' and create markers
	      unloading(0);
      }
	else
	{
		for(i=0;i<restaurant_markers_1.length;i++)
		{
			map.removeOverlay(restaurant_markers_1[i]);	//Remove markers from map
			counter[20]=0; //Reset counter for restaurants
		}
		for(i=0;i<restaurant_markers_2.length;i++)
		{
			map.removeOverlay(restaurant_markers_2[i]);	//Remove markers from map
			counter[21]=0; //Reset counter for restaurants
		}
		for(i=0;i<restaurant_markers_3.length;i++)
		{
			map.removeOverlay(restaurant_markers_3[i]);	//Remove markers from map
			counter[22]=0; //Reset counter for restaurants
		}
	}
}
//End
//Function for public schools checkbox
function schools_public_cb()
{
      //loading(1); //Shows //loading box
	var schools_public_cb=document.getElementById("schools_public_cb");
	if(schools_public_cb.checked==true)
	{
		mtype="schools_public";	//Sets current marker type to public schools
		icon=icons[20];	//Sets current icon type to public schools
		GDownloadUrl('data/stpete_schools_public.txt', process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<schools_public_markers.length;i++)
		{
			map.removeOverlay(schools_public_markers[i]); //Remove markers from map
			counter[11]=0; //Reset counter for public schools
		}
		//loading(0); //Hides //loading box
	}
}
//End
//Function for private schools checkbox
function schools_private_cb()
{
	//loading(1); //Shows //loading box
	var schools_private_cb=document.getElementById("schools_private_cb");
	if(schools_private_cb.checked==true)
	{
		mtype="schools_private"; //Sets current marker type to private schools
		icon=icons[21];	//Sets current icon to private schools
		GDownloadUrl('data/stpete_schools_private.txt', process_it); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<schools_private_markers.length;i++)
		{
			map.removeOverlay(schools_private_markers[i]);	//Remove markers from map
			counter[12]=0;	//Reset counter for private schools
		}
		//loading(0); //Hides //loading box
	}
}
//End
function street_view_cb()
{
	//loading(1);
	var street_view_cb=document.getElementById("street_view_cb");
	if(street_view_cb.checked==true)
	{
		map.disableDoubleClickZoom();
		svOverlay = new GStreetviewOverlay();  //adds streets view overlay
            map.addOverlay(svOverlay);  //adds streets view overlay
		svevent=GEvent.addListener(map,"dblclick",function(overlay,latlng)
		{
			document.getElementById("street_view").style.visibility="visible";
			myPano.remove();
			myPano.setLocationAndPOV(latlng);
		});   
		//loading(0);
	}
	else
	{
		map.enableDoubleClickZoom();
		map.removeOverlay(svOverlay);
		GEvent.removeListener(svevent);
		//loading(0);
	}
}








/* old code for xml's not being used
function recycle_secondary_cb()
{
	//loading(1); //Shows //loading box
	var recycle_secondary_cb=document.getElementById("recycle_secondary_cb");
	if(recycle_secondary_cb.checked==true)
	{
		mtype="recycle_secondary";	
		icon=icons[39];	
		GDownloadUrl('data/secondary_rec_loc.xml', process_rss); 
	}
	else
	{
		for(i=0;i<recycle_secondary_markers.length;i++)
		{
			map.removeOverlay(recycle_secondary_markers[i]); 
			counter[31]=0; 
		}
		//loading(0); //Hides //loading box
	}
}
//Function for recycling centers
function recycling_centers_cb()
{
	//loading(1); //Shows //loading box
	var recycling_centers_cb=document.getElementById("recycling_centers_cb");
	if(recycling_centers_cb.checked==true)
	{
		mtype="recycling_centers";	//Sets current marker type to recycling centers
		icon=icons[23];	//Sets current icon type to recycling centers
		GDownloadUrl('data/recycling_centers.xml', process_rss); //Pass text to 'process_it' and create markers
	}
	else
	{
		for(i=0;i<recycling_centers_markers.length;i++)
		{
			map.removeOverlay(recycling_centers_markers[i]); //Remove markers from map
			counter[15]=0; //Reset counter for recycling centers
		}
		//loading(0); //Hides //loading box
	}
}
//End


function recycle_primary_cb()
{
	//loading(1); //Shows //loading box
	var recycle_primary_cb=document.getElementById("recycle_primary_cb");
	if(recycle_primary_cb.checked==true)
	{
		mtype="recycle_primary";	
		icon=icons[38];	
		GDownloadUrl('data/primary_rec_loc.xml', process_rss); 
	}
	else
	{
		for(i=0;i<recycle_primary_markers.length;i++)
		{
			map.removeOverlay(recycle_primary_markers[i]); 
			counter[30]=0; 
		}
		//loading(0); //Hides //loading box
	}
}

//Function for recycling private sites
function recycle_private_cb()
{
	//loading(1); //Shows //loading box
	var recycle_private_cb=document.getElementById("recycle_private_cb");
	if(recycle_private_cb.checked==true)
	{
		mtype="recycle_private";	
		icon=icons[40];	
		GDownloadUrl('data/private_rec_loc.xml', process_rss); 
	}
	else
	{
		for(i=0;i<recycle_private_markers.length;i++)
		{
			map.removeOverlay(recycle_private_markers[i]); 
			counter[32]=0; 
		}
		//loading(0); //Hides //loading box
	}
}
*/

