var sidebar_html = "<ul>";
var gmarkers = [];
var htmls = [];
var to_htmls = [];
var from_htmls = [];

function myclick(i) {
    gmarkers[i].openInfoWindowHtml(htmls[i]);
}

// Check to see if this browser can run the Google API
function createmap(){
    if (GBrowserIsCompatible()) {


        var i=0;

        // A function to create the marker and set up the event window
        function createMarker(point,name,html) {
            var marker = new GMarker(point);

            // The info window version with the "to here" form open
            to_htmls[i] = html + '<br>Directions: <b>To here</b> - <a href="javascript:fromhere(' + i + ')">From here</a>' +
                '<br>Start address:<form action="http://maps.google.com/maps" method="get" target="_blank">' +
                '<input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="" /><br>' +
                '<INPUT value="Get Directions" TYPE="SUBMIT">' +
                '<input type="hidden" name="daddr" value="' +
                point.y + ',' + point.x + "(" + name + ")" + '"/>';
            // The info window version with the "from here" form open
            from_htmls[i] = html + '<br>Directions: <a href="javascript:tohere(' + i + ')">To here</a> - <b>From here</b>' +
                '<br>End address:<form action="http://maps.google.com/maps" method="get"" target="_blank">' +
                '<input type="text" SIZE=40 MAXLENGTH=40 name="daddr" id="daddr" value="" /><br>' +
                '<INPUT value="Get Directions" TYPE="SUBMIT">' +
                '<input type="hidden" name="saddr" value="' +
                point.y + ',' + point.x + "(" + name + ")" + '"/>';
            // The inactive version of the direction info
            /*html = html + '<br>Directions: <a href="javascript:tohere('+i+')">To here</a> - <a href="javascript:fromhere('+i+')">From here</a>';*/

            GEvent.addListener(marker, "click", function() {
                    marker.openInfoWindowHtml('<div style="white-space:nowrap;">'+html+'</div>');
                    });
            gmarkers[i] = marker;
            htmls[i] = html;
            // add a line to the sidebar html
            sidebar_html += '<li><a href="javascript:myclick(' + i + ')">' + name + '</a></li>';
            i++;
            return marker;
        }
        // This function picks up the click and opens the corresponding info window

        // functions that open the directions forms
        function tohere(i) {
            gmarkers[i].openInfoWindowHtml('<div style="white-space:nowrap;">'+ to_htmls[i]+'</div>');
        }
        function fromhere(i) {
            gmarkers[i].openInfoWindowHtml('<div style="white-space:nowrap;">'+ from_htmls[i]+'</div>');
        }

        // Display the map, with some controls and set the initial location 
        var map = new GMap(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.addControl(new GOverviewMapControl());
        map.centerAndZoom(new GPoint(-122.9459, 49.2021), 7);

        // Set up markers with info windows 
        //this is where you plot points

        var point = new GPoint(-123.13659, 49.294498);
        var marker = createMarker(point,'Georgia St at Chilco - Vancouver - looking south.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=19">Georgia St at Chilco - Vancouver</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=19"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=19" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Georgia St at Chilco, looking south.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.1362, 49.2961);
        var marker = createMarker(point,'Stanley Park Causeway - Vancouver - at Stanley Park Entrance, looking south.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=17">Stanley Park Causeway - Vancouver</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=17"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=17" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Stanley Park Causeway at Stanley Park Entrance, looking south.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.1372, 49.3171);
        var marker = createMarker(point,'Lions Gate Bridge - Vancouver - North end, looking south.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=18">Lions Gate Bridge - Vancouver</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=18"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=18" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>North end of Lions Gate Bridge, looking south.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.1361, 49.3180);
        var marker = createMarker(point,'Lions Gate Bridge - Vancouver - North end, looking north.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=20">Lions Gate Bridge - Vancouver</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=20"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=20" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>North end of Lions Gate Bridge, looking north.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.1312, 49.3237);
        var marker = createMarker(point,'Taylor Way/Marine Drive intersection - North Vancouver - looking east toward Lions Gate Bridge.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=22">Taylor Way/Marine Drive intersection - North Vancouver</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=22"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=22" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Taylor Way/Marine Drive intersection, looking east toward Lions Gate Bridge.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.1349, 49.3275);
        var marker = createMarker(point,'Taylor Way at Marine Drive - North Vancouver - looking north on Taylor Way.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=21">Taylor Way at Marine Drive - North Vancouver</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=21"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=21" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Taylor Way at Marine Drive, looking north on Taylor Way.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-122.8110, 49.2166);
        var marker = createMarker(point,'Highway 1 - Port Mann Bridge - East end looking west','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=75">Highway 1 - Port Mann Bridge</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=75"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=75" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>East end of Port Mann Bridge, looking west.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-122.8101, 49.2141);
        var marker = createMarker(point,'Highway 1 - Port Mann Bridge - East end looking east towards 152nd St.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=74">Highway 1 - Port Mann Bridge</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=74"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=74" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>East end of Port Mann Bridge, looking east towards 152nd St. </p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.0307, 49.2747);
        var marker = createMarker(point,'Highway 1 - Cassiar Tunnel - South Portal looking south','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=36">Highway 1 - Cassiar Tunnel</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=36"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=36" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Cassiar Tunnel - South Portal looking south.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.0263, 49.2929);
        var marker = createMarker(point,'Highway 1 - Ironworker\'s Memorial Bridge - South end, looking south. ','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=71">Highway 1 - Ironworker\'s Memorial Bridge</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=71"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=71" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Ironworker\'s Memorial Bridge, south end, looking south. </p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.0264, 49.2954);
        var marker = createMarker(point,'Highway 1 - Ironworker\'s Memorial Bridge - Mid-span, looking south. ','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=72">Highway 1 - Ironworker\'s Memorial Bridge</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=72"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=72" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Ironworker\'s Memorial Bridge, mid-span, looking south. </p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.0265, 49.3005);
        var marker = createMarker(point,'Highway 1 - Ironworker\'s Memorial Bridge - North end, looking south. ','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=72">Highway 1 - Ironworker\'s Memorial Bridge</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=72"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=72" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Ironworker\'s Memorial Bridge, north end, looking south. </p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-122.1783, 49.0578);
        var marker = createMarker(point,'Highway 1 - Bradner Road - Looking east. ','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=54">Highway 1 - Bradner Road</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=54"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=54" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Bradner Road, west of Abbotsford, looking east. (elevation: 120 metres)</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-122.8012, 49.1058);
        var marker = createMarker(point,'Hwy 10 at 152nd Street - Surrey - looking north on 152nd.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=79">Hwy 10 at 152nd Street - Surrey</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=79"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=79" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 10 at 152nd Street, looking north on 152nd.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-122.7990, 49.1047);
        var marker = createMarker(point,'Hwy 10 at 152nd Street - Surrey - looking east on Hwy 10.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=80">Hwy 10 at 152nd Street - Surrey</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=80"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=80" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 10 at 152nd Street, looking east on Hwy 10.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-122.8012, 49.1024);
        var marker = createMarker(point,'Hwy 10 at 152nd Street - Surrey - looking south on 152nd.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=81">Hwy 10 at 152nd Street - Surrey</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=81"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=81" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 10 at 152nd Street, south on 152nd.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-122.7976, 49.1044);
        var marker = createMarker(point,'Hwy 10 at 152nd Street - Surrey - looking west on Hwy 10.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=82">Hwy 10 at 152nd Street - Surrey</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=82"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=82" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 10 at 152nd Street, looking west on Hwy 10.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);


        var point = new GPoint(-122.9430, 49.1600);
        var marker = createMarker(point,'Alex Fraser Bridge  - Richmond - mid-span, looking north.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=91">Alex Fraser Bridge  - Richmond</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=91"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=91" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Alex Fraser Bridge, mid-span, looking north.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);marker  

            var point = new GPoint(-122.9426, 49.1592);
        var marker = createMarker(point,'Alex Fraser Bridge  - Richmond - mid-span, looking south.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=92">Alex Fraser Bridge  - Richmond</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=92"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=92" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Alex Fraser Bridge, mid-span, looking south.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);marker

            var point = new GPoint(-122.9483, 49.1980);
        var marker = createMarker(point,'Queensborough Bridge  - New Westminster - north end, facing east.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=87">Queensborough Bridge  - New Westminster</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=87"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=87" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>North end of Queensborough Bridge, facing east.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);marker

            var point = new GPoint(-122.9486, 49.1977);
        var marker = createMarker(point,'Queensborough Bridge  - New Westminster - north end, facing south.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=88">Queensborough Bridge  - New Westminster</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=88"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=88" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>North end of Queensborough Bridge, facing south.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-122.9569, 49.1834);
        var marker = createMarker(point,'Hwy 91A at Boundary Road  - New Westminster - facing east.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=89">Hwy 91A at Boundary Road  - New Westminster</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=89"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=89" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 91A at Boundary Road, facing east.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-122.9577, 49.1832);
        var marker = createMarker(point,'Hwy 91A at Boundary Road  - New Westminster - facing west.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=90">Hwy 91A at Boundary Road  - New Westminster</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=90"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=90" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 91A at Boundary Road, facing west.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.1303, 49.2063);
        var marker = createMarker(point,'Oak at 70th Ave. - Vancouver - approach to Oak Street Bridge, looking north on Oak Street.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=67">Oak at 70th Ave. - Vancouver</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=67"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=67" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Oak at 70th Ave., North Approach to Oak Street Bridge, looking north on Oak Street.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.1301, 49.2054);
        var marker = createMarker(point,'Oak at 70th Ave. - Vancouver - approach to Oak Street Bridge, looking south to the bridge','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=67">Oak at 70th Ave. - Vancouver</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=67"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=67" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Oak at 70th Ave., North Approach to Oak Street Bridge, looking south to the bridge.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.1210, 49.1952);
        var marker = createMarker(point,'Hwy 99 - Richmond - south approach to Oak St Bridge, looking north.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=66">Hwy 99 - Richmond</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=66"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=66" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>South approach to Oak St Bridge, looking north. Hwy 99 Northbound at Shell Rd.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.0537, 49.1074);
        var marker = createMarker(point,'Hwy 99 - Ladner - south of Hwy 17 overpass, looking north.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=31">Hwy 99 - Ladner</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=31"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=31" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 99, south of Hwy 17 overpass, looking north.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.0573, 49.1065);
        var marker = createMarker(point,'Hwy 99 - Ladner - from Hwy 17 overpass, looking north.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=33">Hwy 99 - Ladner</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=33"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=33" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 99, from Hwy 17 overpass, looking north.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.0622, 49.1112);
        var marker = createMarker(point,'Hwy 99 - Ladner - from north of Hwy 17 overpass, looking north.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=30">Hwy 99 - Ladner</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=30"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=30" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 99, from north of Hwy 17 overpass, looking north.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.0871, 49.1323);
        var marker = createMarker(point,'Hwy 99 - Steveston - from Steveston interchange, looking north.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=29">Hwy 99 - Steveston</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=29"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=29" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 99, looking north from Steveston interchange.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.0537, 49.1067);
        var marker = createMarker(point,'Hwy 99 - Ladner - Delta Works Yard, looking north.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=34">Hwy 99 - Ladner</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=34"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=34" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Hwy 99 at Delta Works Yard, looking north.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        var point = new GPoint(-123.0869, 49.1566);
        var marker = createMarker(point,'Hwy 99 - Steveston - between Blundell overpass and Steveston offramp, looking south.','<h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=32">Hwy 99 - Steveston</a></h3><a href="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=32"><img src="http://www.th.gov.bc.ca/bchighwaycam/getFile2.aspx?cam=32" width="421" height="315" border="0" style="margin: 0px 0" /></a><p>Looking south between Blundell overpass and Steveston offramp.</p><p style="text-align: right; color: #fd7400; font-weight: bold;"><a href="http://www.th.gov.bc.ca/bchighwaycam/index.aspx">Provided by the BC Ministry of Transportation</a></p>')
            map.addOverlay(marker);

        // put the assembled sidebar_html contents into the sidebar div

        sidebar_html += '</ul>';
        document.getElementById("sidebar").innerHTML = sidebar_html;

    }

    // display a warning if the browser was not compatible
    else {
        alert("Sorry, the Google Maps API is not compatible with this browser");
    }
}

$(function(){
    createmap();
});
