//Declare variables for later use
var overview_map;
var whiteIcon, greenIcon, yellowIcon;
var officeHMarker, draperPMarker, porcupinePMarker, simbaspringsCEMarker;
var tabs;

function loadMap()
{
	// loadMap: initialize the API and load the map onto the page

	// Get the map container div
	var mapDiv = document.getElementById('my_map_div_id');

	// Confirm browser compatibility with the Maps API

	if (!GBrowserIsCompatible())
    	{
    	mapDiv.innerHTML = 'Sorry, your browser isn\'t compatible with Google Maps.';
    	}
	else
    	{

		// Initialize the core map object
		map = new GMap2(mapDiv, {mapTypes: [G_PHYSICAL_MAP, G_HYBRID_MAP, G_NORMAL_MAP, G_SATELLITE_MAP]});

		// Set the started map viewport, based on center coordinates and zoom level
		var hailey_coord = new GLatLng(43.520665,-114.313357);
		map.setCenter(hailey_coord, 8, G_NORMAL_MAP);

		// Add the standard map controls
		//map.addControl(new GSmallMapControl());
		map.addControl(new GLargeMapControl());
		var bottomRight = new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20));
		map.addControl(new GScaleControl(), bottomRight);
		// map.addControl(new GOverviewMapControl());
		map.addControl(new GMapTypeControl());
		//map.enableGoogleBar();
		map.enableScrollWheelZoom();

		// Initialize a new icon, based on the GMaps default but in green
		greenIcon = new GIcon(G_DEFAULT_ICON);
		greenIcon.image = '/overview_map/markers/green.png';

		// Initialize a new icon, based on the GMaps default but in white
		whiteIcon = new GIcon(G_DEFAULT_ICON);
		whiteIcon.image = '/overview_map/markers/white.png';

		// Initialize a new icon, based on the GMaps default but in yellow
		yellowIcon = new GIcon(G_DEFAULT_ICON);
		yellowIcon.image = '/overview_map/markers/yellow.png';

		// Initialize a new icon, based on the GMaps default but in yellow
		redIcon = new GIcon(G_DEFAULT_ICON);
		redIcon.image = '/overview_map/markers/red.png';
		
		var myTitle = "";
		
		//alert('');

        // Markers for Building Projects (white icons).

        


//Anderson House Project
myTitle = "Anderson House Project";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('andersonho_tab_photo'))];
coordinates = new GLatLng(43.521010, -114.313650);
andersonhoSPMarker = new GMarker(coordinates, {icon: redIcon, title: myTitle});
andersonhoSPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(andersonhoSPMarker);



//Antelope Valley Ranch
myTitle = "Antelope Valley Ranch";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('antelopeva_tab_photo'))];
coordinates = new GLatLng(43.706388, -113.637741);
antelopevaCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
antelopevaCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(antelopevaCEMarker);



//Aspen Drive Project
myTitle = "Aspen Drive Project";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('aspendrive_tab_photo'))];
coordinates = new GLatLng(43.513030, -114.316690);
aspendriveSPMarker = new GMarker(coordinates, {icon: redIcon, title: myTitle});
aspendriveSPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(aspendriveSPMarker);



//Barbara Farm
myTitle = "Barbara Farm";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('barbarafar_tab_photo'))];
coordinates = new GLatLng(42.958316, -114.472823);
barbarafarCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
barbarafarCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(barbarafarCEMarker);



//Big Springs Creek
myTitle = "Big Springs Creek";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('bigsprings_tab_photo'))];
coordinates = new GLatLng(44.554712, -113.888522);
bigspringsCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
bigspringsCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(bigspringsCEMarker);



//Blue Grouse Preserve
myTitle = "Blue Grouse Preserve";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('bluegrouse_tab_photo'))];
coordinates = new GLatLng(43.587382, -114.330265);
bluegrousePMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
bluegrousePMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(bluegrousePMarker);



//Boxcar Bend Preserve
myTitle = "Boxcar Bend Preserve";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('boxcarbend_tab_photo'))];
coordinates = new GLatLng(43.616126, -114.352205);
boxcarbendPMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
boxcarbendPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(boxcarbendPMarker);



//Bullion Bridge
myTitle = "Bullion Bridge";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('bullionbri_tab_photo'))];
coordinates = new GLatLng(43.516932, -114.321876);
bullionbriPJMarker = new GMarker(coordinates, {icon: whiteIcon, title: myTitle});
bullionbriPJMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(bullionbriPJMarker);



//Church Farm
myTitle = "Church Farm";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('churchfarm_tab_photo'))];
coordinates = new GLatLng(43.336734, -114.261365);
churchfarmPJMarker = new GMarker(coordinates, {icon: whiteIcon, title: myTitle});
churchfarmPJMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(churchfarmPJMarker);



//Colorado Gulch
myTitle = "Colorado Gulch";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('coloradogu_tab_photo'))];
coordinates = new GLatLng(43.502687, -114.303583);
coloradoguCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
coloradoguCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(coloradoguCEMarker);



//Cottonwood
myTitle = "Cottonwood";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('cottonwood_tab_photo'))];
coordinates = new GLatLng(43.565192, -114.344215);
cottonwoodCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
cottonwoodCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(cottonwoodCEMarker);



//Cowcatcher Ridge
myTitle = "Cowcatcher Ridge";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('cowcatcher_tab_photo'))];
coordinates = new GLatLng(43.482927, -114.255429);
cowcatcherPMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
cowcatcherPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(cowcatcherPMarker);



//Croesus Creek
myTitle = "Croesus Creek";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('croesuscre_tab_photo'))];
coordinates = new GLatLng(43.492597, -114.352904);
croesuscreCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
croesuscreCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(croesuscreCEMarker);



//Croy Creek Wetland Restoration
myTitle = "Croy Creek Wetland Restoration";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('croycreekw_tab_photo'))];
coordinates = new GLatLng(43.513538, -114.319909);
croycreekwPJMarker = new GMarker(coordinates, {icon: whiteIcon, title: myTitle});
croycreekwPJMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(croycreekwPJMarker);



//Double Springs Ranch
myTitle = "Double Springs Ranch";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('doublespri_tab_photo'))];
coordinates = new GLatLng(44.33443, -113.771892);
doublespriCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
doublespriCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(doublespriCEMarker);



//Draper Croy Creek Boardwalk
myTitle = "Draper Croy Creek Boardwalk";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('drapercroy_tab_photo'))];
coordinates = new GLatLng(43.509561, -114.319193);
drapercroyPJMarker = new GMarker(coordinates, {icon: whiteIcon, title: myTitle});
drapercroyPJMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(drapercroyPJMarker);



//Draper Wood River Preserve
myTitle = "Draper Wood River Preserve";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('draperwood_tab_photo'))];
coordinates = new GLatLng(43.509561, -114.319193);
draperwoodPMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
draperwoodPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(draperwoodPMarker);



//Elkhorn Creek Project
myTitle = "Elkhorn Creek Project";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('elkhorncre_tab_photo'))];
coordinates = new GLatLng(0.000000, 0.000000);
elkhorncrePJMarker = new GMarker(coordinates, {icon: whiteIcon, title: myTitle});
elkhorncrePJMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(elkhorncrePJMarker);



//Houston Road
myTitle = "Houston Road";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('houstonroa_tab_photo'))];
coordinates = new GLatLng(0.008366, 0.003328);
houstonroaCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
houstonroaCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(houstonroaCEMarker);



//Howard Preserve Project
myTitle = "Howard Preserve Project";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('howardpres_tab_photo'))];
coordinates = new GLatLng(43.462852, -114.262111);
howardpresPJMarker = new GMarker(coordinates, {icon: whiteIcon, title: myTitle});
howardpresPJMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(howardpresPJMarker);



//Hulen Meadows Floodplain Mgmt
myTitle = "Hulen Meadows Floodplain Mgmt";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('hulenmeado_tab_photo'))];
coordinates = new GLatLng(43.716322, -113.619631);
hulenmeadoPJMarker = new GMarker(coordinates, {icon: whiteIcon, title: myTitle});
hulenmeadoPJMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(hulenmeadoPJMarker);



//Hyndman Creek
myTitle = "Hyndman Creek";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('hyndmancre_tab_photo'))];
coordinates = new GLatLng(43.657824, -114.239657);
hyndmancreCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
hyndmancreCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(hyndmancreCEMarker);



//Independence Creek Preserve
myTitle = "Independence Creek Preserve";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('independen_tab_photo'))];
coordinates = new GLatLng(43.668464, -114.308408);
independenPMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
independenPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(independenPMarker);



//Lake Creek Preserve
myTitle = "Lake Creek Preserve";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('lakecreekp_tab_photo'))];
coordinates = new GLatLng(43.729562, -114.379572);
lakecreekpPMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
lakecreekpPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(lakecreekpPMarker);



//Lower Board Ranch
myTitle = "Lower Board Ranch";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('lowerboard_tab_photo'))];
coordinates = new GLatLng(43.686001, -114.408895);
lowerboardCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
lowerboardCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(lowerboardCEMarker);



//Mays Creek
myTitle = "Mays Creek";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('mayscreek_tab_photo'))];
coordinates = new GLatLng(43.383412, -114.961433);
mayscreekCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
mayscreekCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(mayscreekCEMarker);



//Neher Preserve
myTitle = "Neher Preserve";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('neherprese_tab_photo'))];
coordinates = new GLatLng(42.944822, -114.367845);
neherpresePMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
neherpresePMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(neherpresePMarker);



//Old Chilly
myTitle = "Old Chilly";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('oldchilly_tab_photo'))];
coordinates = new GLatLng(44.035144, -113.824807);
oldchillyCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
oldchillyCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(oldchillyCEMarker);



//Peach Creek Preserve
myTitle = "Peach Creek Preserve";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('peachcreek_tab_photo'))];
coordinates = new GLatLng(44.253856, -114.643470);
peachcreekPMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
peachcreekPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(peachcreekPMarker);



//Picabo Ranch
myTitle = "Picabo Ranch";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('picaboranc_tab_photo'))];
coordinates = new GLatLng(43.330759, -114.101969);
picaborancCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
picaborancCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(picaborancCEMarker);



//Pioneer Moon
myTitle = "Pioneer Moon";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('pioneermoo_tab_photo'))];
coordinates = new GLatLng(43.652931, -114.21705);
pioneermooCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
pioneermooCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(pioneermooCEMarker);



//Porcupine Creek
myTitle = "Porcupine Creek";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('porcupinec_tab_photo'))];
coordinates = new GLatLng(43.580954, -114.097522);
porcupinecPMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
porcupinecPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(porcupinecPMarker);



//Sellgren Trail
myTitle = "Sellgren Trail";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('sellgrentr_tab_photo'))];
coordinates = new GLatLng(43.707662, -114.356788);
sellgrentrCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
sellgrentrCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(sellgrentrCEMarker);



//Sheep Bridge Canyon Project
myTitle = "Sheep Bridge Canyon Project";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('sheepbridg_tab_photo'))];
coordinates = new GLatLng(43.329649, -114.372197);
sheepbridgPJMarker = new GMarker(coordinates, {icon: whiteIcon, title: myTitle});
sheepbridgPJMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(sheepbridgPJMarker);



//Simba Springs
myTitle = "Simba Springs";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('simbasprin_tab_photo'))];
coordinates = new GLatLng(44.229333, -114.493736);
simbasprinCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
simbasprinCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(simbasprinCEMarker);



//Square Lake Preserve
myTitle = "Square Lake Preserve";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('squarelake_tab_photo'))];
coordinates = new GLatLng(43.266862, -114.315965);
squarelakePJMarker = new GMarker(coordinates, {icon: whiteIcon, title: myTitle});
squarelakePJMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(squarelakePJMarker);



//Three Mile Creek
myTitle = "Three Mile Creek";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('threemilec_tab_photo'))];
coordinates = new GLatLng(43.368034, -114.896927);
threemilecCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
threemilecCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(threemilecCEMarker);



//Twin Bridges
myTitle = "Twin Bridges";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('twinbridge_tab_photo'))];
coordinates = new GLatLng(43.976178, -114.141393);
twinbridgeCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
twinbridgeCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(twinbridgeCEMarker);

    //map.checkResize();
	}
};

function reloadPage()
{
window.location.reload();
};
