var mapLocator; //The Google Maps Map object
var locations = []; //Array of JSON locations
var busRoutes = []; //Array of Google Maps PolyLines representing bus routes
var totalBusRoutes; //The total number of bus routes. Required to load bus routes on request

//Called on document load
function InitMap()
{
	//Create Google Maps LatLng position for City Hall - starting map center location
	var llSpokaneCityHall = new google.maps.LatLng(47.6602, -117.4237);
    
    //Create the Google Maps Map
    mapLocator = new google.maps.Map(document.getElementById("map-canvas"), {
        zoom: 13,
        center: llSpokaneCityHall,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        mapTypeControlOptions: 
        {
        	style: google.maps.MapTypeControlStyle.DEFAULT,
        	position: google.maps.ControlPosition.TOP_RIGHT
        },
        navigationControlOptions:
        {
        	position: google.maps.ControlPosition.TOP_LEFT
        }
    });
    
    //Clear all checkboxes in UI
	$('div#stnd-ui input:checked').removeAttr('checked');
	
	//Create the login dialog box
	$('div.login.dialog').dialog(
	{
		modal: true,
		autoOpen: false,
		title: "Program manager log in",
		width: 460
	});
	
	//Create the login dialog box
	$('div.signup.dialog').dialog(
	{
		modal: true,
		autoOpen: false,
		title: "Program manager signup",
		width: 460
	});

	//Create the disclaimer and terms of use dialog box
	$('div.terms.dialog').dialog(
	{
		modal: true,
		autoOpen: false,
		title: "YouthLink disclaimer &amp; Terms of use",
		width: 500
	});
	
	//Create the password reset dialog box
	$('div.password.dialog').dialog(
	{
		modal: true,
		autoOpen: false,
		title: "Forgotten password",
		width: 460
	});
}
