context: OSGradient.addGradient = function(e, properties) {    e.style.position = 'relative';	function getProperty(name, defaultValue) {		var value = properties[name];		return value == undefined ? defaultValue : value;	}    var c0 = getProperty('gradient-start-color', 0x000000);    var c1 = getProperty('gradient-end-color', 0xffffff);	var a0 = getProperty('gradient-start-opacity', 1);	var a1 = getProperty('gradient-stop-opacity', 1);    var r = getProperty('border-radius', 0);    var width = e.offsetWidth, height = e.offsetHeight;    var spans = [];    var bars = 256;    for (var i = 0; i < bars; i++) {        var color = OSUtils.color.interpolate(c0, c1, i/bars);		var w = width;        var y = Math.floor(i*height/bars);        var h = Math.floor((i+1)*height/bars) - y;        var dx = 0;        var dy = Math.max(r-y, y-(height-r));        if (0 <= dy) dx = r - Math.sqrt(r*r-dy*dy);        var properties = {position: 'relative',                          left: dx,						  top: 0,                          width: w-2*dx,                          height: h,						  'font-size': 1,						  'line-height': 0,                          background: OSUtils.color.long2css(color)};        var style = [];        for (var p in properties)            style.push(p + ':' + String(properties[p]));		if (false && dx) {			spans.push('<div style="'+style.join(';')+'">');			spans.push('<span style="opacity:.5;width:10;height:1px">&nbsp;</span>');			spans.push('&nbsp;');			spans.push('</div>');			continue;		}        spans.push('<div style="'+style.join(';')+'">&nbsp;</div>');		ReadableLogger.defaults.stringLimit=1000;		if (!i) info(properties);		if (!i) info(style);		if (!i) info(style.join(';'));		if (!i) info(spans);		if (!i) {g1=properties;g2=style;g3=spans[spans.length-1]}    }    var g = document.createElement('div');    g.style.position = 'absolute';    g.style.left='0px';    g.style.top='0px';    g.style.width="100%";    g.style.height='100%';    //g.style['z-index'] = '-1';    g.style.zIndex = -1;    if (e.childNodes.length)        e.insertBefore(g, e.childNodes[0]);    else        e.appendChild(g);    g.innerHTML = spans.join('');};
meta: 5392	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5392/54a4279ecb3a94838bbf7d3fb39713e1260a77bb/gradients.js/buggy/sources/javascript/gradients.js