<!--
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];}
}

/************************************
 ÇÔ¼ö¸í : asciilen
 ¿ë  µµ : ½ºÆ®¸µÀÇ ½Ç¹ÙÀÌÆ®¼ö ¸®ÅÏ
 ÀÎ  ¼ö : string
 °á°ú°ª : byte
 ÀÛ¼ºÀÚ : È²º´·Ï
 ±â  Å¸ : ÇÑ±Û:2,¿µ¼ýÀÚ:1·Î Length °è»ê
 *************************************/
function asciilen(strtemp){
    var i, len=0;
    for(i=0;i < strtemp.length; i++) (strtemp.charCodeAt(i) > 255)? len+=2:len++;
    return len;
}

function IsNumber(strtemp) {
    for(var i = 0; i < strtemp.length; i++) {
        var chr = strtemp.substr(i,1);
    //  alert(chr)
        if(chr < '0' || chr > '9') {
            return(false);
        }
    }
    return(true);
}

//------ ÇÑ±Û °Ë»ç ·çÆ¾
function isKorean(chr){
    chr = escape(chr);
    if(chr.charAt(1) == "u"){
        for(i = 0; i < chr.length; i++){
            chr = chr.substr(2, (chr.length - 1));
            if((chr.substr(i, i+1) < 'AC00') || (chr.substr(i, i+1) > 'D7A3')){
                return false;
            }
            else{
                return true;
            }
        }
    }
    else{
        return false;
    }
}

//------ ¼ýÀÚ¸¸ ÀÔ·Â (IE¿¡¼­¸¸ ÀÛµ¿)
function onlyNum(){
    if (navigator.userAgent.indexOf('MSIE') > 0) {
        if((event.keyCode < 48)||(event.keyCode >= 58)) event.returnValue = false;
    }
}

//------ ¿µ¹®ÀÚ¸¸ ÀÔ·Â (IE¿¡¼­¸¸ ÀÛµ¿)
function onlyAlphaNum(){
    if (navigator.userAgent.indexOf('MSIE') > 0) {
        if((event.keyCode >= 48  && event.keyCode <= 57) || (event.keyCode >= 97 && event.keyCode <= 122) || (event.keyCode >= 65 && event.keyCode <= 90 )) return;
        else{
            event.returnValue = false;
        }
    }
}

function chkTelNum(tel){
    var telNum = new String();
    telNum = tel;
    pat = /^[0-9]{2,4}-[0-9]{3,4}-[0-9]{4}$/;
    if(!telNum.match(pat)) {
        alert("¿Ã¹Ù¸£Áö ¾ÊÀº ÀüÈ­¹øÈ£ ÀÔ´Ï´Ù.'XXX-XXX-XXXX' Çü½ÄÀ¸·Î ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À");
        return false;
    } else return true;
}

function chkEmail(email){
    var pattern = /^(.+)@(.+)$/;
    var atom = "\[^\\s\\(\\)<>#@,;:!\\\\\\\"\\.\\[\\]\]+";
    var word="(" + atom + "|(\"[^\"]*\"))";
    var user_pattern = new RegExp("^" + word + "(\\." + word + ")*$");
    var ip_pattern = /^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
    var domain_pattern = new RegExp("^" + atom + "(\\." + atom +")*$");
    var arr = email.match(pattern);
    if (!arr) {
        alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. (check @ and .'s)");
        return false;
    }
    if (!arr[1].match(user_pattern)) {
        alert("¸ÞÀÏ ¾ÆÀÌµð°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
        return false;
    }
    var ip = arr[2].match(ip_pattern);
    if (ip) {
        for (var i=1; i<5; i++) {
            if (ip[i] > 255) {
                alert("¾ÆÀÌÇÇ ÁÖ¼Ò°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
                return false;
            }
        }
    } else {
        if (!arr[2].match(domain_pattern)) {
            alert("¿Ã¹Ù¸£Áö ¾ÊÀº µµ¸ÞÀÎ ÁÖ¼Ò ÀÔ´Ï´Ù.");
            return false;
        }
        var domain = arr[2].match(new RegExp(atom,"g"));
        if (domain.length<2) {
            alert("È£½ºÆ® ÀÌ¸§ÀÌ ¾ø½À´Ï´Ù.");
            return false;
        }
        if (domain[domain.length-1].length<2 || domain[domain.length-1].length>3) {
            alert("ÁÖ¼Ò´Â 3ÀÚ¸® µµ¸ÞÀÎÀÌ³ª 2ÀÚ¸®ÀÇ ±¹°¡´ëÇ¥ ¹®ÀÚ·Î ³¡³ª¾ß ÇÕ´Ï´Ù.");
            return false;
        }
    }
    return true;
}

//------ ºñ¹Ð¹øÈ£´Â ¿µ¹®´ë¼Ò¹®ÀÚ, ¼ýÀÚ, Æ¯¼ö¹®ÀÚ(~,!,@,#,$,%,^,&,*) ¸¸ Çã¿ë
function chkPasswdChar(str)
{
    //if ( str.length < 4 || str.length > 32 )
    if ( asciilen(str) < 4 || asciilen(str) > 32 ) {
        alert("ºñ¹Ð¹øÈ£´Â 4ÀÚÀÌ»ó 32ÀÚÀÌÇÏÀÇ ¿µ¹®ÀÚ, ¼ýÀÚ, Æ¯¼ö¹®ÀÚ(~,!,@,#,$,%,^,&,*)ÀÇ Á¶ÇÕÀÌ¾î¾ß ÇÕ´Ï´Ù.");
        return false;
    } else {
        for (var i = 0; i < str.length; i++) {
            var chr = str.substr(i,1);
            if ( (chr>='0' && chr<='9') || (chr>='a' && chr<='z') || (chr>='A' && chr<='Z')
                || chr=='~' || chr=='!' || chr=='@' || chr=='#' || chr=='$' || chr=='%' || chr=='^' || chr=='&' || chr=='*' ) continue;
            else {
                alert("ºñ¹Ð¹øÈ£´Â ¿µ¹®ÀÚ, ¼ýÀÚ, Æ¯¼ö¹®ÀÚ(~,!,@,#,$,%,^,&,*) ¸¸ÀÇ Á¶ÇÕÀÌ¾î¾ß ÇÕ´Ï´Ù.");
                return false;
            }
        }
    }
    return true;
}

function chkJumin(socno)
{
    var socnoStr = socno.toString();
    a = socnoStr.substring(0, 1);
    b = socnoStr.substring(1, 2);
    c = socnoStr.substring(2, 3);
    d = socnoStr.substring(3, 4);
    e = socnoStr.substring(4, 5);
    f = socnoStr.substring(5, 6);
    g = socnoStr.substring(6, 7);
    h = socnoStr.substring(7, 8);
    i = socnoStr.substring(8, 9);
    j = socnoStr.substring(9, 10);
    k = socnoStr.substring(10, 11);
    l = socnoStr.substring(11, 12);
    m = socnoStr.substring(12, 13);

    temp=a*2+b*3+c*4+d*5+e*6+f*7+g*8+h*9+i*2+j*3+k*4+l*5;
    temp=temp%11;
    temp=11-temp;
    temp=temp%10;

    if(temp == m)
    return true;
    else return false;
}


function number_format(number)
{
    unit = 3;
    i=0;
    rst='';
    number = number + '';
    len=number.length;
    arr=new Array(len);
    while(i <len){
        arr[i]=number.charAt(len-i-1);
        rst=arr[i]+rst;
        i++;
        if(i%unit==0 && i!=len){
            rst=','+rst;
        }
    }
    return rst;
}

function toggleFold(id){
    obj = document.all[id];
    obj.style.display = (obj.style.display == 'none')? '':'none';
}

var backName;
function toggleOneFolder(name){
    var listElement = document.all(name);

    if (listElement.style.display == ''){
        listElement.style.display = 'none';
    }else   {
        listElement.style.display = '';
    }

    var backE = document.all(backName);
    var backImgE = document.all('IMG_'+backName);

    if (backName != null && backName != name){
        backE.style.display = 'none';
    }

    if (name != backName) backName = name;
}

function hideObj(id){
    if(!id) return;
    else{
        obj = document.all[id];
        obj.style.display = 'none';
    }
}

//------ Ç³¼± µµ¿ì¸» ½ºÅ©¸³Æ®
function popUp(L, e){
        //¸¶¿ì½º À§Ä¡¿¡ Ãâ·Â ÇÔ¼ö
        if(n4) {
            var barron = document.layers[L]
        barron.left = e.pageX
        barron.top = e.pageY + 10
        barron.visibility = "visible"
        }
        else if(e4) {
            var barron = document.all[L]
                barron.style.pixelLeft = event.clientX + document.body.scrollLeft
                barron.style.pixelTop = event.clientY + document.body.scrollTop + 10
                barron.style.visibility = "visible"
        }
}

//------ ¸¶¿ì½º À§Ä¡¿¡ Ãâ·Â ÇÔ¼ö
function popUpStatic(L, e) {
        if(n4) {
            var barron = document.layers[L];
            barron.left = e.pageX ;
            barron.top = e.pageY + 10;
            barron.visibility = "visible";
        }
        else if(e4) {
            var barron = document.all[L];
                barron.style.pixelLeft = 800;
                barron.style.pixelTop = barron.style.pixelTop = event.clientY + document.body.scrollTop + 10;
                barron.style.visibility = "visible";
        }
}

function popDown2(L) {
        if(n4) {
            X = document.layers[L]
                barron_ID = setTimeout("clearTimeout(barron_ID); X.visibility = 'hidden'", 5)
        }
        else if(e4) {
            X = document.all[L]
            barron_ID = setTimeout("clearTimeout(barron_ID); X.style.visibility = 'hidden'", 800)
            //barron_ID = X.style.visibility = 'hidden';
        }
}

//------ checkbox¸¦ radio Ã³·³...20031205_587
function fncCheckBoxLikeRadio( frm, chboxnm, idx, defchk )
{
    var obj = eval(frm + "['" + chboxnm + "']");

    if ( obj.length > 1) {
        if (obj[idx].checked ) {
            for(var i=0; i< obj.length; i++) {
              if ( i != idx ) obj[i].checked = "";
            }
        } else {
          if (defchk) obj[0].checked = "checked";
        }
    }
}

function toClip(s)
{
    // ÇØ´ç ¿µ¿ªÀ» Å¬¸³º¸µå·Î º¹»çÇÕ´Ï´Ù.
    var clip = document.body.createTextRange();
    clip.moveToElementText(document.all(s));
    clip.select();
    clip.execCommand('copy');
    alert('Å¬¸³º¸µå¿¡ º¹»çµÇ¾ú½À´Ï´Ù');
}

function setBgColor(jobs, obj, onColor, glueColor)
{
    onColor = (onColor)? onColor: "#f6f6f6";
    glueColor = (glueColor)? glueColor: "#ffff00";
    if(jobs){
        switch(jobs){
            case "GLUE":
                obj.style.backgroundColor = (obj.style.backgroundColor == glueColor)? "":glueColor;
            break;
            case "ON":
                    obj.style.backgroundColor = (obj.style.backgroundColor == glueColor)? glueColor: onColor;
            break;
            case "OUT":
                    obj.style.backgroundColor = (obj.style.backgroundColor == glueColor)? glueColor: "";
            break;
        }
    }
}

function popImage(imgnm,imgsrc)
{
    var oURL = "/_pop_imageview.php?imgname="+imgnm+"&imgpath="+imgsrc;
    window.open(oURL, "Imgwin", "width=300,height=400,scrollbars=yes,resizable=yes,status=no");
}

function lostFocus()
{
    if(event.srcElement.tagName == 'A' || event.srcElement.tagName == 'IMG') {
        document.body.focus();
    }
}
document.onfocusin = lostFocus;

var idxpopup = new Array();
function openIdxPopup(idx, url)
{
    if (!url) return false;
    if (!idx) idx=0;
    if (idxpopup[idx] != null) {
        idxpopup[idx].close();
        idxpopup[idx] = window.open(url,"idxPop_"+idx,"width=400,height=450,status=yes,resizable=yes");
    }else{
        idxpopup[idx] = window.open(url,"idxPop_"+idx,"width=400,height=450,status=yes,resizable=yes");
    }
    idxpopup[idx].focus();
}


function viewEmbedObj (objHTML)
{
    document.write(objHTML);
}

function getEmbedTags(flashSrc, objWidth, objHeight, etcParam) {
	var tag = "";
	var baseFlashDir="";
	flashSrc = baseFlashDir + flashSrc;

	if ( etcParam != "" || etcParam != null ) {
		if ( etcParam.substr(0, 1) == "?" )
			flashSrc += etcParam;
		else
			flashSrc += "?" + etcParam;
	}

	tag += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
	tag += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" ";
	tag += "width=\"" + objWidth + "\" height=\"" + objHeight + "\">";
	tag += "<param name=\"movie\" value=\"" + flashSrc + "\">";
	tag += "<param name=\"menu\" value=\"false\">";
	tag += "<param name=\"quality\" value=\"high\">";
	tag += "<param name=\"wmode\" value=\"transparent\">";
	tag += "<embed src=\"" + flashSrc + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
	tag += "type=\"application/x-shockwave-flash\" width=\"" + objWidth + "\" height=\"" + objHeight + "\" ";
	tag += "wmode=\"transparent\"></embed>";
	tag += "</object>";

	document.write(tag);
}

function getMovieTag(movieSrc, objWidth, objHeight) {
	var tag = "";
	var baseFlashDir="";
	movieSrc = baseFlashDir + movieSrc;
	
	tag += "<EMBED src=\"" + movieSrc + "\" width=\"" + objWidth + "\" height=\"" + objHeight + "\" autostart=\"true\">";

	document.write(tag);
}
//-->

