Element.extend({
	bringToTop : function() {
		lastIndex++;
		this.setStyle('z-index', lastIndex);
	},
	addMousePopup : function(popup) {
		popup.bindTo(this);
	},
	fadeIn : function(delay) {
		new Fx.Style(this, 'opacity', {
			duration :1000
		}).start(1);
	},
	fadeOut : function(delay) {
		new Fx.Style(this, 'opacity', {
			duration :1000
		}).start(100, 0);
	},
	highlight : function(start, end) {
		new Fx.Style(this, 'background-color', {
			duration :1000
		}).start(start, end);
	},
	slideIn : function() {
		this.FxSlide.slideIn();
	},
	hide : function() {
		this.FxSlide.hide();
	},
	toggle : function() {
		this.FxSlide.toggle();
	},
	stop : function() {
		this.FxSlide.stop();
	},
	FxSlide : function() {
		this.FxSlide = new Fx.Slide(this);
	}
});

String.extend({
	trim : function() {
		return this.replace(/^\s+|\s+$/g, "");
	},
	blank : function() {
		return /^\s*$/.test(this);
	},
	isEmail : function() {
		return new RegExp(
		// '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$')
				/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i).test(this);
	}

});
