
function loadMap(centerlat, centerlng, zoom, maptype) 
{
    if (GBrowserIsCompatible())
    {
        var map = new GMap2($('map_canvas'));

        if(!centerlat)
            centerlat = '-22.309425841200177';
        if(!centerlng)
            centerlng = '24.697265625';
        if(!zoom)
            zoom = 5;
        if(!maptype)
            maptype = G_NORMAL_MAP;

        var point = new GLatLng(centerlat, centerlng);
        map.setCenter(point, zoom, maptype);
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.enableContinuousZoom();
    }
}

function loadAccMap(centerlat, centerlng, zoom, maptype, accid)
{
    if (GBrowserIsCompatible())
    {
        var map = new GMap2($('map_canvas'));

        if(!centerlat)
            centerlat = '-22.309425841200177';
        if(!centerlng)
            centerlng = '24.697265625';
        if(!zoom)
            zoom = 5;
        if(!maptype)
            maptype = G_NORMAL_MAP;

        var point = new GLatLng(centerlat, centerlng);
        map.setCenter(point, zoom, maptype);
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.enableContinuousZoom();

        var marker = new GMarker(point);
        map.addOverlay(marker);
        GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowHtml(accid,{maxUrl:"details.html"});
        });
    }
}

var WINDOW_HTML_ZA = '<a href="http://www.kaia-travel.nl/country-105-Zuid_Afrika.html">Zuid-Afrika</a> Zuid-Afrika</div>';
var WINDOW_HTML_BOT = '<a href="http://www.kaia-travel.nl/country-101-Botswana.html">Botswana</a> Botswana</div>';
var WINDOW_HTML_MAL = '<a href="http://www.kaia-travel.nl/country-121-Malawi.html">Malawi</a> Malawi</div>';
var WINDOW_HTML_ZIM = '<a href="http://www.kaia-travel.nl/country-106-Zimbabwe.html">Zimbabwe</a> Zimbabwe</div>';
var WINDOW_HTML_MOZ = '<a href="http://www.kaia-travel.nl/country-104-Mozambique.html">Mozambique</a> Mozambique</div>';
var WINDOW_HTML_NAM = '<a href="http://www.kaia-travel.nl/country-108-Namibie.html">Namibie</a> Namibie</div>';
var WINDOW_HTML_ZAM = '<a href="http://www.kaia-travel.nl/country-102-Zambia.html">Zambia</a> Zambia</div>';


function loadDisMap(centerlat, centerlng, zoom, maptype, accid)
{
    if (GBrowserIsCompatible())
    {
        var map = new GMap2($('map_canvas'));

        if(!centerlat)
            centerlat = '-22.309425841200177';
        if(!centerlng)
            centerlng = '24.0';
        if(!zoom)
            zoom = 4;
        if(!maptype)
            maptype = G_NORMAL_MAP;

        var point = new GLatLng(centerlat, centerlng);
        map.setCenter(point, zoom, maptype);
        map.setUIToDefault();

   /*     map.addControl(new GLargeMapControl());*/
   /*     map.addControl(new GMapTypeControl());*/
   /*     map.enableContinuousZoom();*/

        var point_za = new GLatLng(-28.895278, 24.650140);
        var point_bot = new GLatLng(-22.006161, 24.221528);
        var point_mal = new GLatLng(-13.975596, 34.199577);
        var point_zim = new GLatLng(-19.021606, 29.125118);
        var point_moz = new GLatLng(-18.841804, 34.658135);
        var point_nam = new GLatLng(-22.8074465, 17.877009);
        var point_zam = new GLatLng(-13.429657, 28.659431);


        var iconzaflag = new GIcon();
        iconzaflag.image = 'http://www.kaia-travel.nl/images/zaflag.png';
        iconzaflag.iconSize = new GSize(32, 24);
        iconzaflag.iconAnchor = new GPoint(16, 16);
        iconzaflag.infoWindowAnchor = new GPoint(25, 7);

        optsza = {
          "icon": iconzaflag,
          "clickable": true,
          "title": "Zuid-Afrika",
        /*  "labelText": "Zuid-Afrika",*/
          "labelOffset": new GSize(-6, -10)
        };
        var marker_za = new LabeledMarker(point_za, optsza);
        /*var marker_za = new GMarker(point_za);*/
        map.addOverlay(marker_za);
        GEvent.addListener(marker_za, "click", function() {
/*            marker.openInfoWindowHtml(accid,{maxUrl:"details.html"});*/
/*            marker.openInfoWindowHtml(<a target='_blank' href='http://www.kaia-travel.nl/country-105-Zuid_Afrika.html'>ZA</a>);*/
            marker_za.openInfoWindowHtml(WINDOW_HTML_ZA);

        });

        var iconbotflag = new GIcon();
        iconbotflag.image = 'http://www.kaia-travel.nl/images/botflag.png';
        iconbotflag.iconSize = new GSize(32, 24);
        iconbotflag.iconAnchor = new GPoint(16, 16);
        iconbotflag.infoWindowAnchor = new GPoint(25, 7);

        optsbot = {
          "icon": iconbotflag,
          "clickable": true,
          "title": "Botswana",
      /*    "labelText": "Botswana",*/
          "labelOffset": new GSize(-6, -10)
        };
       /* var marker_bot = new GMarker(point_bot);*/
        var marker_bot = new LabeledMarker(point_bot, optsbot);
        map.addOverlay(marker_bot);
        GEvent.addListener(marker_bot, "click", function() {
            marker_bot.openInfoWindowHtml(WINDOW_HTML_BOT);
        });

        var iconmalflag = new GIcon();
        iconmalflag.image = 'http://www.kaia-travel.nl/images/malflag.png';
        iconmalflag.iconSize = new GSize(32, 24);
        iconmalflag.iconAnchor = new GPoint(16, 16);
        iconmalflag.infoWindowAnchor = new GPoint(25, 7);

        optsmal = {
          "icon": iconmalflag,
          "clickable": true,
          "title": "Malawi",
          "labelOffset": new GSize(-6, -10)
        };
        var marker_mal = new LabeledMarker(point_mal, optsmal);
        map.addOverlay(marker_mal);
        GEvent.addListener(marker_mal, "click", function() {
            marker_mal.openInfoWindowHtml(WINDOW_HTML_MAL);
        });

        var iconzimflag = new GIcon();
        iconzimflag.image = 'http://www.kaia-travel.nl/images/zimflag.png';
        iconzimflag.iconSize = new GSize(32, 24);
        iconzimflag.iconAnchor = new GPoint(16, 16);
        iconzimflag.infoWindowAnchor = new GPoint(25, 7);

        optszim = {
          "icon": iconzimflag,
          "clickable": true,
          "title": "Zimbabwe",
          "labelOffset": new GSize(-6, -10)
        };
        var marker_zim = new LabeledMarker(point_zim, optszim);
        map.addOverlay(marker_zim);
        GEvent.addListener(marker_zim, "click", function() {
            marker_zim.openInfoWindowHtml(WINDOW_HTML_ZIM);
        });

        var iconmozflag = new GIcon();
        iconmozflag.image = 'http://www.kaia-travel.nl/images/mozflag.png';
        iconmozflag.iconSize = new GSize(32, 24);
        iconmozflag.iconAnchor = new GPoint(16, 16);
        iconmozflag.infoWindowAnchor = new GPoint(25, 7);

        optsmoz = {
          "icon": iconmozflag,
          "clickable": true,
          "title": "Mozambique",
          "labelOffset": new GSize(-6, -10)
        };
        var marker_moz = new LabeledMarker(point_moz, optsmoz);
        map.addOverlay(marker_moz);
        GEvent.addListener(marker_moz, "click", function() {
            marker_moz.openInfoWindowHtml(WINDOW_HTML_MOZ);
        });

        var iconnamflag = new GIcon();
        iconnamflag.image = 'http://www.kaia-travel.nl/images/namflag.png';
        iconnamflag.iconSize = new GSize(32, 24);
        iconnamflag.iconAnchor = new GPoint(16, 16);
        iconnamflag.infoWindowAnchor = new GPoint(25, 7);

        optsnam = {
          "icon": iconnamflag,
          "clickable": true,
          "title": "Namibie",
          "labelOffset": new GSize(-6, -10)
        };
        var marker_nam = new LabeledMarker(point_nam, optsnam);
        map.addOverlay(marker_nam);
        GEvent.addListener(marker_nam, "click", function() {
            marker_nam.openInfoWindowHtml(WINDOW_HTML_NAM);
        });

        var iconzamflag = new GIcon();
        iconzamflag.image = 'http://www.kaia-travel.nl/images/zamflag.png';
        iconzamflag.iconSize = new GSize(32, 24);
        iconzamflag.iconAnchor = new GPoint(16, 16);
        iconzamflag.infoWindowAnchor = new GPoint(25, 7);

        optszam = {
          "icon": iconzamflag,
          "clickable": true,
          "title": "Zambia",
          "labelOffset": new GSize(-6, -10)
        };
        var marker_zam = new LabeledMarker(point_zam, optszam);
        map.addOverlay(marker_zam);
        GEvent.addListener(marker_zam, "click", function() {
            marker_zam.openInfoWindowHtml(WINDOW_HTML_ZAM);
  /*          window.open(<a href="http://www.kaia-travel.nl/country-102-Zambia.html"></a>);
window.open(url,winName,features,replace);
    <a target='_blank' href='http://www.kaia-travel.nl/country-105-Zuid_Afrika.html'>ZA</a>*/

        });
return marker_zam;


    }
}



