
//This file contains function to be preformed when the page is loaded
//Function to show loading box when loading layers

function loading()
	{
	document.getElementById("loading").style.visibility="visible"; 
	}
function unloading()
	{
	document.getElementById("loading").style.visibility="hidden"; 
	}

function svclose()
{
	myPano.remove();
	document.getElementById("street_view").style.visibility="hidden";
}
//End
//Function that activates when page loads
function body_onload()
{
	if(GBrowserIsCompatible())
	{ 
            document.getElementById("boat_ramps_cb").checked=false;
		document.getElementById("council_districts_cb").checked=false;
		document.getElementById("nbrhd_assn_cb").checked=false;
      if(self.location.search == "?a" )
            {
            document.getElementById("boat_ramps_cb").checked=true;
            }
	else if (self.location.search == "?b")
            {
	  	document.getElementById("council_districts_cb").checked=true;
           	}
      else if (self.location.search == "?c")
            {
            document.getElementById("nbrhd_assn_cb").checked=true;
            }
      else
      	{}
                            
		//Uncheck all checkboxes when page is loaded
		//document.getElementById("arts_cb").checked=false;
		//document.getElementById("arts_dest_cb").checked=false;
		//document.getElementById("arts_opportunity_cb").checked=false;
		document.getElementById("biz_cb").checked=false;
		document.getElementById("city_poly_cb").checked=false;
            document.getElementById("colleges_cb").checked=false;
		document.getElementById("cona_cb").checked=false;
		document.getElementById("community_centers_cb").checked=false;
		document.getElementById("community_resource_centers_cb").checked=false;
		document.getElementById("fico_cb").checked=false;
		document.getElementById("firestations_cb").checked=false;
		document.getElementById("hotels_cb").checked=false;
		document.getElementById("libraries_cb").checked=false;
		document.getElementById("museums_cb").checked=false;
		document.getElementById("municipal_services_cb").checked=false;
		document.getElementById("pinellas_trail_cb").checked=false;
		document.getElementById("places_cb").checked=false;
		document.getElementById("police_districts_cb").checked=false;
		document.getElementById("recycle_primary_cb").checked=false;
		document.getElementById("recycle_public_cb").checked=false;
		document.getElementById("recycle_private_cb").checked=false;
		document.getElementById("restaurants_cb").checked=false;
            document.getElementById("schools_public_cb").checked=false;
		document.getElementById("schools_private_cb").checked=false;
		document.getElementById("street_view_cb").checked=false;
		document.getElementById("city_webcams_cb").checked=false;
		//End
		map=new GMap2(document.getElementById("map"));	//Creates map
		map.addControl(new GSmallMapControl());	//Adds map control to map
		map.addControl(new GMapTypeControl());	//Adds map type to map
		map.setCenter(new GLatLng( 27.7852455,-82.678634), 12);	//Centers map
               	try
		{
                	myPano = new GStreetviewPanorama(document.getElementById("pano"));
		}
		catch(e)
		{
		}         
 		lsc=new google.maps.LocalSearch(); 	//Creates map search
     	  	map.addControl(new google.maps.LocalSearch());	//Adds search to map
		map.enableScrollWheelZoom();	//Enables zoom scrolling
        	//map.addControl(new GOverviewMapControl);	//Adds overview map to map
		//document.getElementById("arts_cb").onclick=arts_cb;
		//document.getElementById("arts_dest_cb").onclick=arts_dest_cb;
		//document.getElementById("arts_opportunity_cb").onclick=arts_opportunity_cb;
		document.getElementById("biz_cb").onclick=biz_cb;
		document.getElementById("boat_ramps_cb").onclick=boat_ramps_cb;
		document.getElementById("city_poly_cb").onclick=city_poly_cb;
           	document.getElementById("colleges_cb").onclick=colleges_cb;
		document.getElementById("cona_cb").onclick=cona_cb;
		document.getElementById("council_districts_cb").onclick=council_districts_cb;
		document.getElementById("community_centers_cb").onclick=community_centers_cb;
		document.getElementById("community_resource_centers_cb").onclick=community_resource_centers_cb;
		document.getElementById("fico_cb").onclick=fico_cb;
		document.getElementById("firestations_cb").onclick=firestations_cb;
		document.getElementById("hotels_cb").onclick=hotels_cb;
		document.getElementById("libraries_cb").onclick=libraries_cb;
		document.getElementById("museums_cb").onclick=museums_cb;
		document.getElementById("municipal_services_cb").onclick=municipal_services_cb;
		document.getElementById("nbrhd_assn_cb").onclick=nbrhd_assn_cb;
		document.getElementById("pinellas_trail_cb").onclick=pinellas_trail_cb;
		document.getElementById("places_cb").onclick=places_cb;
		document.getElementById("police_districts_cb").onclick=police_districts_cb;
		document.getElementById("recycle_primary_cb").onclick=recycle_primary_cb;
		document.getElementById("recycle_public_cb").onclick=recycle_public_cb;
		document.getElementById("recycle_private_cb").onclick=recycle_private_cb;
		document.getElementById("restaurants_cb").onclick=restaurants_cb;
		document.getElementById("schools_public_cb").onclick=schools_public_cb;
		document.getElementById("schools_private_cb").onclick=schools_private_cb;
		document.getElementById("business_lr").onclick=business_lr;
            document.getElementById("general_lr").onclick=general_lr;
		document.getElementById("municipal_lr").onclick=municipal_lr;
		document.getElementById("overlays_lr").onclick=overlays_lr;
		document.getElementById("recycling_lr").onclick=recycling_lr;
		document.getElementById("schools_lr").onclick=schools_lr;
		document.getElementById("svclose").onclick=svclose;
		document.getElementById("street_view_cb").onclick=street_view_cb;
		document.getElementById("city_webcams_cb").onclick=city_webcam_cb;
		//End
		//Creates array of numbered labels 1-8 for council polys
		for(i=0;i<9;i++)
		{
			var j=i+1;
			licon[i]=new GIcon(baseIcon, "images/label_"+j+".gif", null);
		}
		//End

		
		//Creates array of counters for markers and htmls
		for(i=0;i<36;i++)
		{
			counter[i]=0;
		}
		//End

		//Creates icons for markers
		icons[0]=new GIcon(baseIcon, "images/library.png", null, "images/library_shadow.png"); //Icon for BayWalk
		icons[1]=new GIcon(baseIcon, "images/city_hall.png", null, "images/city_hall_shadow.png"); //Icon for City Hall
		icons[2]=new GIcon(baseIcon, "images/college.png", null, "images/school_shadow.png"); //Icon for colleges
		icons[3]=new GIcon(baseIcon, "images/community_center.png", null, "images/community_center_shadow.png"); //Icon for community centers
		icons[4]=new GIcon(baseIcon, "images/community_resource_center.png", null, "images/community_resource_center_shadow.png"); //Icon for community resource centers
		icons[5]=new GIcon(baseIcon, "images/firestation.png", null, "images/firestation_shadow.png"); //Icon for firestations
		icons[6]=new GIcon(baseIcon, "images/library2.png", null, "images/library_shadow.png");	//Icon for libraries
		icons[7]=new GIcon(baseIcon, "images/museum.png", null, "images/museum_shadow.png"); //Icon for museums
		icons[8]=new GIcon(baseIcon, "images/municipal_services.png", null, "images/municipal_services_shadow.png"); //Icon for Municipal Services Center
		icons[9]=new GIcon(baseIcon, "images/pier.png", null, "images/pier_shadow.png"); //Icon for The Pier
		icons[10]=new GIcon(baseIcon,"images/park.png",null,"images/park_shadow.png"); //Icon for parks
		icons[11]=new GIcon(baseIcon, "images/playground.png", null, "images/playground_shadow.png"); //Icon for playgrounds
		icons[12]=new GIcon(baseIcon, "images/policestation.png", null, "images/policestation_shadow.png"); //Icon for police station
            icons[13]=new GIcon(baseIcon, "images/sunshine.png", null, "images/sunken_gardens_shadow.png"); //Icon for Sunken Gardens
		icons[14]=new GIcon(baseIcon, "images/tropicana.png", null, "images/tropicana_shadow.png"); // Icon for The Tropicana Field
		icons[15]=new GIcon(baseIcon64, "images/astrisk.gif", null); //Icon for astrisk (neighborhood associations overlay)
		icons[16]=new GIcon(baseIcono, "images/label_14-70.gif", null); //Icon for 13-84 overlapping neighborhoods (neighborhood associations overlay)
		icons[17]=new GIcon(baseIcono, "images/label_2-30.gif", null); //Icon for 64-82 overlapping neighborhoods (neighborhood associations overlay)
		icons[18]=new GIcon(baseIcono, "images/label_65-79.gif", null); //Icon for 65-79 overlapping neighborhoods (neighborhood associations overlay)
		icons[19]=new GIcon(baseIcono, "images/label_2-30.gif", null); //Icon for 33-95 overlapping neighborhoods (neighborhood associations overlay)
		icons[20]=new GIcon(baseIcon, "images/public_school.png", null, "images/school_shadow.png"); //Icon for public schools
		icons[21]=new GIcon(baseIcon, "images/private_school.png", null, "images/school_shadow.png"); //Icon for private schools
		icons[22]=new GIcon(baseIcon, "images/camera.gif", null); //Icon for web cams
		icons[23]=new GIcon(baseIcon, "images/Earth_recycling.png", null); //Icon for recycle centers
            icons[24]=new GIcon(baseIcon, "images/hamburger-32.png", null); //Icon for restaurants
		icons[25]=new GIcon(baseIcon, "images/boat.png", null); //Icon for boat ramps
		icons[26]=new GIcon(baseIconLarge, "images/cona.png", null);
		icons[27]=new GIcon(baseIconLarge, "images/fico.png", null);
		
		icons[35]=new GIcon(baseIcon, "images/community_centerbl.png", null, "images/community_center_shadow.png");
		icons[36]=new GIcon(baseIcon, "images/neighborhood.png", null); //Icon for boat 
		icons[37]=new GIcon(baseIcon, "images/neighborhoodbl.png", null); //Icon for boat  ramps
		icons[38]=new GIcon(baseIcon, "images/recycling_15.png", null); //Icon for recycle centers
		icons[39]=new GIcon(baseIcon, "images/recycling_secondary_15.png", null); //Icon for recycle centers
            icons[40]=new GIcon(baseIcon, "images/blueflower.png", null);
		icons[41]=new GIcon(baseIcon, "images/brush.png", null);
		icons[42]=new GIcon(baseIcon, "images/redflower.png", null);
		icons[400]=new GIcon(baseIconBiz, "images/4th.png", null);
		icons[401]=new GIcon(baseIconBiz, "images/9th.png", null); 
		icons[402]=new GIcon(baseIconBiz, "images/16th.png", null); 
		icons[403]=new GIcon(baseIconBiz, "images/22nd.png", null); 
		icons[404]=new GIcon(baseIconBiz, "images/34th.png", null); 
		icons[405]=new GIcon(baseIconBiz, "images/49th.png", null); 
		icons[406]=new GIcon(baseIconBiz, "images/central.png", null);
		icons[407]=new GIcon(baseIconBiz, "images/west_central.png", null);
		hicon1=new GIcon(baseIconDine, "images/iconp.png", null); //Temp Icon for new Restaurants Geocoded centerline
		hicon2=new GIcon(baseIconDine, "images/icono.png", null); //Temp Icon for new Restaurants Geocoded centerline
		hicon3=new GIcon(baseIconDine, "images/icont.png", null); //Temp Icon for new Restaurants Geocoded centerline
            ricon1=new GIcon(baseIconDine, "images/icong.png", null); //Temp Icon for new Restaurants Geocoded centerline
		ricon2=new GIcon(baseIconDine, "images/iconr.png", null); //Temp Icon for new Restaurants Geocoded centerline
		ricon3=new GIcon(baseIconDine, "images/iconb.png", null); //Temp Icon for new Restaurants Geocoded centerline
		 //End
		gzoom=GEvent.addListener(map,"zoomend",on_mousemove); //Creates event to execute on_mousmove when map is zoomed
		zoom=map.getZoom(); //Sets zoom level
		 if(self.location.search == "?a" )
                  {
                  boat_ramps_cb();
                  }
             else if (self.location.search == "?b")
                  {
	  	 	council_districts_cb();
            	}
             else if (self.location.search == "?c")
                  {
                  nbrhd_assn_cb();
           		}
             else
                  {}
                	 	 	 
	}
	else
	{
	}
}
//End
window.onload=body_onload; //Runs body_onload function when page is loaded
alert("DISCLAIMER----The information in these pages is provided for your personal use as is, along with the understanding that it is not guaranteed to be accurate, correct, or complete. Information found here should not be used to make financial decisions or other commitments and any conclusions drawn from such information are the responsibility of the user. While every effort is made to ensure the accuracy, correctness, and timeliness of the data presented anywhere on these pages, the City of St. Petersburg makes no warranty or guarantee as to the content, accuracy, timeliness, or completeness of any of these data provided and assumes no liability for the use of these maps and data.");
window.onunload=GUnload; //Runs Googles unload function when page is unloaded
