Element.implement({
	'animateStyle': function(_style, _to){
		if (SUPPORT_TRANSITIONS) { //todo: change to check for transitions class on body
			this.setStyle(_style, _to);
		} else {
			var tweenExists	= false;
			if (this.tweensObject) {
				var tween	= this.tweensObject[_style];
				if (tween) tweenExists = true;
			}
			
			if (tweenExists) {
				setTimeout(function() {
					tween.cancel();
					tween.start(_to);
				}, this.delaysObject[_style]);
			} else {
				this.setStyle(_style, _to);
			}
			
		}
	},
	
	'setAnimationProperties': function(_properties, _durations, _eases, _delays, _ignoreNotSupported) {
		//log('setAnimationProperties() _ignoreNotSupported = ' + _ignoreNotSupported);
		
		//eases currenty not implemented properly, should be fine for css3 browsers if passed correctly
		this.animationProps	= {
			properties		: _properties,
			durations		: _durations,
			eases			: _eases,
			delays			: _delays
		};
		
		if (!SUPPORT_TRANSITIONS && !_ignoreNotSupported) {
			this.tweensObject	= {};
			this.delaysObject	= {};
			
			for (var i=0; i<_properties.length; i++) {
				this.tweensObject[_properties[i]] = new Fx.Tween(this, {
					duration: _durations[i],
					//transition: _eases[i],
					property: _properties[i]
				});
				
				this.delaysObject[_properties[i]] = _delays[i];
			}
			
		}
		else if (SUPPORT_TRANSITIONS) {
			
			var propCSS		= Modernizr.prefixed('transitionProperty').replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
			var durCSS		= Modernizr.prefixed('transitionDuration').replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
			var easeCSS		= Modernizr.prefixed('transitionTimingFunction').replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
			var delayCSS	= Modernizr.prefixed('transitionDelay').replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
			
			var i			= 0;
			var propValue	= '';
			var durValue	= '';
			var easeValue	= '';
			var delayValue	= '';
			
			for (i=0; i<_properties.length; i++) {
				propValue += _properties[i];
				if (i < _properties.length-1) propValue += ', ';
			}
			
			for (i=0; i<_durations.length; i++) {
				durValue += (_durations[i] / 1000) + 's';
				if (i < _durations.length-1) durValue += ', ';
			}
			
			for (i=0; i<_eases.length; i++) {
				easeValue += _eases[i];
				if (i < _eases.length-1) easeValue += ', ';
			}
			
			for (i=0; i<_delays.length; i++) {
				delayValue += (_delays[i] / 1000) + 's';
				if (i < _delays.length-1) delayValue += ', ';
			}
			
			this.setStyle(propCSS, propValue);
			this.setStyle(durCSS, durValue);
			this.setStyle(easeCSS, easeValue);
			this.setStyle(delayCSS, delayValue);
		}
	}
});
