// ¹öÆ°ÀÌ¹ÌÁö ÆäÀÌµå ÀÎ
function bt(id,after)
	{
		eval(id+'.src="'+after+'";');
	}

// ·¹ÀÌ¾î ÇÁ¸®ºä
function openImageLayerCenter(title,source){
    var imgElm=new Image();imgElm.src=source;
    var imageLayer=document.createElement("div");
    imageLayer.innerHTML="&nbsp;"+title;

    if(imgElm.complete){
        imageLayer.style.cssText="z-index;99999;position:absolute;top:"+(document.body.clientHeight-imgElm.height)/2+";left:"+(document.body.clientWidth-imgElm.width)/2+";width:"+imgElm.width+";height:"+imgElm.height+";cursor:hand;border:1px solid a571d6;padding:4 4 4 4;font:normal 7pt small fonts;color:white;background-color:7e34c4;";
    }else{
        imageLayer.style.cssText="z-index;99999;position:absolute;top:-4000;left:-4000;cursor:hand;border:1px solid a571d6;padding:0 0 0 0;font:normal 7pt small fonts;color:white;background-color:7e34c4;";
    }

    with(imageLayer.appendChild(document.createElement("div")))
    {
        style.cssText="padding:0 0 0 0;";
        with(appendChild(document.createElement("div")))
        {
            style.cssText="padding:5;background-color:white;";
            with(appendChild(document.createElement("img")))
            {
                src=source;
                if(!imgElm.complete){
                    onload=function(){//resize
                        with(this.parentNode.parentNode.parentNode.style){
                            left=(document.body.clientWidth-this.width)/2;
                            top=(document.body.clientHeight-this.height)/2;
                            width=this.width;
                            height=this.height;
                        }
                    };//onload
                }

                onclick=function(){//remove
                    var win=this.parentNode.parentNode.parentNode;
                    win.parentNode.removeChild(win);
                };//onclick
            }//with
        }//with
    }//with
    document.body.appendChild(imageLayer);
}

// Å×ÀÌºí ÆäÀÌµå È¿°ú
var tInC=null; 
var tIdC=null; 
var tIdCOn = new Array(0,0,0,0,0,0); 
var tIdCOff = new Array(1,1,1,1,1,1); 


function tBgFIn(obj, col,idNum) { 
    if(tInC != obj && tInC != null && tIdCOn[idNum] == 0) tBgFOut(tInC,tIdC); 
    if(tIdCOn[idNum] == 0) { 
        tIdCOn[idNum] = 1; 
        tIdCOff[idNum] = 0; 
        tInC=obj; 
        tIdC=idNum; 
        changeColor(obj, col); 
    } 
} 
function tBgFOut(obj,idNum) { 
    if(tIdCOff[idNum] == 0) { 
        tIdCOff[idNum] = 1; 
        tIdCOn[idNum] = 0; 
        changeColor(obj, ""); 
    } 
} 
function changeColor(obj, col) { 
    obj.filters.blendTrans.apply(); 
    obj.style.backgroundColor= col; 
    obj.filters.blendTrans.play(); 
} 

// ÀÌ¹ÌÁö°¶·¯¸® (ÆäÀÌµåÀÎ & ¾Æ¿ô)
var x =0
var y=0
    drag = 0
    move = 0
        window.document.onmousemove = mouseMove
        window.document.onmousedown = mouseDown
        window.document.onmouseup = mouseUp
        window.document.ondragstart = mouseStop

function ShowImg(file_name){
    var file_name;
        img_layer.filters.blendTrans.apply();
        img_layer.style.visibility = "visible";
        img_layer.filters.blendTrans.play();
        img_layer.innerHTML="<table cellpadding=0 cellspacing=0 border=0 onclick=HideImg()><tr><td style=cursor:hand;border-style:solid;border-color:a571d6;border-width:1px><img src=" + file_name + " border=0 alt='Å¬¸¯ÇÏ¸é ´ÝÈü´Ï´Ù'></td></tr></table>";
}

function HideImg() {
    img_layer.filters.blendTrans.apply();
    img_layer.style.visibility = "hidden";
    img_layer.filters.blendTrans.play();
}

function mouseUp() {
    move = 0
}

function mouseDown() {
    if (drag) {
        clickleft = window.event.x - parseInt(img_layer.style.left)
        clicktop = window.event.y - parseInt(img_layer.style.top)
        img_layer.style.zIndex += 1
        move = 1
    }
}

function mouseMove() {
    if (move) {
        img_layer.style.left = window.event.x - clickleft
        img_layer.style.top = window.event.y - clicktop
    }
}

function mouseStop() {
    window.event.returnValue = false
}


// ·¹ÀÌ¾î ÆäµåÀÎ ÆË¾÷
function togglePreview(viewPreview) {
    if (viewPreview.filters(0).status == 2) { 
        viewPreview.filters(0).Stop(); 
    if (viewPreview.style.visibility == "hidden") 
        viewPreview.style.visibility = "visible"; 
        else 
            viewPreview.style.visibility = "hidden"; 
            window.setTimeout("togglePreview()", 1); } 
            viewPreview.filters(0).Apply(); 
    if (viewPreview.style.visibility == "hidden") 
        viewPreview.style.visibility = "visible"; 
        else 
            viewPreview.style.visibility = "hidden"; 
            viewPreview.filters(0).Play(); } 

// ÇÁ¸°Æ®
function printthisimage(url) {
    var newwindow = window.open(url, "printsrc", "status=no,toolbar=no,scrollbars=no,resizable=no,menubar=no,width=20,height=20");
    newwindow.print()
    newwindow.blur()
}

// ¾ÆÀÌÇÁ·¹ÀÓ ½ºÅ©·Ñ
var x = 0;
var dest = 0;
var distance = 0;
var step = 0;
var destination = 0;

function scrollit(destination) {
    step = 10;
    dest = destination;
    if (x<dest) {
        while (x<dest) {
            step += (step / 2000);
            x += step;
    this.frames.iframe_scroll.scroll(x,0);
    } 
    this.frames.iframe_scroll.scroll(dest,0);
        x = dest;
}

    if (x > dest) {
        while (x>dest) {
            step += (step / 2000);
    if(x >= (0+step)) {
        x -= step; 
        this.frames.iframe_scroll.scroll(x,0);
        }
    else { break; }
    } 
    if(dest >= 0) { this.frames.iframe_scroll.scroll(dest,0); }
        x = dest;
    } 
    if (x<1) {x=1}
    if (x>4080) {x=3570} 
}

// ÆîÄ§¸Þ´º
var old_menu = '';
var old_cell = '';
function menuclick(submenu ,cellbar)
{
  if( old_menu != submenu ) {
    if( old_menu !='' ) {
      old_menu.style.display = 'none';
          old_cell.src= 'img/down.gif';     
    }
    submenu.style.display = 'block';
    cellbar.src = 'img/plus.gif';
    old_menu = submenu;
    old_cell = cellbar;
  } else {
    submenu.style.display = 'none';
    cellbar.src= 'img/down.gif';    
    old_menu = '';
    old_cell = '';
  }
}

var older_menu = '';
function pmenuclick(subme)
{
  if( old_menu != subme ) {
    if( older_menu !='' ) {
      older_menu.style.display = 'none';
    }
    subme.style.display = 'block';
    older_menu = subme;
  } else {
    subme.style.display = 'none';
    older_menu = '';
  }
}

// Å¬¸¯ »ç¿îµå
var soundfile="click.wav"   //»ç¿îµåÆÄÀÏ°æ·Î

function playsound(soundfile){
    if (document.all && document.getElementById){
        document.getElementById("soundeffect").src="" 
        document.getElementById("soundeffect").src=soundfile
    }
}

function bindsound(tag, soundfile, masterElement){
    if (!window.event) return
    var source=event.srcElement
    while (source!=masterElement && source.tagName!="HTML"){
    if (source.tagName==tag.toUpperCase()){
        playsound(soundfile)
    break
    }
    source=source.parentElement
    }
}

theObjects = document.getElementsByTagName("object"); 
for (var i = 0; i < theObjects.length; i++) { 
theObjects[i].outerHTML = theObjects[i].outerHTML; 
}
