﻿Type.registerNamespace ("Nestle.Crunch");

Nestle.Crunch.DobSelector = function (element) {

    this._yearSelector = null;
    this._monthSelector = null;
    this._daySelector = null;
    
    Nestle.Crunch.DobSelector.initializeBase (this, [element]);
}

Nestle.Crunch.DobSelector.prototype = {

    // ----------------------------------------
    get_yearSelector : function () { return this._yearSelector; },
    set_yearSelector : function (value) { this._yearSelector = $get(value); },
    
    // ----------------------------------------
    get_monthSelector : function () { return this._monthSelector; },
    set_monthSelector : function (value) { this._monthSelector = $get(value); },
    
    // ----------------------------------------
    get_daySelector : function () { return this._daySelector; },
    set_daySelector : function (value) { this._daySelector = $get(value); },
    
    // ----------------------------------------
    get_selectedYear : function () {
        return $(this._yearSelector).val();
    },
    
    // ----------------------------------------
    get_selectedMonth : function () {
        return $(this._monthSelector).val();
    },
    
    // ----------------------------------------
    get_selectedDay : function () {
        return $(this._daySelector).val();
    },
    
    // ----------------------------------------
    initialize: function () {
        Nestle.Crunch.DobSelector.callBaseMethod (this, "initialize");
    },
    
    // ----------------------------------------
    dispose : function () {
        _yearSelector = null;
        _monthSelector = null;
        _daySelector = null;        
            
        Nestle.Crunch.DobSelector.callBaseMethod (this, "dispose");
    }    
}

Nestle.Crunch.DobSelector.registerClass ('Nestle.Crunch.DobSelector', Sys.UI.Control);
Sys.Application.notifyScriptLoaded();