function linearGradient(color1, color2, numSteps)
{
  var result = new Array();
  var c1 = new Array(parseInt("0x"+color1.substr(1,2)), parseInt("0x"+color1.substr(3,2)), parseInt("0x"+color1.substr(5,2)));
  var c2 = new Array(parseInt("0x"+color2.substr(1,2)), parseInt("0x"+color2.substr(3,2)), parseInt("0x"+color2.substr(5,2)));
  var dC = new Array((c2[0]-c1[0])/numSteps, (c2[1]-c1[1])/numSteps, (c2[2]-c1[2]));

  for (i=0; i<numSteps; i++)
  {
    var R = Math.round(dC[0]*i+c1[0]);
    R=(R>0xff)?0xff:R;
	R=(R<0)?0:R;
    R=R.toString(16);
    var G = Math.round(dC[1]*i+c1[1]);
    G=(G>0xff)?0xff:G;
	G=(G<0)?0:G;
    G=G.toString(16);
    var B = Math.round(dC[2]*i+c1[2]);
    B=(B>0xff)?0xff:B;
	B=(B<0)?0:B;
    B=B.toString(16);
    result[i] = "#"+((R.length==1)?("0"+R):R)+((G.length==1)?("0"+G):G)+((B.length==1)?("0"+B):B);    
  }
  return result;
};


