Fx.SlideAbs = Fx.Base.extend({

	options: {
		mode: 'vertical'
	},
	
	initialize: function(el, options){
		this.element = $(el);		
		this.element.setStyle('margin', 0);
		this.setOptions(options);
		this.now = [];
		this.parent(this.options);
		this.open = true;
		this.addEvent('onComplete', function(){
			this.open = (this.now[0] === 0);
		});
		if (window.webkit419) this.addEvent('onComplete', function(){			
		});
	},

	setNow: function(){
		for (var i = 0; i < 2; i++) this.now[i] = this.compute(this.from[i], this.to[i]);
	},
	
	vertical: function(){
		this.margin = 'margin-top';
		this.layout = 'height';		
		// this.offset = this.element.offsetHeight + 10;
		this.offset = Math.max(screen.availHeight, (this.element.offsetHeight + 10) );
	},

	horizontal: function(){
		this.margin = 'margin-left';
		this.layout = 'width';
		// this.offset = this.element.offsetWidth + 10;
		this.offset = Math.max(screen.availWidth, (this.element.offsetWidth + 10) );
		// window.console.log('offset '+ this.offset+ ',margin ' + this.margin);
	},
	
	/*
	Property: slideIn
		Slides the elements in view horizontally or vertically.

	Arguments:
		mode - (optional, string) 'horizontal' or 'vertical'; defaults to options.mode.
	*/

	slideIn: function(mode){
		this[mode || this.options.mode]();
		return this.start([this.element.getStyle(this.margin).toInt()], [0]);
	},

	/*
	Property: slideOut
		Sides the elements out of view horizontally or vertically.

	Arguments:
		mode - (optional, string) 'horizontal' or 'vertical'; defaults to options.mode.
	*/

	slideOut: function(mode){
		this[mode || this.options.mode]();
		return this.start([this.element.getStyle(this.margin).toInt()], [-this.offset]);
	},
	
	/*
	Property: hide
		Hides the element without a transition.

	Arguments:
		mode - (optional, string) 'horizontal' or 'vertical'; defaults to options.mode.
	*/

	hide: function(mode){
		this[mode || this.options.mode]();
		this.open = false;
		return this.set([-this.offset, 0]);
	},

	/*
	Property: show
		Shows the element without a transition.

	Arguments:
		mode - (optional, string) 'horizontal' or 'vertical'; defaults to options.mode.
	*/

	show: function(mode){
		this[mode || this.options.mode]();
		this.open = true;
		return this.set([0, this.offset]);
	},
	
	increase: function(){
		this.element.setStyle(this.margin, this.now[0] + this.options.unit);	
		//opera.postError(this.element.getStyle(this.margin));
		//window.console.log(this.element.getStyle(this.margin));
	}
});