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 ImgRestore() { //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_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 Imgover() { //v3.0
  var i,j=0,x,a=Imgover.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];}
}

/*
//insert_select(ÀúÀåº¯¼ö¸í,°¡·Î,ÆùÆ®Å©±â,º¸µå»ö,¹è°æ»ö,¼±ÅÃ»ö,È­»ìÇ¥ÀÌ¹ÌÁö,onchangeÀÌº¥Æ®-ÇÔ¼ö·Î¼³Á¤);
//insert_select_option(ÀúÀåº¯¼ö¸í,ÆùÆ®Å©±â,º¸µå»ö,¹è°æ»ö,¼±ÅÃ»ö,value,view_value,ÃÊ±â¼±ÅÃ¿©ºÎ:(Y¼±ÅÃ);
*/

var zindex = 10000;
select_count = new Array();
ev_click	 = new Array();

function insert_select ( sn,w,f,b,g,c,img,event) {
	ev_click[sn]	= event;
	select_count[sn] = 0;
	zindex--;
	document.write("<input type=hidden name="+sn+" id="+sn+" value=''>");
	document.write("	<table border='0' cellspacing='1' cellpadding='1' width='"+w+"'  style='table-layout:fixed;width:"+w+";' bgcolor='"+b+"' onclick='select_click(\""+sn+"\");' >");
	document.write("	<tr>");
	document.write("		<td bgcolor='"+g+"'>");
	document.write("			<input type='text' id='"+sn+"_select_name' name='"+sn+"_select_name' style='border:none;cursor:hand;width:100%;font-size:"+f+"pt;' onselectstart=\"return false\" readonly> ");
	document.write("		</td>");
	if(img != "") {
		document.write("	<td width=18 bgcolor='"+g+"' align=center valign=bottom style='cursor:hand'><img src='"+img+"' align='absmiddle'></td>");		
	} else {
		document.write("	<td width=18 bgcolor='"+g+"' align=center valign=bottom style='cursor:hand'>v</td>");
	}
	document.write("	</tr>");
	document.write("	</table>");

	document.write("<div id='"+sn+"_select_div' name='"+sn+"_select_div'  style='display:none;z-index:"+zindex+";position:absolute;cursor:hand'  onmouseover='"+sn+"_select_div.style.display=\"\";' onmouseout='"+sn+"_select_div.style.display=\"none\";'>");
	document.write("		<table border='0' cellspacing='1' cellpadding='1' bgcolor='"+b+"' width="+w+" onmouseover='"+sn+"_select_div.style.display=\"\";'>");
	document.write("		<tr><td bgcolor='"+g+"' style='line-height:1.3em;' id='"+sn+"_select_span'></td></tr>");
	document.write("		</table>");
	document.write("	</div>");
}

function insert_select_option(sn,f,b,g,c,v,vv,chk)	 {	
	select_count[sn] ++;	

	onevent = "";
	if(ev_click[sn] != null)	{
		onevent = ev_click[sn] + "( document.all."+sn+" );";
	}

	option_html = "<span style='width:100%;font-size:"+f+"pt' onclick='"+sn+"_select_name.value=\""+vv+"\";"+sn+".value=\""+v+"\";"+sn+"_select_div.style.display=\"none\";"+onevent+";"+"' onmouseover='this.style.background=\""+c+"\"' onmouseout='this.style.background=\""+g+"\"'>"+vv+"</span><br>";

	if(select_count[sn] == 1 || chk == "Y" ) {
		document.getElementById( sn+"_select_name" ).value = vv;
		document.getElementById( sn ).value = v;
	}
	document.getElementById( sn+"_select_span").innerHTML += option_html;
}

function  select_click(sn)	 {	
	if ( document.getElementById( sn+"_select_div").style.display == "none") {
		document.getElementById( sn+"_select_div").style.display = "";
	} else {
		document.getElementById( sn+"_select_div").style.display = "none";
	}
}

function bbs_line(id,option)	{
	table = eval(id)
	table.style.background = option
}

function m_view(yn,num)	{
	for(i = 0 ; i < tm.length ; i++)	{
		if( i == (num-1) && yn == 'Y')	tm[i].style.display="";
		else										tm[i].style.display="none";
	}
	
}

function mylife_view(mode,slt)	{	

	if (mode=='0')  mode = '';
	if (slt=='0')   slt = '';
	f_action = "http://enjoyzone.ilikeclick.com/popup_fortune_result.html?ec=20127061&type=1&mode="+ mode +"&slt="+ slt;

	var width       = 600;
	var height      = 568 + parseInt(20);
	var left        = (screen.width) ? (screen.width-width)/2 : 0;
	var top         = (screen.height) ? (screen.height-height)/2 : 0;
	var position    = 'top='+top+',left='+left+',width='+width+',height='+height+',resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no';
	var popup       = window.open(f_action,'fortune_result',position);
	popup.focus();

}


document_info = new Array();
function Scroll_init(name,value, table_size,view_cnt,border,border_color,beside) {
	obj = eval(name);
	obj.style.width = table_size;
	document_info[name] = Array(name, value, table_size, view_cnt, border, border_color, beside) 
	document_info[name]["Move"] = Math.floor( Math.random()* value.length);
	Scroll_move(name)
}

function Scroll_move(name,move){
	docuement_view_div = eval( document_info[name][0] );
	docuement_view_img = eval( document_info[name][1] );

	if(move == "left" || move == "up")		document_info[name]["Move"] --;
	if(move == "right" || move == "down")	document_info[name]["Move"] ++;


	var cnt_start	= document_info[name][3] * document_info[name]["Move"]
	var cnt_end	= document_info[name][3] * (document_info[name]["Move"]+1);
	
	HTML = "<table border='0' cellspacing='0' cellpadding='0' style='table-layout:fixed'><tr>";
	for( i = cnt_start ; i < cnt_end ; i++ ){
		if( i < 0 )	tmp_cnt = (Math.abs(docuement_view_img.length*document_info[name]["Move"]) +  i) % docuement_view_img.length 
		else			tmp_cnt = i % docuement_view_img.length
		on_event = docuement_view_img[tmp_cnt][2].replace(/[\']/gi , "\""); 
		if( document_info[name][4] > 0 )	img_besize = 4
		else											img_besize = 0
		HTML += "<td width='"+(parseInt(docuement_view_img[tmp_cnt][3],10)+img_besize)+"' valign=top>";
		HTML += "	<table border='0' cellspacing='0' cellpadding='0' style='text-align:center;table-layout:fixed' >";
		HTML += "	<tr><td style='border:"+document_info[name][4]+"px "+document_info[name][5]+" solid' onclick='"+on_event+";'><img src='"+docuement_view_img[tmp_cnt][0]+"' style='cursor:pointer;width:"+docuement_view_img[tmp_cnt][3]+";height:"+docuement_view_img[tmp_cnt][4]+";'></td></tr>";
		if(docuement_view_img[tmp_cnt][1] != "")	{
			HTML += "	<tr><td style='padding:8 0 5 0'><a href='javascript:"+on_event+"' class='b_black'>"+docuement_view_img[tmp_cnt][1]+"</a></td></tr>";
		}
		HTML += "	</table>";
		HTML += "</td>"

		if(i < cnt_end -1)	HTML += "<td width="+document_info[name][6]+"></td>";
	}
	HTML += "</tr></table>";

	docuement_view_div.innerHTML = HTML;
}


function banner_reload( target, ext_crt, banner_Type ,Width, Height, Banner_IMG) {
	Bobj = eval(target);
	ext = banner_Type[0].substr( ext_crt + 1);

	if( ext.toLowerCase() == "swf")	 {
		openflash_SEC(Bobj, Width, Height, Banner_IMG + banner_Type[0] );
	} else {
		if(banner_Type[0][2] == "_pop")	{
			click_banner = "window.open(\"http://"+banner_Type[1]+"\",\""+banner_Type[2]+"\",\"width="+banner_Type[3]+",height="+banner_Type[4]+"\");";
		} else {
			click_banner = "window.open(\"http://"+banner_Type[1]+"\",\""+banner_Type[2]+"\");";
		}
		inner_Value = "<img src='"+Banner_IMG+banner_Type[0]+"' border=0 style='cursor:pointer' align='absmiddle' onclick='"+click_banner+"'>";
		Bobj.innerHTML = inner_Value;
	}
}