$(function () {
    window.markerStore = (function (settings) {
        var defaultSettings  = { MEDIA_URL: '/static/img/markers/' };
        
        settings = $.extend({}, defaultSettings, settings);
        
        var store = {};
        
        var paths = [ 'community/eat',
                      'community/see', 
                      'community/shop', 
                      'community/stay', 
                      
                      'nextstop/eat',
                      'nextstop/see', 
                      'nextstop/shop', 
                      'nextstop/stay', 
                      
                      'editorial/eat',
                      'editorial/see',
                      'editorial/shop',
                      'editorial/stay'];
        for(var ix in paths) {
            var path = paths[ix];
            var currentPath = settings.MEDIA_URL + path;
            
            var newIcon = new GIcon();
            newIcon.image = currentPath + '/image.png';
            newIcon.shadow = currentPath + '/shadow.png';
            newIcon.printImage = currentPath + '/printImage.gif';
            newIcon.mozPrintImage = currentPath + '/mozPrintImage.gif';
            newIcon.printShadow = currentPath + '/printShadow.gif';
            newIcon.transparent = currentPath + '/transparent.png';
            
            newIcon.iconSize = new GSize(32,37);
            newIcon.shadowSize = new GSize(51,37);
            newIcon.iconAnchor = new GPoint(16,37);
            newIcon.infoWindowAnchor = new GPoint(16,0);
            newIcon.imageMap = [ 26,0,28,1,29,2,30,3,31,4,31,5,31,6,31,7,31,8,31,9,31,10,31,11,31,12,31,13,31,14,31,15,31,16,31,17,31,18,31,19,31,20,31,21,31,22,31,23,31,24,31,25,31,26,31,27,31,28,31,29,31,30,31,31,30,32,29,33,16,34,14,35,13,36,13,36,12,35,12,34,2,33,1,32,0,31,0,30,0,29,0,28,0,27,0,26,0,25,0,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,0,6,0,5,0,4,0,3,0,2,1,1,3,0 ];

            store[path] = newIcon;
        }
        return store;
    }) ();
});

