var IE = false ;
if (window.navigator.appName.indexOf("Explorer") !=-1) IE = true;
function roundTableNew(targetObjID, roundType)
{
	var attrsRound1 = getSytleAttributes("round1");
	var attrsRound2 = getSytleAttributes("round2");
	var attrsRound3 = getSytleAttributes("round3");
	var attrsRound4 = getSytleAttributes("round4");
	var attrsRound5 = getSytleAttributes("round5");

	var rborder1 = '';	// round1의 rborder색.
	var rbgcolor1 = '';	// round1의 rbgcolor색.
	var rborder2 = '';	// round2의 rborder색.
	var rbgcolor2 = '';	// round2의 rbgcolor색.
	var rborder5 = '';	// round5의 rborder색.
	var rbgcolor5 = '#ffffff';	// round5의 rbgcolor색.

	if(attrsRound1!=null && attrsRound2)
	{
		rborder1 = attrsRound1[1];	// round1의 rborder색.
		rbgcolor1 = attrsRound1[2];	// round1의 rbgcolor색.
		rborder2 = attrsRound2[1];	// round2의 rborder색.
		rbgcolor2 = attrsRound2[2];	// round2의 rbgcolor색.
		rborder5 = attrsRound5[1];	// round5의 rborder색.
		rbgcolor5 = attrsRound5[2];	// round5의 rbgcolor색.
	}else{
		rborder1 = "";	// round1의 rborder색.
		rbgcolor1 = "";	// round1의 rbgcolor색.
		rborder2 = "";	// round2의 rborder색.
		rbgcolor2 = "";	// round2의 rbgcolor색.
		rborder5 = "#ffffff";	// round5의 rborder색.
		rbgcolor5 = "#FFFFFF";	// round5의 rbgcolor색.
	}

	var obj = null;

	if(roundType!=null && 
			(roundType=='round1'||roundType=='round2'||roundType=='round3'||roundType=='round4'))
	{
		obj = document.getElementById(targetObjID);
		roundTableNewSub(obj, rborder1, rborder2, rbgcolor2);
	}else{
		obj = document.getElementById(targetObjID);
		roundTableNewSub(obj, rborder5, rbgcolor5, rbgcolor5);
	}
}

function roundTableNewSub(objDiv, rgb1, rgb2, rgb3)
{
	var objDivWidth = parseInt( (objDiv.style.width) ? objDiv.style.width : objDiv.scrollWidth+"px" );
	var objDivHTML = objDiv.innerHTML;

	var roundBox = "";
	roundBox += "<table width="+objDivWidth+" border=0 cellpadding=0 cellspacing=0><tr><td valign=top align=center>";
	roundBox += "";
	roundBox += "	<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "	<tr><td width=2></td><td width="+(objDivWidth-4)+" bgcolor="+rgb1+"></td><td width=2></td></tr></table>";
	roundBox += "";
	roundBox += "	<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "	<tr><td width=1></td><td width="+(objDivWidth-2)+" bgcolor="+rgb1+"></td><td width=1></td></tr></table>";
	roundBox += "";
	roundBox += "	<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "	<tr><td width="+(objDivWidth-0)+" bgcolor="+rgb1+"></td></tr></table>";
	roundBox += "";
	roundBox += "	<table border=0 cellpadding=0 cellspacing=0>";
	roundBox += "	<tr><td width=3 bgcolor="+rgb1+"></td>";
	roundBox += "		<td width="+(objDivWidth-6)+" bgcolor="+rgb1+">";
	roundBox += "";
	roundBox += "			<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "			<tr><td width=2 bgcolor="+rgb1+"></td><td width="+(objDivWidth-10)+" bgcolor="+rgb2+"></td>";
	roundBox += "				<td width=2 bgcolor="+rgb1+"></td></tr></table>";
	roundBox += "";
	roundBox += "			<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "			<tr><td width=1 bgcolor="+rgb1+"></td>";
	roundBox += "				<td width=1 bgcolor="+rgb2+"></td>";
	roundBox += "				<td width="+(objDivWidth-10)+" bgcolor="+rgb3+"></td>";
	roundBox += "				<td width=1 bgcolor="+rgb2+"></td>";
	roundBox += "				<td width=1 bgcolor="+rgb1+"></td></tr></table>";
	roundBox += "";
	roundBox += "			<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "			<tr><td width=1 bgcolor="+rgb2+"></td><td width="+(objDivWidth-8)+" bgcolor="+rgb3+">";
	roundBox += "";
	roundBox += objDivHTML;
	roundBox += "";
	roundBox += "			</td><td width=1 bgcolor="+rgb2+"></td></tr></table>";
	roundBox += "";
	roundBox += "			<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "			<tr><td width=1 bgcolor="+rgb1+"></td>";
	roundBox += "				<td width=1 bgcolor="+rgb2+"></td>";
	roundBox += "				<td width="+(objDivWidth-10)+" bgcolor="+rgb3+"></td>";
	roundBox += "				<td width=1 bgcolor="+rgb2+"></td>";
	roundBox += "				<td width=1 bgcolor="+rgb1+"></td></tr></table>";
	roundBox += "";
	roundBox += "			<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "			<tr><td width=2 bgcolor="+rgb1+"></td><td width="+(objDivWidth-10)+" bgcolor="+rgb2+"></td>";
	roundBox += "				<td width=2 bgcolor="+rgb1+"></td></tr></table>";
	roundBox += "";
	roundBox += "		</td>";
	roundBox += "		<td width=3 bgcolor="+rgb1+"></td>";
	roundBox += "	</tr></table>";
	roundBox += "";
	roundBox += "	<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "	<tr><td width="+(objDivWidth-0)+" bgcolor="+rgb1+"></td></tr></table>";
	roundBox += "";
	roundBox += "	<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "	<tr><td width=1></td><td width="+(objDivWidth-2)+" bgcolor="+rgb1+"></td><td width=1></td></tr></table>";
	roundBox += "";
	roundBox += "	<table border=0 cellpadding=0 cellspacing=0 height=1>";
	roundBox += "	<tr><td width=2></td><td width="+(objDivWidth-4)+" bgcolor="+rgb1+"></td><td width=2></td></tr></table>";
	roundBox += "";
	roundBox += "</td></tr></table>";

	objDiv.innerHTML = roundBox;
}

function getSytleAttributes(objID){

	var rets = new Array("","","");
	if(!IE)	{
		rets[0]=2;
		rets[1]='FFFFFF';
		rets[2]='FFFFFF';   

	}
	else
	{
		for(var i=0;i<document.styleSheets.length;i++ ){
			var styleRules = document.styleSheets(i).rules;
			for(var j=0;j<styleRules.length;j++){
				var styleId = styleRules.item(j).selectorText;
				if(styleId != null && styleId != "undefined" && styleId == objID){
					var radius = 2;
					var rborder = styleRules.item(j).style.rborder;
					var rbgcolor = styleRules.item(j).style.rbgcolor;
					rets[0]=radius;
					rets[1]=rborder;
					rets[2]=rbgcolor;

					break;
				}
			}
		}
	}

	return rets;
}
