// SDateTimeControl Client Script Library
// Alfa-XP, Michael Isipciuc, 2007.
//
FM.UI.SDateTimeControl= function(element) {
	FM.UI.SDateTimeControl.initializeBase(this, [element]);
	this.after= new FM.UI.DateTimeControl(this._ui.rows[0].cells[0].firstChild); this.after.initialize();
	this.before= new FM.UI.DateTimeControl(this._ui.rows[0].cells[2].firstChild); this.before.initialize();
}

FM.UI.SDateTimeControl.prototype= {

	dispose : function() {
		if (this.after) { this.after.dispose();	this.after= null; }
		if (this.before) { this.before.dispose(); this.before= null; }
		
    FM.UI.SDateTimeControl.callBaseMethod(this, "dispose");
  },
  
  focus : function() { this.after.focus(); },
  
  setValue : function(s) { 
		// only for reset
		this.after.setValue('');
		this.before.setValue('');
	},
  getValue : function() { 
		var s1= this.after.getValue();
		var s2= this.before.getValue();
		if ((s1.length + s2.length) == 0) return "";
		else return s1 + "--" + s2;
	}
}

FM.UI.SDateTimeControl.inheritsFrom(FM.UI.BaseFormControl);
FM.UI.SDateTimeControl.registerClass('FM.UI.SDateTimeControl', FM.UI.BaseFormControl);


Sys.Application.notifyScriptLoaded();