Element.implement({
	
getElementsByClassName: function(className){
		
return this.getElements('.'+className);
	
}

});



Element.extend({

	effect: function(property, options){
		
return new Fx.Style(this, property, options);
	
},


	effects: function(property, options){

		return new Fx.Styles(this, property, options);
	
}

});


Fx.Styles.implement({
	move: function(topTo, leftTo){

		this.custom({
			'top': [this.el.getStyle('top', true), topTo],
			'left': [this.el.getStyle('left', true), leftTo]
		});
	}

});



Tips.implement({

	locate: function(evt){

		var doc = document.documentElement;
		var yPos;

		var yDiff= this.toolTip.offsetHeight + 20;


		tmp= function(){
			
alert(this.toolTip.offsetHeight);
		
}.bind(this);
		

if(evt.clientY < (doc.clientHeight * .5)){
			
yPos= evt.clientY + doc.scrollTop + 30;

		}
		else {
			
yPos= evt.clientY + doc.scrollTop - yDiff;
		
}
		

this.toolTip.setStyles ? this.toolTip.setStyles({'top': yPos + 'px', 'left': evt.clientX + doc.scrollLeft - 30 + 'px'}):null;
	
}

});


Element.extend({
	

cumulativeOffset: function() {
		
element= this;

		var valueT = 0, valueL = 0;

		do {
			
valueT += element.offsetTop  || 0;
valueL += element.offsetLeft || 0;
element = element.offsetParent;
		
} while (element);
		
return [valueL, valueT];
	
}


});

Fx.Scroll = Fx.Base.extend({
	

initialize: function(options) {
		
this.setOptions(options);
	
},


	scrollTo: function(el){
		
var desty = $(el).cumulativeOffset();
		
var dest = desty[1];

		var client = window.innerHeight || document.documentElement.clientHeight;

		var full = document.documentElement.scrollHeight;

		var top = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
		
if (dest+client > full) this.custom(top, dest - client + (full-dest));

		else this.custom(top, dest);
	
},
	

increase: function(){

		window.scrollTo(0, this.now);

	}

});



String.extend({
	

isEmpty:function(){
		
return (this.length > 0 ? 'false':'true');

	},


	isString:function(){
		
return (this.test('[0-9]','ig') ? 'false':'true');
	
},
	

isSingleWord:function(){
		
return (this.test(' ','ig') ? 'false':'true');
	
},
	

isEmail:function(){
		
return (this.test('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$','ig') ? 'true':'false');
	
}

});
