function leftPad(x) {
	return (x.length < 2) ? "0"+x : x;
}
function hex(x) {
	return leftPad(x.toString(0x10).toUpperCase());
}
function Gradient(x) {
 	var height; var step;
 	if (screen.height<=600) {
 		height=2; step=10;
 	} else if (screen.height<=768) {
 		height=3; step=50;
 	} else if (screen.height<=1024) {
 		height=5; step=60;
 	} else if (screen.height<=1200) {
 		height=8; step=70;
 	}
	var tbody = document.getElementById(x).getElementsByTagName('TBODY')[0];
	var r=0x44; var g=0x6d; var b=0x8d;
	var sr=(255-r)/step; var sg=(255-g)/step; var sb=(255-b)/step;
	for (i=0; i<step; i++) {
		var row = document.createElement("TR");
    	tbody.appendChild(row);
		var td = document.createElement("td");
		td.style.backgroundColor = "#"+hex(Math.floor(r))+hex(Math.floor(g))+hex(Math.floor(b));
		td.style.fontSize        = "0px";
		td.style.height          = height+"px";
		row.appendChild(td);
		r=r+sr; g=g+sg; b=b+sb;
	}
}

