﻿Type.registerNamespace('MKB.TimePicker');

MKB.TimePicker.TimeSelector = function(element) {
    MKB.TimePicker.TimeSelector.initializeBase(this, [element]);
    // class properties
    this._date = null;
    this._hour = null;
    this._minute = null;
    this._second = null;
    this._ampm = null;
}


MKB.TimePicker.TimeSelector.prototype = {    
    initialize : function() 
    {
        MKB.TimePicker.TimeSelector.callBaseMethod(this, 'initialize');
    },
    
    dispose : function() 
    {
        $clearHandlers(this.get_element());        
        MKB.TimePicker.TimeSelector.callBaseMethod(this, 'dispose');
    },

    
    get_date : function() {
      return this._date;
    },
    set_date : function(value) {
    if (this._date !== value) {
        this._date = value;
        this.raisePropertyChanged('date');
      }
    },
    
    get_hour : function() {
      return this._hour;
    },
    set_hour : function(value) {
    if (this._hour !== value) {
        this._hour = value;
        this.raisePropertyChanged('hour');
      }
    },
    
    get_minute : function() {
      return this._minute;
    },
    set_minute : function(value) {
    if (this._minute !== value) {
        this._minute = value;
        this.raisePropertyChanged('minute');
      }
    },
    
    get_second : function() {
      return this._second;
    },
    set_second : function(value) {
    if (this._second !== value) {
        this._second = value;
        this.raisePropertyChanged('second');
      }
    },
    
    get_ampm : function() {
      return this._ampm;
    },
    set_ampm : function(value) {
    if (this._ampm !== value) {
        this._ampm = value;
        this.raisePropertyChanged('ampm');
      }
    }
}

// JSON serialization.
MKB.TimePicker.TimeSelector.descriptor = {
    properties: [ {name: 'date', type: String},
    {name: 'hour', type: String},
    {name: 'minute', type: String},
    { name: 'second', type: String},
    { name: 'ampm', type: String}]
}

MKB.TimePicker.TimeSelector.registerClass('MKB.TimePicker.TimeSelector', Sys.UI.Control);

if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();