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(Math.round((c2[0]-c1[0])/numSteps), Math.round((c2[1]-c1[1])/numSteps), Math.round((c2[2]-c1[2])/numSteps));

  for (i=0; i<numSteps; i++)
  {
    var R = (dC[0]*i+c1[0]);
    R=(R>0xff)?0xff:R;
    R=R.toString(16);
    var G = (dC[1]*i+c1[1]);
    G=(G>0xff)?0xff:G;
    G=G.toString(16);
    var B = (dC[2]*i+c1[2]);
    B=(B>0xff)?0xff: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;
};

