/**
 * Description
 * @author tjunghans, Namics AG, www.namics.com
 * @class MEDELA
 * @namespace MEDELA.locationfinder
 * @requires jQuery
 */

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

var MEDELA = MEDELA || {};
MEDELA.locationfinder = MEDELA.locationfinder || {};

(MEDELA.locationfinder.parameters = function () {
    var $medelaLocationfinderParameters = null,
        fetch = null,
        getMlfParams = null,
        getArray = null,
        getValue = null,
        init = null;

    /**
     * The module initialiser. Don't forget to use the method fetch() to make sure you are
     * getting the current data.
     * @method init
     */
    init = function () {
        fetch();
    };

    /**
     * Can't really cache this jQuery object, since data can change
     * @method fetch
     */
    fetch = function () {
        $medelaLocationfinderParameters = jQuery('#medelaLocationfinderParameters');
    };

    /**
     * getter method for $medelaLocationfinderParameters
     * @method getMlfParams
     * @return {jQuery} $medelaLocationfinderParameters
     */
    getMlfParams = function () {
        return $medelaLocationfinderParameters;
    };

    getValue = function (name) {
        return getMlfParams().children('input[name="' + name + '"]').val();
    };

    getArray = function () {
        return getMlfParams().children('input');
    };

    return {
        getArray : getArray,
        getValue : getValue,
        fetch : fetch,
        init : init
    };
    
}());

jQuery(document).ready(function () {
    MEDELA.locationfinder.parameters.init();    
});

