function Gradient(el, sel) {
	var element = el, selector = sel;
	var colorArray;
	var counter, step;

	this.draw = function(startColor, endColor) {
		var pieces = $(element).find(selector);
		colorArray = createColorPath(startColor, endColor);

		counter = 0.0;
		step = (colorArray.length / $(pieces).size()) || 1;
		$(element).find(selector).each(function() {
			var rounded = Math.round(counter);
			$(this).css( {color: "rgb(" + colorArray[rounded][0] + "," + colorArray[rounded][1] + "," + colorArray[rounded][2] + ")"} );
			counter += step;
		});
	};

	function createColorPath(color1, color2) {
		var colorPath = [], colorPercent = 1.0;
		do {
			colorPath[colorPath.length] = setColorHue(longHexToDec(color1), colorPercent, longHexToDec(color2));
			colorPercent -= 0.01;
		} while (colorPercent > 0);
		return colorPath;
	}

	function setColorHue(originColor, opacityPercent, maskRGB) {
		var returnColor = [];
		for (var w = 0; w < originColor.length; w++) {
			returnColor[w] = Math.round(originColor[w]*opacityPercent) + Math.round(maskRGB[w]*(1.0-opacityPercent));
		}
		return returnColor;
	}

	function longHexToDec(longHex) { return [toDec(longHex.substring(0,2)), toDec(longHex.substring(2,4)), toDec(longHex.substring(4,6))]; }
	function toDec(hex) { return parseInt(hex,16); }
}