//<![CDATA[

// arrays to hold copies of the markers and html used by the side_bar
// because the function closure trick doesnt work there
var gmarkers = [];

// Create our new marker icon
var busterIcon = new GIcon();
busterIcon.image = "/_images/_google_maps/pylon-icon.png";
busterIcon.shadow = "";
busterIcon.iconSize = new GSize(64, 64);
busterIcon.shadowSize = new GSize(0, 0);
busterIcon.iconAnchor = new GPoint(10, 64);
busterIcon.infoWindowAnchor = new GPoint(60, 15);

// Set up our GMarkerOptions object literal
markerOptions = { icon:busterIcon };


function start_map() 
	{
	if (GBrowserIsCompatible())
		{
	  	var map = new GMap2(document.getElementById('bootcamp_map'));
	    map.addControl(new GLargeMapControl());
	    map.addControl(new GMapTypeControl());
	    map.setCenter(new GLatLng(43.553238, -79.582022), 10);
    
		function createMarker(point,html,id) 
			{
	    	var marker = new GMarker(point, markerOptions);
	    	GEvent.addListener(marker, 'click', function() 
	    		{
	      		marker.openInfoWindowHtml(html); //switchTab(id);
	   		 	});
				// save the info we need to use later for the side_bar
				gmarkers.push(marker);
				return marker;
 			 }
 		 
		var point = new GLatLng(43.603958,-79.537867);
		var marker = createMarker(point,'<div style="width:240px"><b>Etobicoke South<br/>Franklin Horner Community Centre</b><br/>Year Round<br/>Monday, Tuesday, Wednesday, Thursday, Friday<br/>6:00AM, 9:30 AM, 6:30PM, 7:30PM<br/><a href="/secure/registration/standard.php?locationid=5">Register now.</a></div>', '0')
		map.addOverlay(marker);
		
		var point = new GLatLng(43.666194,-79.54549);
		var marker = createMarker(point,'<div style="width:240px"><b>Etobicoke Central<br/>St. Wilfrid\'s Church</b><br/>Year Round<br/><b>November/December</b><br/>Tuesday, Thursday - 6:00AM<br/><a href="/secure/registration/standard.php?locationid=3">Register now.</a></div>','1')
		//map.addOverlay(marker);
					
		var point = new GLatLng(43.6598502,-79.5654144);
		var marker = createMarker(point,'<div style="width:260px"><b>Etobicoke Central<br/>Josyf Cardinal Slipyj Catholic School</b><br/>October to April<br/>Tuesday, Thursday - 6:30PM, 7:30PM<br/><a href="/secure/registration/standard.php?locationid=3">Register now.</a></div>','2')
		map.addOverlay(marker);
		
		var point = new GLatLng(43.661134,-79.580896);
		var marker = createMarker(point,'<div style="width:240px"><b>Etobicoke West&amp;Central<br/>Richview United Church</b><br/>Year Round<br/>Tuesday, Thursday - 6:00AM, 6:30PM<br/><a href="/secure/registration/standard.php?locationid=4">Register now.</a></div>','3')
		map.addOverlay(marker);
		
		var point = new GLatLng(43.651727,-79.466643);
		var marker = createMarker(point,'<div style="width:240px"><b>High Park<br/>1873 Bloor St. W. <br />(Picnic Area #3)</b><br/><br />April 25th to October 7th (Outdoor)<br />Monday, Wednesday - 6:00AM,6:30PM,7:30PM<br />Tuesday, Thursday - 6:30PM<br/>Friday - 6:00AM,6:30PM<br /><a href="/secure/registration/standard.php?locationid=1">Register now.</a></div>','4')
		//map.addOverlay(marker);
		

		
		//oakville locations start
		var point = new GLatLng(43.397374,-79.721831);
		var marker = createMarker(point,'<div style="width:240px"><b>Oakville Church of The Nazarene</b><br/>October to April<br/>Mon, Wed, Fri 6am and Mon, Wed, Fri 6.30pm<br /><a href="/secure/registration/standard.php?locationid=11">Register now.</a></div>','5')
		map.addOverlay(marker);

		var point = new GLatLng(43.465255,-79.694223);
		var marker = createMarker(point,'<div style="width:240px"><b>Trinity United Church?</b><br/>October to April<br/>Tues, Thurs 6am<br/><a href="/secure/registration/standard.php?locationid=11">Register now.</a></div>','6')
		//map.addOverlay(marker);

		var point = new GLatLng(43.472091,-79.647918);
		var marker = createMarker(point,"<div style='width:240px'><b>St Cuthbert's Anglican Church</b><br/>October to April<br/>Tues, Thurs 6.30pm<br/><a href='/secure/registration/standard.php?locationid=11'>Register now.</a></div>","7")
		map.addOverlay(marker);
		
		
		var point = new GLatLng(43.6602129,-79.4742959);
		var marker = createMarker(point,'<div style="width:240px"><b>St. Cecilia Catholic Church<br />355 Annette St. </b><br/><br />October 18 to April 16 (Indoor)<br />Monday, Wednesday, Friday - 6:30PM<br />Monday, Wednesday - 7:30PM<br /><a href="/secure/registration/standard.php?locationid=1">Register now.</a></div>','8')
		map.addOverlay(marker);
		
		
		var point = new GLatLng(43.6462021,-79.4730271);
		var marker = createMarker(point,'<div style="width:240px"><b>High Park Presbyterian Church<br/>4 Morningside Avenue</b><br /><br />October 18 to April 16 (Indoor)<br />Monday, Wednesday, Friday - 6:00AM<br />Tuesday, Thursday - 6:30PM<br /><a href="/secure/registration/standard.php?locationid=1">Register now.</a></div>','9')
		map.addOverlay(marker);
		

		//var point = new GLatLng(43.669693,-79.298943);
//		var marker = createMarker(point,'<div style="width:240px"><b>The Beach United Church<br/>(across from Kew Gardens)</b><br />Year Round<br />Tuesday, Thursday<br/>6:00AM<br/><a href="/secure/registration/standard.php?locationid=6">Register now.</a></div>','13')
//		//map.addOverlay(marker);
//		
//		var point = new GLatLng(43.674098, -79.345945);
//		var marker = createMarker(point,'<div style="width:240px"><b>Withrow Park</b><br/>April to September<br/>Monday, Wednesday, Friday<br/>6:30PM<br/><a href="/secure/registration/standard.php?locationid=9">Register now.</a></div>','14')
//		//map.addOverlay(marker);
//
		var point = new GLatLng(43.618755,-79.608187);
		var marker = createMarker(point,'<div style="width:240px"><b>Church Of The Holy Spirit</b><br/>Year Round<br/>Monday, Wednesday - 6:00AM, 6:30PM<br/><a href="/secure/registration/standard.php?locationid=10">Register now.</a></div>','10')
		map.addOverlay(marker);


		var point = new GLatLng(43.673583, -79.5480879);
		var marker = createMarker(point,'<div style="width:240px"><b>PLAST Ukraninian Youth Association</b><br/>Year Round<br/>Tuesday, Thursday - 6:00AM<br/><a href="/secure/registration/standard.php?locationid=3">Register now.</a></div>','11')
		map.addOverlay(marker);


//		var point = new GLatLng(43.687104,-79.31654);
//		var marker = createMarker(point,'<div style="width:240px"><b>Danforth<br />St. Brigid Catholic School</b><br/>October to April<br/>Tuesday, Thursday - 6:30PM<br/><a href="/secure/registration/standard.php?locationid=9">Register now.</a></div>','11')
//		//map.addOverlay(marker);
//		
//		var point = new GLatLng(43.660715,-79.557469);
//		var marker = createMarker(point,'<div style="width:240px"><b>West Deane Park</b><br/>Tuesday + Thursday<br/>6:00AM, 6:30PM, 7:30PM<br/><a href="/secure/registration/standard.php?locationid=9">Register now.</a></div>','12')
//		//map.addOverlay(marker);

		}
	}

    //]]>
function switchTab(tabid)
	{
		//alert(tabid);
	var id = tabid;
//	for (i=0;i<=11;i++)
//		{
//		document.getElementById('lt'+i).className='tab_unselected';
//		document.getElementById('lp'+i).style.display='none';
//		}
//
//	document.getElementById('lt'+id).className='tab_selected';
//	document.getElementById('lp'+id).style.display='block';

$(".tab_selected").removeClass("tab_selected").addClass("tab_unselected");
$(".mmcenter").hide();
$("#lt" + id).removeClass("tab_unselected").addClass("tab_selected");
$("#lp" + id).show();

	}

function myclick(i) // This function picks up the click and opens the corresponding info window
	{
switchTab(i);
if(i == 6) { GEvent.trigger(gmarkers[4], 'click'); }
if(i == 5) { GEvent.trigger(gmarkers[8], 'click'); }
if(i == 4) { GEvent.trigger(gmarkers[9], 'click'); }

if(i == 20) { GEvent.trigger(gmarkers[5], 'click'); }
if(i == 21) { GEvent.trigger(gmarkers[6], 'click'); }
if(i == 22) { GEvent.trigger(gmarkers[7], 'click'); }
if(i == 23) { GEvent.trigger(gmarkers[11], 'click'); }

if(i == 0) { GEvent.trigger(gmarkers[0], 'click'); }
if(i == 2) { GEvent.trigger(gmarkers[2], 'click'); }
if(i == 3) { GEvent.trigger(gmarkers[3], 'click'); }

if(i == 10) { GEvent.trigger(gmarkers[10], 'click'); }

//alert(i);


	}
