// Metodus: Internet Productivo, Usabilidad y Desarrollo Web http://www.metodus.com
// License: http://www.opensource.org/licenses/mit-license.php

Metodus = function() {};

Metodus.footer = new Class({     
	initialize: function(el) {
		this.el = $(el);

		window.onresize = function() { this.update(); }.bind(this);	
		
		this.update();
	},

	update: function() {
		if (document.all) wh = document.documentElement.clientHeight;
		else wh = window.innerHeight;
		
		if (navigator.appName.test('Microsoft|MSIE')) bh = document.body.scrollHeight;
		else bh = document.body.offsetHeight;

		if (this.el.hasClass('absolute')) bh = bh + this.el.offsetHeight;

		if (wh >= bh) this.el.addClass('absolute');
		else this.el.removeClass('absolute');
	}
});
