/**
 * @author richard
 */
function loadMatchMap(){

    var baseIcon = new GIcon();
    baseIcon.shadow = "gfx/camera_shadow.png";
    baseIcon.iconSize = new GSize(25, 20);
    baseIcon.shadowSize = new GSize(39, 20);
    baseIcon.iconAnchor = new GPoint(6, 20);
    baseIcon.infoWindowAnchor = new GPoint(5, 1);
    
    function Marker(lat, lon, html){
        var point = new GLatLng(lat, lon);
        var icon = new GIcon(baseIcon);
        icon.image = "gfx/camera.png";
        icon.iconAnchor = new GPoint(12, 10);
        var marker = new GMarker(point, icon);
        GEvent.addListener(marker, "click", function(){
            marker.openInfoWindowHtml(html);
        });
        return marker;
    }
    
    function SF(lat, lon, sf, text){
        var point = new GLatLng(lat, lon);
        var icon = new GIcon(baseIcon);
        icon.image = sf + ".png";
        icon.iconSize = new GSize(33, 39);
        icon.iconAnchor = new GPoint(16, 39);
        var marker = new GMarker(point, icon);
        GEvent.addListener(marker, "click", function(){
            marker.openInfoWindowHtml(text);
        });
        return marker;
    }
    
    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.addControl(new GScaleControl());
        map.enableScrollWheelZoom();
        map.setCenter(new GLatLng(51.56382122502309, 5.032676674822824), 15);
        
        var polyline = new GPolyline([new GLatLng(51.56591072245236, 5.041599023082171), new GLatLng(51.56621883079102, 5.040192883436191), new GLatLng(51.56589161670835, 5.039329400282612), new GLatLng(51.56685021242321, 5.034501500196924), new GLatLng(51.56609082821565, 5.035195187847124), new GLatLng(51.56491975127136, 5.036120043315009), new GLatLng(51.565757732088, 5.038705801179248), new GLatLng(51.56544968911144, 5.040125432395541), new GLatLng(51.56517348076068, 5.03996252383871), new GLatLng(51.56530222202954, 5.039365271871262), new GLatLng(51.5650425944844, 5.039244059602453), new GLatLng(51.56476708677331, 5.040480455385975), new GLatLng(51.5656632323085, 5.041057511308594)], "#FF0000", 5, 0.5);
        map.addOverlay(polyline);
        
        var polyline = new GPolyline([new GLatLng(51.56585537544014, 5.041568438836208), new GLatLng(51.5661567495841, 5.040178185880535), new GLatLng(51.56581621823526, 5.039303278806713), new GLatLng(51.56455976125417, 5.038612947384422), new GLatLng(51.56416940166088, 5.040318912478227), new GLatLng(51.56547801150349, 5.041181903891413), new GLatLng(51.56590272476881, 5.041037565011166)], "#00FF00", 5, 0.5);
        map.addOverlay(polyline);
        
        var polyline = new GPolyline([new GLatLng(51.56596553256937, 5.04165551630463), new GLatLng(51.56629532519353, 5.040174363096639), new GLatLng(51.56594402916429, 5.039309872200136), new GLatLng(51.56701088127721, 5.033996603652454), new GLatLng(51.56664030986512, 5.033796163764592), new GLatLng(51.56670932696215, 5.03454282746155), new GLatLng(51.56608407265078, 5.035141938739145), new GLatLng(51.56481207163491, 5.034744317574621), new GLatLng(51.56460940840653, 5.034339300354446), new GLatLng(51.56410970297739, 5.034668315752455), new GLatLng(51.56419423403853, 5.035383384221802), new GLatLng(51.5643351358308, 5.03533505419793), new GLatLng(51.56430645262714, 5.034995428508267), new GLatLng(51.56440315032403, 5.034881694462798), new GLatLng(51.56571515363249, 5.038689470800648), new GLatLng(51.56542342465849, 5.040063653251252), new GLatLng(51.56520409926478, 5.039929485814541), new GLatLng(51.56533281955021, 5.039345009815564), new GLatLng(51.56502699844993, 5.039177322229605), new GLatLng(51.56472225354237, 5.040554364509888), new GLatLng(51.56553486457806, 5.041006674886077), new GLatLng(51.5659754127825, 5.040936526454402)], "#FFFF00", 5, 0.5);
        map.addOverlay(polyline);
        
        var polyline = new GPolyline([new GLatLng(51.56579714066296, 5.041484935930583), new GLatLng(51.56606363701502, 5.04018715833773), new GLatLng(51.56577446530132, 5.03941252920923), new GLatLng(51.56566060064378, 5.039338744075451), new GLatLng(51.565484919023, 5.040102655925153), new GLatLng(51.56545422122968, 5.040214328296074), new GLatLng(51.56511209842429, 5.040003495382052), new GLatLng(51.56525097690015, 5.039386775085333), new GLatLng(51.56508453202208, 5.039300511516885), new GLatLng(51.56482869403931, 5.040436318898401), new GLatLng(51.56559847316907, 5.040896078150098), new GLatLng(51.56582771057199, 5.040857882421406)], "#FF9900", 5, 0.5);
        map.addOverlay(polyline);
        
        map.addOverlay(Marker(51.566000172035, 5.0411830266644, '<img src="http://www.warandeloop.nl/gfx/parcours/S1.jpg" alt="">'));
        map.addOverlay(Marker(51.565972689331, 5.0395788911605, '<img src="http://www.warandeloop.nl/gfx/parcours/G1.jpg" alt="">'));
        map.addOverlay(Marker(51.56624955462, 5.0374956289849, '<img src="http://www.warandeloop.nl/gfx/parcours/G3.jpg" alt="">'));
        map.addOverlay(Marker(51.566746078975, 5.033662412069, '<img src="http://www.warandeloop.nl/gfx/parcours/W1.jpg" alt="">'));
        map.addOverlay(Marker(51.565721345471, 5.0349753292142, '<img src="http://www.warandeloop.nl/gfx/parcours/G9.jpg" alt="">'));
        map.addOverlay(Marker(51.564641288063, 5.0345013731976, '<img src="http://www.warandeloop.nl/gfx/parcours/M1.jpg" alt="">'));
        map.addOverlay(Marker(51.564011636361, 5.034660226038, '<img src="http://www.warandeloop.nl/gfx/parcours/G5.jpg" alt="">'));
        map.addOverlay(Marker(51.564145607226, 5.0353980974026, '<img src="http://www.warandeloop.nl/gfx/parcours/G6.jpg" alt="">'));
        map.addOverlay(Marker(51.564390081972, 5.0350924819162, '<img src="http://www.warandeloop.nl/gfx/parcours/G10.jpg" alt="">'));
        map.addOverlay(Marker(51.565295691685, 5.035787541051, '<img src="http://www.warandeloop.nl/gfx/parcours/R1.jpg" alt="">'));
        map.addOverlay(Marker(51.56516622802, 5.0369186433576, '<img src="http://www.warandeloop.nl/gfx/parcours/G4.jpg" alt="">'));
        map.addOverlay(Marker(51.564979449468, 5.0389807405939, '<img src="http://www.warandeloop.nl/gfx/parcours/G8.jpg" alt="">'));
        map.addOverlay(Marker(51.565612795992, 5.0395082358333, '<img src="http://www.warandeloop.nl/gfx/parcours/O3.jpg" alt="">'));
        map.addOverlay(Marker(51.565132348415, 5.0400124938408, '<img src="http://www.warandeloop.nl/gfx/parcours/O4.jpg" alt="">'));
        map.addOverlay(Marker(51.565289007939, 5.0394947935987, '<img src="http://www.warandeloop.nl/gfx/parcours/O6.jpg" alt="">'));
        map.addOverlay(Marker(51.56492246853, 5.039341219183, '<img src="http://www.warandeloop.nl/gfx/parcours/O2.jpg" alt="">'));
        map.addOverlay(Marker(51.564707451209, 5.0405647287536, '<img src="http://www.warandeloop.nl/gfx/parcours/F1.jpg" alt="">'));
        map.addOverlay(Marker(51.565119618256, 5.040815865185, '<img src="http://www.warandeloop.nl/gfx/parcours/F2.jpg" alt="">'));
        map.addOverlay(Marker(51.565370459679, 5.0409700432585, '<img src="http://www.warandeloop.nl/gfx/parcours/FT.jpg" alt="">'));
        map.setMapType(G_SATELLITE_TYPE);
    }
}


function loadRecrMap(){

    var baseIcon = new GIcon();
    baseIcon.shadow = "img/camera_shadow.png";
    baseIcon.iconSize = new GSize(25, 20);
    baseIcon.shadowSize = new GSize(39, 20);
    baseIcon.iconAnchor = new GPoint(6, 20);
    baseIcon.infoWindowAnchor = new GPoint(5, 1);
    
    function Marker(lat, lon, html){
        var point = new GLatLng(lat, lon);
        var icon = new GIcon(baseIcon);
        icon.image = "img/camera.png";
        icon.iconAnchor = new GPoint(12, 10);
        var marker = new GMarker(point, icon);
        GEvent.addListener(marker, "click", function(){
            marker.openInfoWindowHtml(html);
        });
        return marker;
    }
    
    function SF(lat, lon, sf, text){
        var point = new GLatLng(lat, lon);
        var icon = new GIcon(baseIcon);
        icon.image = sf + ".png";
        icon.iconSize = new GSize(33, 39);
        icon.iconAnchor = new GPoint(16, 39);
        var marker = new GMarker(point, icon);
        GEvent.addListener(marker, "click", function(){
            marker.openInfoWindowHtml(text);
        });
        return marker;
    }
    
    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.addControl(new GScaleControl());
        map.enableScrollWheelZoom();
        map.setCenter(new GLatLng(51.56382122502309, 5.032676674822824), 15);
        var polyline = new GPolyline([new GLatLng(51.56568791580954, 5.041839870106514), new GLatLng(51.56603487526498, 5.039832048392668), new GLatLng(51.56584219765711, 5.039258279286543), new GLatLng(51.56769928503781, 5.029627042532766), new GLatLng(51.56178130549654, 5.026274705227507), new GLatLng(51.55983058641363, 5.035728739354852), new GLatLng(51.56252201470957, 5.037395934060342), new GLatLng(51.56083438342712, 5.031840334871063), new GLatLng(51.56105442111448, 5.030598482670243), new GLatLng(51.56439312384664, 5.027882844342429), new GLatLng(51.56486969964611, 5.028141686085661), new GLatLng(51.5658289714369, 5.031209138406481), new GLatLng(51.56542469712374, 5.033784063183518), new GLatLng(51.56452758558067, 5.033391081662714), new GLatLng(51.56417332239222, 5.033914092393815), new GLatLng(51.56566246231986, 5.038269689535881), new GLatLng(51.56548905125141, 5.039234825729125), new GLatLng(51.56459260496543, 5.038769389240784), new GLatLng(51.56431123786616, 5.040313047608976), new GLatLng(51.56541632204109, 5.041031872235479), new GLatLng(51.56568852236664, 5.040922406846804)], "#9999FF", 5, 0.5);
        map.addOverlay(polyline);
        var polyline = new GPolyline([new GLatLng(51.56585537544014, 5.041568438836208), new GLatLng(51.5661567495841, 5.040178185880535), new GLatLng(51.56581621823526, 5.039303278806713), new GLatLng(51.56455976125417, 5.038612947384422), new GLatLng(51.56416940166088, 5.040318912478227), new GLatLng(51.56547801150349, 5.041181903891413), new GLatLng(51.56590272476881, 5.041037565011166)], "#0000FF", 5, 0.5);
        map.addOverlay(polyline);
        map.addOverlay(Marker(51.565972701405, 5.0414930980416, '<img src="http://www.warandeloop.nl/gfx/parcours/S3.jpg" alt="">'));
        map.addOverlay(Marker(51.566683117568, 5.0353394032811, '<img src="http://www.warandeloop.nl/gfx/parcours/B1.jpg" alt="">'));
        map.addOverlay(Marker(51.565536593974, 5.028393417383, '<img src="http://www.warandeloop.nl/gfx/parcours/B2.jpg" alt="">'));
        map.addOverlay(Marker(51.561444883081, 5.0280032855702, '<img src="http://www.warandeloop.nl/gfx/parcours/B3.jpg" alt="">'));
        map.addOverlay(Marker(51.561617467075, 5.0348974811242, '<img src="http://www.warandeloop.nl/gfx/parcours/B5.jpg" alt="">'));
        map.addOverlay(Marker(51.564450032208, 5.034777374429, '<img src="http://www.warandeloop.nl/gfx/parcours/B8.jpg" alt="">'));
        map.addOverlay(Marker(51.564187395146, 5.040019021042, '<img src="http://www.warandeloop.nl/gfx/parcours/B7.jpg" alt="">'));
        map.addOverlay(Marker(51.565370459679, 5.0409700432585, '<img src="http://www.warandeloop.nl/gfx/parcours/FT.jpg" alt="">'));
        map.setMapType(G_SATELLITE_TYPE);
    }
}
