function topRoundTbl(width,color) {
 var w=width-16;
 var c=color;
 var top_html;
 top_html="<table cellpadding=0 cellspacing=0 border=0 width="+width+">";
 top_html+="<tr height=1>";
 top_html+="	<td colspan='6' width='6'></td>";
 top_html+="	<td width=2 colspan='2' bgcolor='"+c+"'></td>";
 top_html+="	<td bgcolor='"+c+"' rowspan='2' width='"+w+"'></td>";
 top_html+="	<td width=2 colspan='2' bgcolor='"+c+"'></td>";
 top_html+="	<td width=6 colspan='6'></td>";
 top_html+="</tr>";

 top_html+="<tr height=1>";
 top_html+="	<td width=4 colspan=4></td>";
 top_html+="	<td width=4 colspan=4 bgcolor='"+c+"'></td>";
 top_html+="	<td width=4 colspan=4 bgcolor='"+c+"'></td>";
 top_html+="	<td width=4 colspan=4></td>";
 top_html+="</tr>";

 top_html+="<tr height=1>";
 top_html+="	<td width=3 colspan=3></td>";
 top_html+="	<td width=5 colspan='5'  bgcolor='"+c+"'></td>";
	top_html+="	<td bgcolor='FFFFFF' rowspan='6' width='"+w+"'></td>";
 top_html+="	<td width=5 colspan='5'  bgcolor='"+c+"'></td>";
 top_html+="	<td width=3 colspan=3></td>";
 top_html+="</tr>";

 top_html+="<tr height=1>";
 top_html+="	<td width=2 colspan=2></td>";
 top_html+="	<td width=6 colspan=6 bgcolor='"+c+"'></td>";
 top_html+="	<td width=6 colspan=6 bgcolor='"+c+"'></td>";
 top_html+="	<td width=2 colspan=2></td>";
 top_html+="</tr>";

 top_html+="<tr height=1>";
 top_html+="	<td width=1></td>";
 top_html+="	<td width=7 colspan=7 bgcolor='"+c+"'></td>";
 top_html+="	<td width=7 colspan=7 bgcolor='"+c+"'></td>";
 top_html+="	<td width=1></td>";
 top_html+="</tr>"; 
 
 top_html+="<tr height=1>";
 top_html+="	<td width=1></td>";
 top_html+="	<td width=7 colspan=7 bgcolor='"+c+"'></td>";
 top_html+="	<td width=7 colspan=7 bgcolor='"+c+"'></td>";
 top_html+="	<td width=1></td>";
 top_html+="</tr>"; 

 top_html+="<tr height=1>";
 top_html+="	<td width=8 colspan=8 bgcolor='"+c+"'></td>";
 top_html+="	<td width=8 colspan=8 bgcolor='"+c+"'></td>";
 top_html+="</tr>";

 top_html+="<tr height=1>";
 top_html+="	<td width=8 colspan=8 bgcolor='"+c+"'></td>";
 top_html+="	<td width=8 colspan=8 bgcolor='"+c+"'></td>";
 top_html+="</tr>";

 top_html+="</table>";
 document.write(top_html);
}

function bottomRoundTbl(width,color) {
 var w=width-16;
 var c=color;
 var top_html;
 top_html="<table cellpadding=0 cellspacing=0 border=0 width="+width+">";

 top_html+="<tr height=1>";
 top_html+="	<td width=8 colspan=8 bgcolor='"+c+"'></td>";
 top_html+="	<td bgcolor='FFFFFF' rowspan='6' width='"+w+"'></td>";
 top_html+="	<td width=8 colspan=8 bgcolor='"+c+"'></td>";
 top_html+="</tr>";
 top_html+="<tr height=1>";
 top_html+="	<td width=8 colspan=8 bgcolor='"+c+"'></td>";
 top_html+="	<td width=8 colspan=8 bgcolor='"+c+"'></td>";
 top_html+="</tr>";
 
 top_html+="<tr height=1>";
 top_html+="	<td width=1></td>";
 top_html+="	<td width=7 colspan=7 bgcolor='"+c+"'></td>";
 top_html+="	<td width=7 colspan=7 bgcolor='"+c+"'></td>";
 top_html+="	<td width=1></td>";
 top_html+="</tr>"; 
 top_html+="<tr height=1>";
 top_html+="	<td width=1></td>";
 top_html+="	<td width=7 colspan=7 bgcolor='"+c+"'></td>";
 top_html+="	<td width=7 colspan=7 bgcolor='"+c+"'></td>";
 top_html+="	<td width=1></td>";
 top_html+="</tr>"; 
 top_html+="<tr height=1>";
 top_html+="	<td width=2 colspan=2></td>";
 top_html+="	<td width=6 colspan=6 bgcolor='"+c+"'></td>";
 top_html+="	<td width=6 colspan=6 bgcolor='"+c+"'></td>";
 top_html+="	<td width=2 colspan=2></td>";
 top_html+="</tr>";
 top_html+="<tr height=1>";
 top_html+="	<td width=3 colspan=3></td>";
 top_html+="	<td width=5 colspan='5'  bgcolor='"+c+"'></td>";
 top_html+="	<td width=5 colspan='5'  bgcolor='"+c+"'></td>";
 top_html+="	<td width=3 colspan=3></td>";
 top_html+="</tr>";
 top_html+="<tr height=1>";
 top_html+="	<td width=4 colspan=4></td>";
 top_html+="	<td width=4 colspan=4 bgcolor='"+c+"'></td>";
 top_html+="	<td bgcolor='"+c+"' rowspan='2' width='"+w+"'></td>";
 top_html+="	<td width=4 colspan=4 bgcolor='"+c+"'></td>";
 top_html+="	<td width=4 colspan=4></td>";
 top_html+="</tr>";

 top_html+="<tr height=1>";
 top_html+="	<td colspan='6' width='6'></td>";
 top_html+="	<td width=2 colspan='2' bgcolor='"+c+"'></td>";

 top_html+="	<td width=2 colspan='2' bgcolor='"+c+"'></td>";
 top_html+="	<td width=6 colspan='6'></td>";
 top_html+="</tr>";

	top_html+="</table>";
 document.write(top_html);
}

function roundTable(objID) {
 var obj = document.getElementById(objID);
 var Parent, objTmp, Table, TBody, TR, TD;
 var bdcolor, bgcolor, Space;
 var trIDX, tdIDX, MAX;
 var styleWidth, styleHeight;

 // get parent node
 Parent = obj.parentNode;
 objTmp = document.createElement('SPAN');
 Parent.insertBefore(objTmp, obj);
 Parent.removeChild(obj);

 // get attribute
 bdcolor = obj.getAttribute('rborder');
 bgcolor = obj.getAttribute('rbgcolor');
 radius = parseInt(obj.getAttribute('radius'));
 if (radius == null || radius < 1) radius = 1;
 else if (radius > 6) radius = 6;

 MAX = radius * 2 + 1;
 
 /*
				create table {{
 */
 Table = document.createElement('TABLE');
 TBody = document.createElement('TBODY');

 Table.cellSpacing = 0;
 Table.cellPadding = 0;

 for (trIDX=0; trIDX < MAX; trIDX++) {
				TR = document.createElement('TR');
				Space = Math.abs(trIDX - parseInt(radius));
				for (tdIDX=0; tdIDX < MAX; tdIDX++) {
							 TD = document.createElement('TD');
							 
							 styleWidth = '1px'; styleHeight = '1px';
							 if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
							 else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
							 else if (radius > 2) {
											if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
											if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
							 }

							 if (styleWidth != null) TD.style.width = styleWidth;
							 if (styleHeight != null) TD.style.height = styleHeight;

							 if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
							 else if (tdIDX > Space && Space < MAX - tdIDX - 1)  TD.style.backgroundColor = bgcolor;
							 
							 if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
							 TR.appendChild(TD);
				}
				TBody.appendChild(TR);
 }

 /*
				}}
 */

 Table.appendChild(TBody);
 
 // insert table and remove original table
 Parent.insertBefore(Table, objTmp);
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}