function MM_findObj(n) { //v4.01
  var p,i,x;  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;
}

/*Display Table*/
function showHideTables() { //v6.0
  var i,p,v,obj,args=showHideTables.arguments;
  for (i=0; i<(args.length-1); i+=2) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+1];
    if (obj.style) { obj=obj.style; v=(v=='block')?'block':(v=='none')?'none':v; }
    obj.display=v; }
}
/*Display Table*/

/*Rounding Table*/
function roundTable(t_objID) {
   var t_obj = document.getElementById(t_objID);
   var t_Parent, t_objTmp, t_Table, t_TBody, TR, TD;
   var bdcolor, bgcolor, Space, brimg;
   var trIDX, tdIDX, MAX;
   var styleWidth, styleHeight;

   t_Parent = t_obj.parentNode;
   t_objTmp = document.createElement('SPAN');
   t_Parent.insertBefore(t_objTmp, t_obj);
   t_Parent.removeChild(t_obj);

   bdcolor = t_obj.getAttribute('rborder');
   bgcolor = t_obj.getAttribute('rbgcolor');
   brimg = t_obj.getAttribute('br');
   radius = parseInt(t_obj.getAttribute('radius'));
   if (radius == null || radius < 1) radius = 1;
   else if (radius > 6) radius = 6;

   MAX = radius * 2 + 1;

   t_Table = document.createElement('TABLE');
   t_TBody = document.createElement('TBODY');

   t_Table.cellSpacing = 0;
   t_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(t_obj);
                 TR.appendChild(TD);
          }
          t_TBody.appendChild(TR);
   }
   t_Table.appendChild(t_TBody);
   t_Parent.insertBefore(t_Table, t_objTmp);
}
/*Rounding Table*/

/*Animation Text*/
col = new Array();
col[0]="111111";
col[1]="333333";
col[2]="555555";
col[3]="777777";
col[4]="999999";
col[5]="AAAAAA";
col[6]="CCCCCC";
col[7]="CCCCCC";
col[8]="CCCCCC";
col[9]="AAAAAA";
col[10]="999999";
col[11]="777777";
col[12]="555555";
col[13]="333333";
col[14]="111111";
col[15]="000000";

i_col=0;
doani=1;
var timer;
var thislink;
function animatelink() {
    if (document.all) {
        if (doani==1) {
            if (i_col<=col.length-1) {
                thislink.color=col[i_col]
                i_col++
                timer=setTimeout("animatelink()",100)
            }
            else {
                i_col=0
                timer=setTimeout("animatelink()",100)
            }
        }
        else {
            clearTimeout(timer)
        }
    }
}
function stopanimation() {
    clearTimeout(timer)
    thislink.color="000000"
    doani=0
}    
function startanimation(mylink) {
    clearTimeout(timer)
    thislink=eval("document.all."+mylink+".style")
    doani=1
    animatelink()
}  
/*Animation Text*/	

/*Change Class*/
function change_Class(i,class_name){
	i.className=class_name;
}
/*Change Class*/

/*overImages*/
function change_IMG(target,img){
	target.src=img;
}
/*overImages*/

//flash
function flash_contents(file,width,height){
document.writeln("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='"+width+"' HEIGHT='"+height+"' id='contents' ALIGN=''>");
document.writeln("<PARAM NAME=movie value='"+file+"' />");
document.writeln("<PARAM NAME=quality VALUE=high>");
document.writeln("<PARAM NAME=bgcolor VALUE=#FFFFFF>");
document.writeln("<PARAM NAME=wmode VALUE=transparent> ");
document.writeln("<embed src='"+file+"' wmode='transparent' quality='high' bgcolor='#FFFFFF' width='"+width+"' height='"+height+"' name='contents' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
document.writeln("</OBJECT>");
}



//TV_AD_MEDIA___
function tv_adplay(file,w,h,mediaName) {
document.write('<object id="'+mediaName+'" name=id="'+mediaName+'" width='+w+' height='+h+' classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,05,0809" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" VIEWASTEXT>')
document.write('<param name="transparentAtStart" value="True">')
document.write('<param name="transparentAtStop" value="False">')
document.write('<param name="AnimationAtStart" value="0">')
document.write('<param name="Loop" value="true">')
document.write('<param name="AutoStart" value="0">')
document.write('<param name="AutoRewind" value="true">')
document.write('<param name="SendMouseClickEvents" value="True">')
document.write('<param name="DisplaySize" value="0">')
document.write('<param name="AutoSize" value="False">')
document.write('<param name="ShowDisplay" value="False">')
document.write('<param name="ShowControls" value="False">')
document.write('<param name="ShowTracker" value="True">')
document.write('<param name="FileName" value="'+file+'">')
document.write('<param name="Enabled" value="1">')
document.write('<param name="EnableContextMenu" value="1">')
document.write('<param name="EnablePositionControls" value="1">')
document.write('<param name="EnableFullScreenControls" value="1">')
document.write('<param name="ShowPositionControls" value="1">')
document.write('<param name="Mute" value="0">')
document.write('<param name="Rate" value="1">')
document.write('<param name="SAMILang" value="">')
document.write('<param name="SAMIStyle" value="">')
document.write('<param name="SAMIFileName" value="">')
document.write('<param name="ClickToPlay" value="0">')
document.write('<param name="CursorType" value="1">')
document.write('<embed src="'+file+'"   id="'+mediaName+'" Loop=true  quality=high menu="false" bgcolor=#FFFFFF  WIDTH="'+w+'" HEIGHT="'+h+'" autoplay=true controller=true loop=false type="application/x-oleobject"></embed></object>')
} 
//--------------------------------------------------------------

function show_table(num) {
	switch(num) {
		case "1-1" : showHideTables('tab_01','block','tab_02','none','tab_03','none','tab_04','none'); break;
		case "1-2" : showHideTables('tab_01','none','tab_02','block','tab_03','none','tab_04','none'); break;
		case "1-3" : showHideTables('tab_01','none','tab_02','none','tab_03','block','tab_04','none'); break;
		case "1-4" : showHideTables('tab_01','none','tab_02','none','tab_03','none','tab_04','block'); break;

		case "2-1" : showHideTables('tab_01','block','tab_02','none','tab_03','none','tab_04','none','tab_05','none','tab_06','none'); break;
		case "2-2" : showHideTables('tab_01','none','tab_02','block','tab_03','none','tab_04','none','tab_05','none','tab_06','none'); break;
		case "2-3" : showHideTables('tab_01','none','tab_02','none','tab_03','block','tab_04','none','tab_05','none','tab_06','none'); break;
		case "2-4" : showHideTables('tab_01','none','tab_02','none','tab_03','none','tab_04','block','tab_05','none','tab_06','none'); break;
		case "2-5" : showHideTables('tab_01','none','tab_02','none','tab_03','none','tab_04','none','tab_05','block','tab_06','none'); break;
		case "2-6" : showHideTables('tab_01','none','tab_02','none','tab_03','none','tab_04','none','tab_05','none','tab_06','block'); break;
	}
}

function change_id_IMG(target,img){
	document.getElementById(target).src=img;
}

//°Ô½Ã¹° ¸µÅ©
function Go_url(url,action,sel_uid){
	location.href=url+"?"+"action="+action+"&sel_uid="+sel_uid;
}

function busi_pop(uid) {
	window.open('popup.php?uid='+uid,'detail_view','scrollbars=no,status=yes,width=660,height=473,top=100,left=300');
}
function open_move_win(name){
 	var url='http://www.okfk.com/movie.php?name='+name;
 	window.open(url,"_mini_","width=390,height=510,status=no,resizable=no,menubar=no");
}
