
//Used to keep a container in the vertical center of the browser

var WindowResizer = new Class({
	
	Implements: [Options,Events],
	
	//options
	options: {
		yourOption: '',
		onUpdate: $empty
	},
	
	//initialization
	initialize: function(container, options) {

		//set options
		this.setOptions(options);
		
		this.container = $(container);
		
		this.mover = new Fx.Tween(this.container, { transition: Fx.Transitions.Quart.easeOut, duration: 1000});
		
		this.eventPosition = this.position.bind(this);
		
		window['addEvent']('resize', this.eventPosition);

		this.position();
	},
	position: function(){
		var top = (window.getHeight() - this.container.getHeight())/2;
		this.mover.start('top', ((top > 0) ? top : 0).round());
		this.fireEvent('onUpdate');
	}
});