
var divSlider = Class.create(DomDivExtended, {
	initialize: function($super) {
	  $super();
	  this._enabled = true;
	  this._name = null;
	  this._sliding = false;
	  this._currentHeight = null;
	  this._endHeight = null;
	  this._interval = null;
	  this._timeInterval = null;
	  this._pe = null;
	  this._closed = false;
	},
	initListeners: function(){
	  var parObj = this;
	  this._domRef.observe('click', function(event){
		parObj._domRef.fire('divSlider:onDomRefClick', {name:parObj._name});
	  });
	},
	setDomRef: function(val){
		this._domRef = val;
	},
	getEnabled: function(){
		return this._enabled;
	},
	enable: function(){
		this._enabled = true;
	},
	disable: function(){
		this._enabled = false;
	},
	getName: function(){
		return this._name;
	},
	setName: function(val){
		this._name = val;
	},
	getInterval: function(){
		return this._interval;
	},
	setInterval: function(val){
		this._interval = val;
	},
	getTimeInterval: function(){
		return this._timeInterval;
	},
	setTimeInterval: function(val){
		this._timeInterval = val;
	},
	getCurrentHeight: function(){
		return this._currentHeight;
	},
	setCurrentHeight: function(val){
		this._currentHeight = val;
		this.setHeight(val);
	},
	getEndHeight: function(){
		return this._endHeight;
	},
	setEndHeight: function(val){
		this._endHeight = val;
	},
	getClosed: function(){
		return this._closed;
	},
	setClosed: function(val){
		this._closed = val;
	},
	getSliding: function(){
		return this._sliding;
	},
	slide: function(){
		if(!this._sliding){
			this._sliding = true;
			this._pe = new PeriodicalExecuter(this.onSliding.bind(this), this._timeInterval);
		}
	},
	onSliding: function(executer){
		var a = (this._endHeight - this._currentHeight) / this._interval;
		this._currentHeight += a;
		var t = a + this.getHeight();
		this.setHeight(t);
		if(Math.abs(this._endHeight - this._currentHeight) < 2){
			executer.stop();
			this._pe = null;
			this._sliding = false;
		}
	}
});
