/*
 * jQuery css clip animation support -- Jim Palmer
 * version 0.1.2
 * idea spawned from jquery.color.js by John Resig
 * Released under the MIT license.
 * Updated Jan 16 2009 for negative clip numbers by Charles Phillips  charles@doublerebel.com
 * Updated Jan 17 2009 for IE6+7 Support (it choked on the regex although would occasionally work)
 * Updated March 30 2009 for fx.state bug (a. farkas fix from 1.7+ ui.effects.core)
 */

(function(jQuery){
	jQuery.fx.step.clip = function(fx){
		if ( !fx.clipInitialized ) {
				fx.start = fx.elem.style.clip.replace(/rect|[,()]/g, '');
				fx.start = fx.start.split(' ');
				fx.end = String(fx.end).replace(/rect|[,()]/g, '');
				fx.end = fx.end.split(' ');
				fx.clipInitialized = true;
		}
		fx.elem.style.clip = 'rect(' + parseInt( ( fx.pos * ( parseInt(fx.end[0]) - parseInt(fx.start[0]) ) ) + parseInt(fx.start[0]) ) + 'px ' + parseInt( ( fx.pos * ( parseInt(fx.end[1]) - parseInt(fx.start[1]) ) ) + parseInt(fx.start[1]) ) + 'px ' + parseInt( ( fx.pos * ( parseInt(fx.end[2]) - parseInt(fx.start[2]) ) ) + parseInt(fx.start[2]) ) + 'px ' + parseInt( ( fx.pos * ( parseInt(fx.end[3]) - parseInt(fx.start[3]) ) ) + parseInt(fx.start[3]) ) + 'px)';
	};
})(jQuery);