function make_roundrect(id)
{
	var old_rect = document.getElementById(id);
	
	var cur_style;
	if (old_rect.currentStyle)
		cur_style = old_rect.currentStyle;
	else if (document.defaultView && document.defaultView.getComputedStyle)
		cur_style = document.defaultView.getComputedStyle(old_rect, null);
	else
		return;
	
	color = cur_style.backgroundColor;
	
//	var new_rect = document.createElement("div");
	var new_rect = old_rect.cloneNode(true);
	new_rect.innerHTML = "";
	new_rect.style.backgroundColor = "transparent";
	new_rect.style.display = "";
	
	var tmp1 = document.createElement("div");
	tmp1.style.display = "block";
	tmp1.style.overflow = "hidden";
	tmp1.style.backgroundColor = color;
	var tmp2 = tmp1.cloneNode(false);
	var tmp3 = tmp1.cloneNode(false);

//	var tmp4 = old_rect.cloneNode(true);
	var tmp4 = document.createElement("div");
	tmp4.innerHTML = old_rect.innerHTML;
	tmp4.style.backgroundColor = color;

	tmp1.style.height = "1px";
	tmp1.style.margin = "0 4px";
	tmp2.style.height = "1px";
	tmp2.style.margin = "0 2px";
	tmp3.style.height = "2px";
	tmp3.style.margin = "0 1px";

	new_rect.appendChild(tmp1.cloneNode(false));
	new_rect.appendChild(tmp2.cloneNode(false));
	new_rect.appendChild(tmp3.cloneNode(false));
	new_rect.appendChild(tmp4);
	new_rect.appendChild(tmp3);
	new_rect.appendChild(tmp2);
	new_rect.appendChild(tmp1);
	
	old_rect.parentNode.replaceChild(new_rect, old_rect);
}

function make_top_roundrect(id)
{
	var old_rect = document.getElementById(id);
	
	var cur_style;
	if (old_rect.currentStyle)
		cur_style = old_rect.currentStyle;
	else if (document.defaultView && document.defaultView.getComputedStyle)
		cur_style = document.defaultView.getComputedStyle(old_rect, null);
	else
		return;
	
	color = cur_style.backgroundColor;

//	var new_rect = document.createElement("div");
	var new_rect = old_rect.cloneNode(true);
	new_rect.innerHTML = "";
	new_rect.style.backgroundColor = "transparent";
	new_rect.style.display = "";
	
	var tmp1 = document.createElement("div");
	tmp1.style.display = "block";
	tmp1.style.overflow = "hidden";
	tmp1.style.backgroundColor = color;
	var tmp2 = tmp1.cloneNode(false);
	var tmp3 = tmp1.cloneNode(false);

//	var tmp4 = old_rect.cloneNode(true);
	var tmp4 = document.createElement("div");
	tmp4.innerHTML = old_rect.innerHTML;
	tmp4.style.backgroundColor = color;

	tmp1.style.height = "1px";
	tmp1.style.margin = "0 4px";
	tmp2.style.height = "1px";
	tmp2.style.margin = "0 2px";
	tmp3.style.height = "2px";
	tmp3.style.margin = "0 1px";

	new_rect.appendChild(tmp1);
	new_rect.appendChild(tmp2);
	new_rect.appendChild(tmp3);
	new_rect.appendChild(tmp4);
	
	old_rect.parentNode.replaceChild(new_rect, old_rect);
}

function make_bottom_roundrect(id)
{
	var old_rect = document.getElementById(id);
	
	var cur_style;
	if (old_rect.currentStyle)
		cur_style = old_rect.currentStyle;
	else if (document.defaultView && document.defaultView.getComputedStyle)
		cur_style = document.defaultView.getComputedStyle(old_rect, null);
	else
		return;
	
	color = cur_style.backgroundColor;
	
//	var new_rect = document.createElement("div");
	var new_rect = old_rect.cloneNode(true);
	new_rect.innerHTML = "";
	new_rect.style.backgroundColor = "transparent";
	new_rect.style.display = "";
	
	var tmp1 = document.createElement("div");
	tmp1.style.display = "block";
	tmp1.style.overflow = "hidden";
	tmp1.style.backgroundColor = color;
	var tmp2 = tmp1.cloneNode(false);
	var tmp3 = tmp1.cloneNode(false);

//	var tmp4 = old_rect.cloneNode(true);
	var tmp4 = document.createElement("div");
	tmp4.innerHTML = old_rect.innerHTML;
	tmp4.style.backgroundColor = color;

	tmp1.style.height = "1px";
	tmp1.style.margin = "0 4px";
	tmp2.style.height = "1px";
	tmp2.style.margin = "0 2px";
	tmp3.style.height = "2px";
	tmp3.style.margin = "0 1px";

	new_rect.appendChild(tmp4);
	new_rect.appendChild(tmp3);
	new_rect.appendChild(tmp2);
	new_rect.appendChild(tmp1);
	
	old_rect.parentNode.replaceChild(new_rect, old_rect);
}

function color_row(id)
{
	var table = document.getElementById(id);
	var trs = table.getElementsByTagName("tr");
	var i;
	for (i = 0; i < trs.length; i++) {
		if (i % 2 == 0)
			trs[i].style.backgroundColor = "#dfefff";
		else
			trs[i].style.backgroundColor = "#ffefdf";
	}

//	table.style.border = "1px solid #000000";
}