//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.697681, -113.639302);
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.964356, -114.481081);
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.568037, -113.899771);
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);
churchfarmPMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
churchfarmPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(churchfarmPMarker);



//Colorado Gulch
myTitle = "Colorado Gulch";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('coloradogu_tab_photo'))];
coordinates = new GLatLng(43.501052, -114.308316);
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.553864, -114.335718);
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.488749, -114.351638);
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);



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



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



//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.009244, 0.0085);
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.721000, -114.388000);
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.661373, -114.227267);
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);



//Kelly Reservoir
myTitle = "Kelly Reservoir";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('kellyreser_tab_photo'))];
coordinates = new GLatLng(43.310000, -114.636000);
kellyreserCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
kellyreserCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(kellyreserCEMarker);



//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.688329, -114.419821);
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.388704, -114.966924);
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.038668, -113.827244);
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.336474, -114.112162);
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.645531, -114.219827);
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.699851, -114.364273);
sellgrentrCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
sellgrentrCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(sellgrentrCEMarker);



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



//Simba Springs
myTitle = "Simba Springs";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('simbasprin_tab_photo'))];
coordinates = new GLatLng(44.241537, -114.510254);
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);
squarelakePMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
squarelakePMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(squarelakePMarker);



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



//Timbered Dome
myTitle = "Timbered Dome";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('timbereddo_tab_photo'))];
coordinates = new GLatLng(43.578000, -113.527000);
timbereddoPMarker = new GMarker(coordinates, {icon: greenIcon, title: myTitle});
timbereddoPMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(timbereddoPMarker);



//Twin Bridges
myTitle = "Twin Bridges";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('twinbridge_tab_photo'))];
coordinates = new GLatLng(43.971401, -114.137114);
twinbridgeCEMarker = new GMarker(coordinates, {icon: yellowIcon, title: myTitle});
twinbridgeCEMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(twinbridgeCEMarker);



//Water Below Magic Dam
myTitle = "Water Below Magic Dam";
var tabs = [new GInfoWindowTab('Photo',document.getElementById('waterbelow_tab_photo'))];
coordinates = new GLatLng(43.221139, -114.358991);
waterbelowPJMarker = new GMarker(coordinates, {icon: whiteIcon, title: myTitle});
waterbelowPJMarker.bindInfoWindowTabs(tabs, {maxWidth: 160});
map.addOverlay(waterbelowPJMarker);

    //map.checkResize();
	}
};

function reloadPage()
{
window.location.reload();
};

