Element.implement({
	hide: function() {
		this.setStyle('display', 'none');
		return this;
	},
	
	show: function() {
		this.setStyle('display', 'block');
		return this;
	},
	
	toggle: function() {
		this.getStyle('display') == 'none' ? this.show() : this.hide();
		return this;
	},
	
	isHidden: function() {
		return (this.getStyle('display') == 'none');
	},
	
	outsideClick: function(e) {
		var coords = this.getCoordinates();
		
		//console.log('x: '+ e.page.x +' > '+ coords.left +' && '+ e.page.x +' < '+ (coords.left + coords.width));
		//console.log('y: '+ e.page.y +' > '+ coords.top  +' && '+ e.page.y +' < '+ (coords.top + coords.height));
		
		var b = (e.page.x > coords.left && e.page.x < (coords.left + coords.width)) &&
				(e.page.y > coords.top  && e.page.y < (coords.top + coords.height)) ? false : true;
		
		//console.log('mouse is '+ (b ? 'outside' : 'inside'));
		
		return b;
	},
	
	mouseInside: function(e) {
		return !this.outsideClick(e);
	},
	
	mouseOutside: function(e) {
		return this.outsideClick(e);
	},
	
	hasVerticalScrollbar: function() {
		return (this.clientHeight < this.scrollHeight);
	}
});