/**
 * @author trixta
 */
(function($){
		$.fx.step.syncWidth = function(fx){
            if (!fx.state || !fx.syncStart) {
                var o = fx.options;
				fx.start = $(fx.elem).width();
				fx.syncStart = [];
				fx.fullWidth = o.fullWidth;
				
				fx.syncElements = $(o.syncElements)
					.map(function(i, elem){
						if(elem !== fx.elem){
							return elem;
						}
					})
					.each(function(i){
						fx.syncStart.push($(this).width());
					});
					
				fx.syncEnd = (fx.fullWidth - fx.end) / fx.syncElements.length;
            }
			var syncedWidth = 0;
			fx.syncElements
				.each(function(i){
					var width = Math.round(fx.pos * (fx.syncEnd - fx.syncStart[i]) + fx.syncStart[i]);
					syncedWidth += width;
					this.style.width = width + fx.unit;
				});
			
			fx.elem.style.width = fx.fullWidth - syncedWidth + fx.unit;
        };
})(jQuery);