// GoogleMap JavaScript Code

// City of Deadwood Century Awards Map

//<![CDATA[

//  Start MAP creation

    var timeoutID = 0;

    var map;

    var zoom = 3;                           // 1 WORLD - 15 STREET

    var center_lat = 39.774769;

    var center_lon = -97.294922;

    var iWidthOV = 150;                      // Changes the Width and Height of the OverView map in the LR corner,

    var iHeightOV = 120;                     // (cont'd) should be smaller and proportional

    var iRightLogo = iWidthOV + 20;          // This changes the absolute right position of the Ridgerider Logo, based on iWidth

    var iRightGSC = iRightLogo + iWidthOV;   //   " " of the ScaleControl, based on iRightLogo, and the width of the logo (150)

    var ICO                                  // Just a holder for a variable when no color is entered for a Header



    // --------------------------------------------------------------



    map = new GMap2(document.getElementById("map"));

    map.enableDoubleClickZoom()
	
	map.enableScrollWheelZoom();

    map.addControl(new GLargeMapControl());

    map.addControl(new GMapTypeControl());

    map.setCenter(new GLatLng(center_lat, center_lon), zoom, G_HYBRID_MAP);

    map.addControl(new GOverviewMapControl(new GSize(iWidthOV,iHeightOV)));

    map.addControl(new GScaleControl(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(iRightGSC, 20)));



    ICOred  =  new GIcon();

    ICOred.image  =  "http://labs.google.com/ridefinder/images/mm_20_red.png";

    ICOred.shadow  =  "http://labs.google.com/ridefinder/images/mm_20_shadow.png";

    ICOred.iconSize  =  new GSize(12, 20);

    ICOred.shadowSize  =  new GSize(22, 20);

    ICOred.iconAnchor  =  new GPoint(6, 20);

    ICOred.infoWindowAnchor  =  new GPoint(5, 1);





    ICOwhite  =  new GIcon();

    ICOwhite.image  =  "http://labs.google.com/ridefinder/images/mm_20_white.png";

    ICOwhite.shadow  =  "http://labs.google.com/ridefinder/images/mm_20_shadow.png";

    ICOwhite.iconSize  =  new GSize(12, 20);

    ICOwhite.shadowSize  =  new GSize(22, 20);

    ICOwhite.iconAnchor  =  new GPoint(6, 20);

    ICOwhite.infoWindowAnchor  =  new GPoint(5, 1);



//Start of Marker Delimination



// this variable will collect the html which will eventually be placed in the side_bar

    var vzMapList = "";

// arrays to hold copies of the markers and html used by the side_bar

// because the function closure trick doesnt work there

    var gzMarkers = [];

    var i = 0;

// A function to create the marker and set up the event window

    function createMarker(szPtTitle, iType, bTab, sgLat, sgLong, szPtOL, szPtInfoHTML, szColor, szIcon) {

        var gzMarker = new GMarker(new GLatLng(sgLat, sgLong), szIcon);

        GEvent.addListener(gzMarker, "click", function() {

// If no image is available, then create balloon without TAB structure

    if (bTab)

        {gzMarker.openInfoWindowTabsHtml(szPtInfoHTML);}

    else

        {gzMarker.openInfoWindowHtml(szPtInfoHTML);}

    });

// save the info we need to use later for the side_bar

    gzMarkers[i] = gzMarker;

//  0: nothing, 1: header, 2: link, 3: ICO

    if (iType == 1)             // 1: a Header for RideList

    {

        vzMapList += '<p class="rl_hdr">&nbsp;' + szPtTitle + '</p>';

        i++;

    }

    else if (iType == 2)        // 2: an actual list item

    {

        var szMouseOver = "onMouseOver=\"return overlib('" + szPtOL + "');\" onMouseOut=\"return nd();\" "

        vzMapList += "<a class='rl' href='javascript:fxMyClick(" + i + ");' " + szMouseOver + "/>&nbsp;&nbsp;&nbsp;&nbsp;&bull;&nbsp;&nbsp;" + szPtTitle + "</a>";

        i++;

    }

    else if (iType == 3)        //  Create the Legend Info

    {

        var szMouseOver = "onMouseOver=\"return overlib('" + szPtOL + "');\" onMouseOut=\"return nd();\" "

        var szImg = '&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://labs.google.com/ridefinder/images/mm_20_' + szColor + '.png"' + szMouseOver + 'border="0">&nbsp;&ndash;&nbsp;'

        szImg = '<a class="rl" href="javascript:fxMyClick(' + i + ')"' + szMouseOver + '>' + szImg + szPtTitle + '</a>'

        vzMapList += szImg

        i++;

    }

    else                        // else 0

    {

// do nothing

    }

    return gzMarker;

    }

// This function picks up the click and opens the corresponding info window

    function fxMyClick(i) {

        GEvent.trigger(gzMarkers[i], "click");

    }

//  ---------------------- Add Locations ---------------------- //



    // Marker Number: 1

    var gzMarker = createMarker('James Dean Locales', 1, '', '', '', '', '', '', '');

    map.addOverlay(gzMarker);



    // Marker Number: 2

    var szMarkerTitle = "Birthplace";

    var szMarkerInfo = "Marion Indiana";

    var szMarkerHTML = "<p class='gm_hdr'>Marion Indiana</p><br /><div><p class='gm_txt_just'>Feb. 8, 1931 in Marion, IN to Winton Dean and Mildred Wilson Dean at the <i>Seven Gables</i> apartment house, at the intersection of 4th and McClure Streets</p></div>";

    var vzTextTab = new GInfoWindowTab(szMarkerTitle,szMarkerHTML);

    var szImageInfo = '';

    var vzImgTab = new GInfoWindowTab("Photo", szImageInfo);

    var vzTabInfo = "<p class='gm_hdr'>Marion Indiana</p><br /><div><p class='gm_txt_just'>Feb. 8, 1931 in Marion, IN to Winton Dean and Mildred Wilson Dean at the <i>Seven Gables</i> apartment house, at the intersection of 4th and McClure Streets</p></div>";

    var gzMarker = createMarker(szMarkerTitle, 2, false, 40.557863, -85.656152, 'Marion Indiana', vzTabInfo, 'white', ICOwhite);

    map.addOverlay(gzMarker);



    // Marker Number: 3

    var szMarkerTitle = "Actors Studio";

    var szMarkerInfo = "Acting Studies";

    var szMarkerHTML = "<p class='gm_hdr'>Acting Studies</p>";

    var vzTextTab = new GInfoWindowTab(szMarkerTitle,szMarkerHTML);

    var szImageInfo = '';

    var vzImgTab = new GInfoWindowTab("Photo", szImageInfo);

    var vzTabInfo = "<p class='gm_hdr'>Acting Studies</p>";

    var gzMarker = createMarker(szMarkerTitle, 2, false, 40.739254, -73.993199, 'Acting Studies', vzTabInfo, 'red', ICOred);

    map.addOverlay(gzMarker);



    // Marker Number: 4

    var szMarkerTitle = "Apartment";

    var szMarkerInfo = "James Dean New York Apartment";

    var szMarkerHTML = "<p class='gm_hdr'>James Dean New York Apartment</p><br /><div><p class='gm_txt_just'>The apartment in New York Upper West Side.</p></div><p class=\"gm_txt_just\">&nbsp;<br /><a class=\"gm\" href=\"javascript:PopupPic(\'images/ny_apt.jpg\')\">Click Here For More Information</a></p>";

    var vzTextTab = new GInfoWindowTab(szMarkerTitle,szMarkerHTML);

    var szImageInfo = '<p class="gm_hdr">James Dean New York Apartment</p><a href="javascript:PopupPic(\'images/ny_apt.jpg\')"><img src="/gmaps/images/thumb/ny_apt.jpg" alt="James Dean New York Apartment - Click Here For More Information"></a>';

    var vzImgTab = new GInfoWindowTab("Photo", szImageInfo);

    var vzTabInfo = [vzTextTab,vzImgTab];

    var gzMarker = createMarker(szMarkerTitle, 2, true, 40.775317, -73.977192, 'James Dean New York Apartment', vzTabInfo, 'red', ICOred);

    map.addOverlay(gzMarker);



    // Marker Number: 5

    var szMarkerTitle = "Memorial Park";

    var szMarkerInfo = "James Dean Memorial Park";

    var szMarkerHTML = "<p class='gm_hdr'>James Dean Memorial Park</p><br /><div><p class='gm_txt_just'>A memorial Park in Fairmont, Indiana</p></div><p class=\"gm_txt_just\">&nbsp;<br /><a class=\"gm\" href=\"javascript:PopupPic(\'/gmaps/images/memorial.jpg\')\">Click Here For More Information</a></p>";

    var vzTextTab = new GInfoWindowTab(szMarkerTitle,szMarkerHTML);

    var szImageInfo = '<p class="gm_hdr">James Dean Memorial Park</p><a href="javascript:PopupPic(\'/gmaps/images/memorial.jpg\')"><img src="/gmaps/images/thumb/memorial.jpg" alt="James Dean Memorial Park - Click Here For More Information"></a>';

    var vzImgTab = new GInfoWindowTab("Photo", szImageInfo);

    var vzTabInfo = [vzTextTab,vzImgTab];

    var gzMarker = createMarker(szMarkerTitle, 2, true, 40.4172416666667, -85.6501722222222, 'James Dean Memorial Park', vzTabInfo, 'white', ICOwhite);

    map.addOverlay(gzMarker);



    // Marker Number: 6

    var szMarkerTitle = "Fairmount High School";

    var szMarkerInfo = "Fairmont School";

    var szMarkerHTML = "<p class='gm_hdr'>Fairmont School</p><br /><div><p class='gm_txt_just'>James Dean atteneded school at this location.</p></div><p class=\"gm_txt_just\">&nbsp;<br /><a class=\"gm\" href=\"javascript:PopupPic(\'/gmaps/images/school.jpg\')\">Click Here For More Information</a></p>";

    var vzTextTab = new GInfoWindowTab(szMarkerTitle,szMarkerHTML);

    var szImageInfo = '<p class="gm_hdr">Fairmont School</p><a href="javascript:PopupPic(\'/gmaps/images/school.jpg\')"><img src="/gmaps/images/thumb/school.jpg" alt="Fairmont School - Click Here For More Information"></a>';

    var vzImgTab = new GInfoWindowTab("Photo", szImageInfo);

    var vzTabInfo = [vzTextTab,vzImgTab];

    var gzMarker = createMarker(szMarkerTitle, 2, true, 40.4143166666667, -85.6468388888889, 'Fairmont School', vzTabInfo, 'red', ICOred);

    map.addOverlay(gzMarker);



    // Marker Number: 7

    var szMarkerTitle = "Indian";

    var szMarkerInfo = "Indian Motorcycle Shop";

    var szMarkerHTML = "<p class='gm_hdr'>Indian Motorcycle Shop</p><br /><div><p class='gm_txt_just'>The shop where James Dean bought his first motorcycle.</p></div><p class=\"gm_txt_just\">&nbsp;<br /><a class=\"gm\" href=\"javascript:PopupPic(\'/gmaps/images/cycle_shop.jpg\')\">Click Here For More Information</a></p>";

    var vzTextTab = new GInfoWindowTab(szMarkerTitle,szMarkerHTML);

    var szImageInfo = '<p class="gm_hdr">Indian Motorcycle Shop</p><a href="javascript:PopupPic(\'/gmaps/images/cycle_shop.jpg\')"><img src="/gmaps/images/thumb/cycle_shop.jpg" alt="Indian Motorcycle Shop - Click Here For More Information"></a>';

    var vzImgTab = new GInfoWindowTab("Photo", szImageInfo);

    var vzTabInfo = [vzTextTab,vzImgTab];

    var gzMarker = createMarker(szMarkerTitle, 2, true, 40.4433055555556, -85.6449944444444, 'Indian Motorcycle Shop', vzTabInfo, 'red', ICOred);

    map.addOverlay(gzMarker);



    // Marker Number: 8

    var szMarkerTitle = "Deathplace";

    var szMarkerInfo = "Cholame, California";

    var szMarkerHTML = "<p class='gm_hdr'>Cholame, California</p><br /><div><p class='gm_txt_just'>Dean was driving west on State Route 46 near Cholame, California when a coupe, driven from the opposite direction by 23-year-old Cal Poly student attempted to take the fork onto State Route 41 and crossed into Deans lane without seeing him.</p></div><p class=\"gm_txt_just\">&nbsp;<br /><a class=\"gm\" href=\"javascript:PopupPic(\'http://en.wikipedia.org/wiki/Donald_Turnupseed#Death\')\">Click Here For More Information</a></p>";

    var vzTextTab = new GInfoWindowTab(szMarkerTitle,szMarkerHTML);

    var szImageInfo = '';

    var vzImgTab = new GInfoWindowTab("Photo", szImageInfo);

    var vzTabInfo = "<p class='gm_hdr'>Cholame, California</p><br /><div><p class='gm_txt_just'>Dean was driving west on State Route 46 near Cholame, California when a coupe, driven from the opposite direction by 23-year-old Cal Poly student attempted to take the fork onto State Route 41 and crossed into Deans lane without seeing him.</p></div><p class=\"gm_txt_just\">&nbsp;<br /><a class=\"gm\" href=\"javascript:PopupPic(\'http://en.wikipedia.org/wiki/Donald_Turnupseed#Death\')\">Click Here For More Information</a></p>";

    var gzMarker = createMarker(szMarkerTitle, 2, false, 35.734948, -120.284328, 'Cholame, California', vzTabInfo, 'white', ICOwhite);

    map.addOverlay(gzMarker);



    // Marker Number: 9

    var szMarkerTitle = "Interned";

    var szMarkerInfo = "Fairmont, Indiana";

    var szMarkerHTML = "<p class='gm_hdr'>Fairmont, Indiana</p><br /><div><p class='gm_txt_just'>James Dean is buried in Park Cemetery in Fairmount, Indiana.</p></div>";

    var vzTextTab = new GInfoWindowTab(szMarkerTitle,szMarkerHTML);

    var szImageInfo = '';

    var vzImgTab = new GInfoWindowTab("Photo", szImageInfo);

    var vzTabInfo = "<p class='gm_hdr'>Fairmont, Indiana</p><br /><div><p class='gm_txt_just'>James Dean is buried in Park Cemetery in Fairmount, Indiana.</p></div>";

    var gzMarker = createMarker(szMarkerTitle, 2, false, 40.416371, -85.649242, 'Fairmont, Indiana', vzTabInfo, 'white', ICOwhite);

    map.addOverlay(gzMarker);









































































//  --------------------- Add points to vzMapList ---------------------- //

// put the assembled List contents into the side_bar div

    document.getElementById("MapList").innerHTML = vzMapList;

    ctrlLogo.prototype.printable=function(){return true};

    ctrlLogo.prototype.selectable=function(){return true};

    ctrlLogo.prototype.getDefaultPosition=function(){

    return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(iRightLogo,18))

      }

  map.addControl(new ctrlLogo());

   //]]>



