/**
 * Address search result builder
 * @author tjunghans, Namics AG, www.namics.com
 * @class Markers
 * @namespace MEDELA.locationfinder.gmap
 * @requires jQuery
 */

/* JSLint Stuff */
/*globals jQuery */

var MEDELA = MEDELA || {};
MEDELA.locationfinder = MEDELA.locationfinder || {};
MEDELA.locationfinder.gmap = MEDELA.locationfinder.gmap || {};
(MEDELA.locationfinder.gmap.marker = function (locationsArray) {

    function MarkerItem(locationArray) {
        this.location = locationArray;
    }

    MarkerItem.prototype.getDataObj = function () {
        return this.locationArray;
    };



    function Markers(locationsArray) {
        this.rawData = locationsArray;

    }

    Markers.prototype = {
        'getLocationArray' : function () {
            return this.rawData;
        },

        'getLocationByIndex' : function (index) {
            return this.rawData[index];
        },

        'buildList' : function () {
            var tmpHtml = '',
                i = 0,
                unicodeIndex = 65, // 65 = A, 65+26 = Z
                marker = null;

            while (i < this.rawData.length) {

                marker = new MarkerItem(this.rawData[i].location);
                /*if (i > 25) {
                    tmpHtml += address.toHtml('&nbsp;');
                } else {
                    tmpHtml += address.toHtml(String.fromCharCode(unicodeIndex + (i % 26)));
                }*/
                ++i;
            }
            //add markers to map
        }
    };

    return new Markers(locationsArray);
});


