var RKH_MARKERS_STYLE = {
    countries: 'countries',
    continents: 'continents',
    landkarten: 'karte',
    musik: 'cd',
    sachbuecher: 'buch-blau',
    setting: 'green-dot',
    sprachfuehrer: 'buch-rot',
    reisefuehrer: 'buch-magenta'
}


function RKH_Marker (Point, TYPE, Title) {
    var TYPE = TYPE;

    this.latlng = Point;

    if(TYPE=='setting') {
        this.opts = {
            icon: _getIcon(),
            draggable: true,
            zIndexProcess: function() { return 100; }
        };
    } else {
        this.opts = {
            icon: _getIcon()
        };
    }


    GMarker.apply(this, [this.latlng, this.opts]);

    function _getIcon() {
        var icon = new GIcon();

        icon.image =
            '../images/google.markers/'+ (RKH_MARKERS_STYLE[TYPE] || 'red-dot') +'.png';

        if(TYPE!='countries' && TYPE!='continents') {
            icon.shadow = "../images/google.markers/rkh-marker.shadow.png";
            icon.iconSize = new GSize(18, 32);
            icon.shadowSize = new GSize(43, 32);
            icon.iconAnchor = new GPoint(9, 33);

            icon.infoWindowAnchor = new GPoint(25, 10);
            icon.infoShadowAnchor = new GPoint(18, 25);
        }

        if(TYPE=='continents') {
            icon.shadow = "../images/google.markers/continents_shadow.png";

            icon.iconSize = new GSize(20, 29);
            icon.shadowSize = new GSize(48, 32);
            icon.iconAnchor = new GPoint(10, 30);
        }

        if(TYPE=='countries') {
            icon.shadow = "../images/google.markers/countries_shadow.png";

            icon.iconSize = new GSize(11, 32);
            icon.shadowSize = new GSize(48, 32);
            icon.iconAnchor = new GPoint(5, 33);
        }

        return icon;
    }

    this.hover = function() {
        this.setImage('../images/google.markers/'+RKH_MARKERS_STYLE[TYPE]+'-dot.png');
    }

    this.unhover = function() {
        this.setImage('../images/google.markers/'+RKH_MARKERS_STYLE[TYPE]+'.png');
    }
}

RKH_Marker.prototype = new GMarker(new GLatLng(0, 0));

RKH_Marker.prototype.initialize = function(map) {
    GMarker.prototype.initialize.call(this, map);
}

RKH_Marker.prototype.redraw = function(force) {
        GMarker.prototype.redraw.call(this, document.getElementById(map['id']));
}

RKH_Marker.prototype.remove = function() {
  GMarker.prototype.remove.call(this);
}



/*
var RKH_MARKERS = {
    africa: {
        pos: new GLatLng(8, 20),
        minZoom: 0,
        maxZoom: 2,
        style: 'cluster3'
    },

    asia: {
        pos: new GLatLng(45, 105),
        minZoom: 0,
        maxZoom: 2,
        style: 'cluster3'
    },

    austria: {
        pos: new GLatLng(-25, 134),
        minZoom: 0,
        maxZoom: 2,
        style: 'cluster3'
    },

    europe: {
        pos: new GLatLng(53.5, 10),
        minZoom: 0,
        maxZoom: 2,
        style: 'cluster3'
    },

    north: {
        pos: new GLatLng(53, -105),
        minZoom: 0,
        maxZoom: 2,
        style: 'cluster3'
    },

    south: {
        pos: new GLatLng(-20, -65),
        minZoom: 0,
        maxZoom: 2,
        style: 'cluster3'
    }
}
*/
