    var map              = new Object();
    var lastPlace        = new Object();
    var vPins            = new Array();
    var vIds             = new Array();
    var vTextos          = new Array();
    var LeftMenu_Visible = new Boolean();
    var tooltip          = document.createElement("div");

    LeftMenu_Visible = false;

    function oPin (id) {
        this.id = id;
        this.title = '';
        this.type = '';
        this.lat = '';
        this.lon = '';
        this.alt = '';
        this.tabList = new Array();
        this.highligt = false;
        this.uLevel = 0;
        this.iconUrl = '';
    }

    function get_gIcon(type) {
        var nIcon = new GIcon(G_DEFAULT_ICON);
        var icon_url;

        if (type == 'travel') {
            nIcon.iconSize = new GSize(30,25);
            icon_url = './img/icons/bandera.png';
        }
        else if (type == 'stage') {
            nIcon.iconSize = new GSize(30,25);
            icon_url = './img/icons/bandera.png';
        }
        else if (type == 'visit') {
            nIcon.iconSize = new GSize(30,25);
            icon_url = './img/icons/alfiler.png';
        }
        else if (type == 'continent') {
            icon_url = './img/continent.png';
            nIcon.iconSize = new GSize(35,35);
            nIcon.shadowSize = new GSize(49, 35);
            nIcon.iconAnchor = new GPoint(0,35);
        }
        else if (type == 'country') {
            nIcon.iconSize = new GSize(25,25);
            nIcon.shadowSize = new GSize(39, 25);
            nIcon.iconAnchor = new GPoint(0,25);
            icon_url = './img/country.png';
        }
        else if (type == 'place') {
            nIcon.iconSize = new GSize(10,10);
            nIcon.iconAnchor = new GPoint(0,0);
            icon_url = './img/place.png';
        }
        else if (type == 'mark') {
            nIcon.iconSize = new GSize(10,26);
            nIcon.iconAnchor = new GPoint(0,0);
            icon_url = './img/mark.png';
        }
        nIcon.image = icon_url;
        nIcon.shadow =icon_url+'-sh.png';
        return(nIcon);
    }

    function higlightMark (mark, offset) {
        icoWidth  = mark.getIcon().iconSize.width;
        icoHeight = mark.getIcon().iconSize.height;
        shdWidth  = mark.getIcon().shadowSize.width;
        shdHeight = mark.getIcon().shadowSize.height;
        mark.getIcon().iconSize = new GSize(icoWidth + offset, (((icoWidth + offset) * icoHeight) / icoWidth));
        mark.getIcon().shadowSize = new GSize(shdWidth + offset, (((shdWidth + offset) * shdHeight) / shdWidth));
    }

    function showTooltip(marker) {
        tooltip.innerHTML = marker.tooltip;
        var point = map.getCurrentMapType().getProjection().fromLatLngToPixel(map.getBounds().getSouthWest(),map.getZoom());
        var offset = map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom());
        var anchor = marker.getIcon().iconAnchor;
        var width = marker.getIcon().iconSize.width;
        var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(offset.x - point.x - anchor.x + width,- offset.y + point.y +anchor.y)); 
        pos.apply (tooltip);
        tooltip.style.visibility = "visible";
    }

    function createMarker(oMark) {
        var point       = new GLatLng(oMark.lat, oMark.lon);
        var gIcon       = get_gIcon(oMark.type);
        var markOptions = new Object();

        
        if (oMark.iconUrl != '') {
            gIcon.image = oMark.iconUrl;
            gIcon.shadow =oMark.iconUrl+'-sh.png';
            gIcon.iconSize = new GSize(30,25);
        }
        
        markOptions.title = oMark.title;
        markOptions.icon  = gIcon;
        var marker = new GMarker(point, markOptions);
        marker.tooltip = oMark.tooltip;
        GEvent.addListener(marker, "click", function() { showTooltip(marker); });
        GEvent.addListener(marker, "dblclick", function() { window.location = "?pin="+oMark.id; });
        GEvent.addListener(marker, "mouseover", function() { showTooltip(marker); }); 
        GEvent.addListener(marker, "mouseout", function() { tooltip.style.visibility = "hidden"; });
        if (oMark.highligt) {
            higlightMark(marker, 5);
        }
        return marker;
    }

    function set_doubleclickZoom(new_mode) {
        if (new_mode == 'on') {
            map.enableDoubleClickZoom();
        }
        else {
            map.disableDoubleClickZoom();
        }
    }
