function setCookie(name, value, expiredays) 
{ 
    var todayDate = new Date();

    todayDate.setDate( todayDate.getDate() + expiredays );
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";
} 

function getCookie(name)
{
    var nameOfCookie = name + "=";
    var returnValue = "";
    var x = 0;

    while ( x <= document.cookie.length )
    {
        var y = (x+nameOfCookie.length);
        if ( document.cookie.substring( x, y ) == nameOfCookie ) {
            if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                endOfCookie = document.cookie.length;
            returnValue = unescape( document.cookie.substring( y, endOfCookie ) );
        }
        x = document.cookie.indexOf( " ", x ) + 1;
        if ( x == 0 )
        break;
    }

    return returnValue;
}

function objSelectMemberLevel(arr,mb_ulv)
{
    var level = new Array(arr);
    //var level = arr;
    var len = level.length;

    for( var i in level )
    {
        document.write("key=<em>"+i+"</em><br>");
    }
//      alert(SelectMemberLevel[0].Key);
//    foreach( SelectMemberLevel as key=>value  ) { document.write('<option value="'+key+'">'+value+'</option>'); }
}

function setTel(telnum,nullValue)
{
    var valid  = '0123456789';
    var setTel = '';
    var telLen = telnum.length;
    nullValue = nullValue ? nullValue : '';

    if(telnum){
        for(var i=0 ; i<telLen ; i++)
        {
            var setTmp = telnum.substring(i,i+1);
            if (valid.indexOf(setTmp) == "-1") setTel = setTel ; else setTel += setTmp;
        }
    }else{
        setTel = nullValue;
    }

    return setTel;
}

function getNumber(number,nullValue)
{
    var valid  = '0123456789';
    var setTel = '';
    var numberLen = number.length;
    nullValue = nullValue ? nullValue : '';

    if(number){
        var j = numberLen % 3;
       // j = numberLen - j;
        for(var i=0 ; i<numberLen ; i++)
        {
            if(j<3) { if(j%3<=0) { j=3; setTel += setTel ? ',' : '' ; } j--; } 
            var setTmp = number.substring(i,i+1);
            if (valid.indexOf(setTmp) == "-1") setTel = setTel ; else setTel += setTmp;
        }
    }else{
        setTel = nullValue;
    }

    return setTel;
}

function setNumber(number,nullValue)
{
    var valid  = '0123456789';
    var setTel = '';
    var numberLen = number.length;
    nullValue = nullValue ? nullValue : '';

    if(number){
        for(var i=0 ; i<numberLen ; i++)
        {
            var setTmp = number.substring(i,i+1);
            if (valid.indexOf(setTmp) == "-1") setTel = setTel ; else setTel += setTmp;
        }
    }else{
        setTel = nullValue;
    }

    return setTel;
}

function getTel(telnum,nullValue)
{
    var getTel = '';
    nullValue = nullValue ? nullValue : '';

    if(telnum)
    {
        var tel = new Array(3);
        var telLen = telnum.length;

        if(telnum.substring(0,2)=='02'){
            tel[0]      = telnum.substring(0,2);
            telMore     = telnum.substring(2,telLen);
        }else if(telnum.substring(0,4)=='0130'){
            tel[0]      = telnum.substring(0,4);
            telMore     = telnum.substring(4,telLen);
        }else{
            tel[0]      = telnum.substring(0,3);
            telMore     = telnum.substring(3,telLen);
        }

        var telMoreLen  = telMore.length;
        tel[1]          = telMore.substring(0,telMoreLen-4);
        tel[2]          = telMore.substring(telMoreLen-4,telMoreLen);

        for(var i=0 ; i<3 ; i++)
        {
            getTel += getTel ? '-'+tel[i] : tel[i];
        }
    }
    else
    {
        nullValue = nullValue ? nullValue : '';
        getTel = nullValue;
    }

    return getTel;
}

function writeTel(telnum,nullValue)
{
    nullValue = nullValue ? nullValue : '';

    document.write(getTel(telnum,nullValue));
}

function setRrn(rrnNum,nullValue)
{
    var valid  = '0123456789';
    var format = '######-########';
    var setRrn = '';
    var formatLen = format.length;
    var rrnNumLen = rrnNum.length;
    nullValue = nullValue ? nullValue : '';

    if(rrnNum){

        for(var i=0 ; i<formatLen ; i++)
        {
            var fmtTmp = format.substring(i,i+1);
            var setTmp = rrnNum.substring(i,i+1);

            if( fmtTmp!='#' ){ setTmp += fmtTmp; }
            if( valid.indexOf(setTmp)=='-1' ) setRrn = setRrn ; else setRrn += setTmp;
        }

    }else{
        setRrn = nullValue;
    }

    return setRrn;
}

function getRrn(rrnNum,nullValue)
{
    var getRrn = '';
    nullValue = nullValue ? nullValue : '';

    if(rrnNum)
    {
        var rrn = new Array(2);
        var rrnLen = rrnNum.length;
        var rrnCnt = rrn.length;

        rrn[0] = rrnNum.substring(0,6);
        rrn[1] = rrnNum.substring(6,rrnLen);

        for(var i=0 ; i<rrnCnt ; i++)
        {
            getRrn += getRrn ? '-'+rrn[i] : rrn[i];
        }
    }
    else
    {
        nullValue = nullValue ? nullValue : '';
        getRrn = nullValue;
    }

    return getRrn;
}

function writeRrn(rrnNum,nullValue)
{
    nullValue = nullValue ? nullValue : '';

    document.write(getRrn(rrnNum,nullValue));
}

function getCard(cardNum,nullValue)
{
    var getCard = '';
    nullValue = nullValue ? nullValue : '';

    getCardTmp = getNumber(cardNum,nullValue);

    for(var i=0 ; i<4 ; i++){
        getCard += getCard ? '-'+substring(getCardTmp,i*4,4) : substring(getCardTmp,i*4,4);
    }

    return $getCard;
}

function getPost(zipCode,nullValue)
{
    var getZip = '';
    nullValue = nullValue ? nullValue : '';

    if(zipCode)
    {
        var zip = new Array(2);
        var zipLen = zipCode.length;

        zip[0] = zipCode.substring(0,3);
        zip[1] = zipCode.substring(3,zipLen);
        getZip = zip[0]+'-'+zip[1];
    }
    else
    {
        nullValue = nullValue ? nullValue : '';
        getZip = nullValue;
    }

    return getZip;
}

function getZip(zipCode,nullValue)
{
    var getZip = '';
    nullValue = nullValue ? nullValue : '';

    if(zipCode)
    {
        var zip = new Array(2);
        var zipLen = zipCode.length;

        zip[0] = zipCode.substring(0,3);
        zip[1] = zipCode.substring(3,zipLen);
        getZip = zip[0]+'-'+zip[1];
    }
    else
    {
        nullValue = nullValue ? nullValue : '';
        getZip = nullValue;
    }

    return getZip;
}

function setPost(zipCode,nullValue)
{
    nullValue = nullValue ? nullValue : '';
    var writeZip = '';
    var zip = new Array(2);

    zip = zipCode.split('-');

    for(var i=0 ; i<zip.length ; i++)
    {
        writeZip += zip[i];
    }
    return writeZip;
}

function setZip(zipCode,nullValue)
{
    nullValue = nullValue ? nullValue : '';
    var writeZip = '';
    var zip = new Array(2);

    zip = zipCode.split('-');

    for(var i=0 ; i<zip.length ; i++)
    {
        writeZip += zip[i];
    }
    return writeZip;
}

function writeZip(zipCode,nullValue)
{
    nullValue = nullValue ? nullValue : '';
    var writeZip = '';
    var zip = new Array(2);

    zip = getZip(zipCode,nullValue);
    var zipCnt = zip.length;

    for(var i=0 ; i<zipCnt ; i++)
    {
        writeZip += writeZip ? '-'+zip[i] : zip[i];
    }
    document.write(writeZip);
}

function getDateFull(dateFull,ch,nullValue)
{
    var getDateFull = '';
    nullValue = nullValue ? nullValue : '';

    if(dateFull)
    {
        var date = new Array(6);
        var dateLen = dateFull.length;

        date[0] = dateFull.substring(0,4);
        date[1] = dateFull.substring(5,7);
        date[2] = dateFull.substring(8,10);
        date[3] = dateFull.substring(11,13);
        date[4] = dateFull.substring(14,16);
        date[5] = dateFull.substring(17,dateLen);
        getDateFull = date;

        switch(ch)
        {
            case 'date' : {
                getDateFull = date[0]+'.'+date[1]+'.'+date[2];
            } break;
            case 'time' : {
                getDateFull = date[3]+':'+date[4];
            } break;
            case 'full' : {
                getDateFull = date[0]+'.'+date[1]+'.'+date[2]+' ['+date[3]+':'+date[4]+']';
            } break;
            default : writeDataFull = '';
        }
    }
    else
    {
        getDateFull = nullValue;
    }

    return getDateFull;
}

function writeDateFull(dateFull,ch,nullValue)
{
    nullValue = nullValue ? nullValue : '';
    var writeDateFull = '';
    var date = new Array(6);

    writeDataFull = getDateFull(dateFull,ch,nullValue);

    document.write(writeDataFull);
}

function getComma(num)
{
    /* --------------------------------------------------------------------------------------------
    ÇÔ¼ö¸í : getComma(num)
    ÀÛ¼ºÀÚ : ±è¿øÁ¾ (kwj7175£Àgmail.com)
    ÀÛ¼ºÀÏ : 2006-11-24
    ¼³  ¸í : ÄÞ¸¶¸¦ Ãß°¡½ÃÄÑÁØ´Ù
             ¾ÆÁ÷ ¹Ì¿Ï¼ºÀÌ´Ù
    -------------------------------------------------------------------------------------------- */
    var txtNumber = '' + num;
    if (isNaN(txtNumber) || txtNumber == "") {
        alert("¼ýÀÚ¸¸ ÀÔ·Â ÇÏ¼¼¿ä");
    }else{
        var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
        var arrNumber = txtNumber.split('.');
        arrNumber[0] += '.';
        do {
            arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
        } while (rxSplit.test(arrNumber[0]));
        if (arrNumber.length > 1) {
            return arrNumber.join('');
        }else{
            return arrNumber[0].split('.')[0];
      }
   }
}

function ckgId(obj)
{
    /* --------------------------------------------------------------------------------------------
    ÇÔ¼ö¸í : ckgId(obj)
    ÀÛ¼ºÀÚ : ±è¿øÁ¾
    ÀÛ¼ºÀÏ : 2007-04-20
    ¼³  ¸í : ¾ÆÀÌµð ÀÔ·Â¿¡ Á¦ÇÑÀ» µÐ´Ù.
             ÇöÀç´Â Ã¹¹øÀç °ª¿¡ ¼ýÀÚ 0 ÀÌ µé¾î°¥¼ö ¾ø°Ô ÇÑ´Ù.
    -------------------------------------------------------------------------------------------- */
    if(obj=='[object]'){
        var firstChar = obj.value.substring(0,1);
        if( firstChar==='0' ){
            return false;
        }else{
            return true;
        }
    }
}

function getStrCheck(obj,ch)
{
    /* --------------------------------------------------------------------------------------------
    ÇÔ¼ö¸í : getStringCheck(°³Ã¼¸í,±¸ºÐ)
    ÀÛ¼ºÀÚ : ±è¿øÁ¾ (kwj7175£Àgmail.com)
    ÀÛ¼ºÀÏ : 2006.09.15
    ¼³  ¸í : ÀÔ·Â°ªÀ» °É·¯ÁÖ´Â ¿ªÈ°À» ÇÑ´Ù
             ±¸ºÐ°ª¿¡ µû¶ó °É·¯ÁÖ´Â Á¾·ù°¡ ´Ù¸£´Ù.
             0 : ¿µ¹®(¼Ò),¼ýÀÚ,Æ¯¼ö¹®ÀÚ Çã¿ë
             1 : ¿µ¹®(¼Ò),¼ýÀÚ Çã¿ë
             2 : ¿µ¹®(¼Ò) Çã¿ë
             id : ¾ÆÀÌµð(¼Ò¹®ÀÚ,¼ýÀÚ,¿µ¹®)
             mail : ¸ÞÀÏÁÖ¼Ò
             domain : µµ¸ÞÀÎÁÖ¼Ò
             number : ¼ýÀÚ
             tel : ÀüÈ­¹øÈ£
             fax : ÆÑ½º¹øÈ£
             hp : ÈÞ´ëÆù¹øÈ£
    -------------------------------------------------------------------------------------------- */

    var valid = "";
    switch(ch)
    {
        case "0" :          valid = "abcdefghijklmnopqrstuvwxyz0123456789$@#%^&*()[]+_{}`~=|."; break; // À¯È¿ÇÑ °ª 
        case "1" :          valid = "abcdefghijklmnopqrstuvwxyz0123456789"; break; // À¯È¿ÇÑ °ª 
        case "2" :          valid = "abcdefghijklmnopqrstuvwxyz"; break; // À¯È¿ÇÑ °ª 
        case "id" :         valid = /^[a-z0-9]+$/; break; // À¯È¿ÇÑ °ª 
        case "alphabet" :   valid = /^[a-z]/;break; // ¼ýÀÚ À¯È¿ÇÑ °ª 
        case "number" :     valid = /^[0-9]/;break; // ¼ýÀÚ À¯È¿ÇÑ °ª 
        case "domainHeader" :     valid = /^[a-z0-9_-]+$/;break; // µµ¸ÞÀÎ À¯È¿ÇÑ °ª 
        case "domainFooter" :     valid = /^[a-z0-9.]+$/;break; // µµ¸ÞÀÎ À¯È¿ÇÑ °ª 
        case "mail" :       valid = "abcdefghijklmnopqrstuvwxyz0123456789@_-.";break; // ¸ÞÀÏÁÖ¼Ò À¯È¿ÇÑ °ª 
        case "tel" :        valid = "0123456789-)";break; // ÀüÈ­¹øÈ£ À¯È¿ÇÑ °ª 
        case "fax" :        valid = "0123456789-)";break; // ÆÑ½º À¯È¿ÇÑ °ª 
        case "hp" :         valid = "0123456789-";break; // ÈÞ´ëÆù À¯È¿ÇÑ °ª 
    }
    var temp1;
    var temp2 = "";
    if(obj=='[object]')
    {
        var objValue = obj.value.toLowerCase();
        for(var i=0 ; i<objValue.length ; i++)
        {
            temp1 = objValue.substring(i, i+1);
            /*if (valid.indexOf(temp1) == "-1") RETURN = false; else temp2 = temp2 + temp1;*/
            //temp2 = valid.indexOf(temp1) == "-1" ? objValue.substring(i, i+1) : '' ;
            //alert(temp1+' --------------- '+temp1.match(/^[a-z0-9]+$/));
            var temp1Match = temp1.match(valid);
            var temp1Match = temp1.match(valid);
            temp2 += temp1Match ? temp1 : '' ;
            if(!temp1Match) alert('ÀÔ·ÂÇÒ¼ö ¾ø´Â ±ÛÀÚÀÔ´Ï´Ù');
        }
        
    }
    //alert(temp2);
    obj.value = temp2;
    obj.focus();
}

function Popup(url, name, myWidth, myHeight, myTop, myLeft, myScrollbars, myResizable, myAlign)
{
    /* --------------------------------------------------------------------------------------------
    ¸í¸í : Popup(ÁÖ¼Ò, ³×ÀÓ, °¡·Î, ¼¼·Î, ³ôÀÌÀ§Ä¡, °¡·ÎÀ§Ä¡, ½ºÅ©·Ñ¿©ºÎ, »çÀÌÂ¡¿©ºÎ, Á¤·Ä)
    ÀÛ¼º : ±è¿øÁ¾ (kwj7175£Àgmail.com)
    »ý¼º : 2006.09.04
    ¼³¸í : ÆË¾÷Ã¢À» ¼öÇàÇÑ´Ù
           ÀÛ¾÷¿Ï·áÈÄ ÀÌ ÇÔ¼ö¸¦ »èÁ¦ÇØ¾ß ÇÑ´Ù
    -------------------------------------------------------------------------------------------- */

    var LeftPosition = myAlign ? (screen.width - myWidth)/2 : myLeft;
    var TopPosition  = myAlign ? (screen.height - myHeight)/2 : myTop;
    var Popup_Set = 'width='+myWidth+',height='+myHeight+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+myScrollbars+',resizable='+myResizable;

    window.open(url, name, Popup_Set);
}

function popup(url, name, myWidth, myHeight, myTop, myLeft, myScrollbars, myResizable, myAlign)
{
    /* --------------------------------------------------------------------------------------------
    ÇÔ¼ö¸í : popup(ÁÖ¼Ò, ³×ÀÓ, °¡·Î, ¼¼·Î, ³ôÀÌÀ§Ä¡, °¡·ÎÀ§Ä¡, ½ºÅ©·Ñ¿©ºÎ:yes/no, »çÀÌÂ¡¿©ºÎ:yes/no, Á¤·Ä:true/false)
    ÀÛ¼ºÀÚ : ±è¿øÁ¾ (kwj7175£Àgmail.com)
    ÀÛ¼ºÀÏ : 2006.09.04
    ¼öÁ¤ÀÏ : 2007.01.18
    ¼³  ¸í : ÆË¾÷Ã¢À» ¼öÇàÇÑ´Ù
    -------------------------------------------------------------------------------------------- */

    var popupOpenRes = false;
    var myWidth = myWidth ? myWidth : screen.availWidth-10;
    var myHeight = myHeight ? myHeight : screen.availHeight-30;
    var myTop = myTop ? myTop : 0;
    var myLeft = myLeft ? myLeft : 0;
    var LeftPosition = myAlign ? (screen.availWidth - myWidth)/2 : myLeft;
    var TopPosition  = myAlign ? (screen.availHeight - myHeight)/2 : myTop;
    var Popup_Set = 'width='+myWidth+', height='+myHeight+', top='+TopPosition+', left='+LeftPosition+', directories=no, scrollbars='+myScrollbars+', resizable='+myResizable+', status=no, menubar=no, toolbar=no, location=no';

    window.open(url, name, Popup_Set);
}

function pageReload()
{
    /* --------------------------------------------------------------------------------------------
    ÇÔ¼ö¸í : pageReload()
    ÀÛ¼ºÀÚ : ±è¿øÁ¾ (kwj7175£Àgmail.com)
    ÀÛ¼ºÀÏ : 2006-11-24
    ¼³  ¸í : ÆäÀÌÁö »õ·Î°íÄ§ ±â´ÉÀ» ÇÑ´Ù
    -------------------------------------------------------------------------------------------- */

    this.location.reload(true);
}

function checkWhois(domain)
{
    /* --------------------------------------------------------------------------------------------
    ÇÔ¼ö¸í : checkWhois(domain)
    ÀÛ¼ºÀÚ : ±è¿øÁ¾ (kwj7175£Àgmail.com)
    ÀÛ¼ºÀÏ : 2006-11-24
    ¼³  ¸í : µµ¸ÞÀÎÀÇ whois Á¤º¸¸¦ º¸±â À§ÇÑ ÆË¾÷Ã¢ÀÌ´Ù
    -------------------------------------------------------------------------------------------- */

    var openRes = popup('http://find1.whois.co.kr/domain-search/DomainInfo.jsp?domain='+domain, 'popupWhois', 500, 600, 0, 0, 'yes', 'no', true);
}

function checkMall(domain)
{
    /* --------------------------------------------------------------------------------------------
    ÇÔ¼ö¸í : checkMall(domain)
    ÀÛ¼ºÀÚ : ±è¿øÁ¾ (kwj7175£Àgmail.com)
    ÀÛ¼ºÀÏ : 2006-12-12
    ¼³  ¸í : ÇØ´ç µµ¸ÞÀÎÀÇ »çÀÌÆ®¸¦ ¿­¾îÁØ´Ù.
    -------------------------------------------------------------------------------------------- */
    window.open('http://'+domain);
}

function linkAdmin(url, level)
{
    popup(url, SE_GID+'_'+SE_MID+'_'+SE_UID+'_'+level, 0, 0, 0, 0, 'yes', 'no', false);
}

		
function linkBookMark(mname)
{
    /* --------------------------------------------------------------------------------------------
    ÇÔ¼ö¸í : linkBookMark()
    ÀÛ¼ºÀÚ : À¯»ó±Õ
    ÀÛ¼ºÀÏ : 2006-11-22
    ¼³  ¸í : Áñ°ÜÃ£±â Ãß°¡ ±â´ÉÀ» ÇÑ´Ù
    -------------------------------------------------------------------------------------------- */
    j = 0;
	var thisUrl = location.href;
    var thisUrLen = thisUrl.length;

	for(i=0 ; i < thisUrLen ; i++ )
	{
		
		reUrl = thisUrl.charAt(i) ;
		if(reUrl=="/") j++;
		if(j == 3 )
		{
			thisUrLast = i + 2 ;
		}
	}
	var favoriteUrl   = thisUrl.substring(0,thisUrLast);
	var favoriteTitle = mname+"¿¡ ¿À½Å°ÍÀ» È¯¿µÇÕ´Ï´Ù";
	
	if (document.all) 
		window.external.AddFavorite(favoriteUrl,favoriteTitle);
}

function Logout()
{
	if(confirm("·Î±×¾Æ¿ôÇÏ½Ã°Ú½À´Ï±î?"))
	{
		document.getElementById("procWindow").src = "logout.php"
	}
	else
	{
		return false;
	}
}

function hint(eventCh,event,value,obj)
{
    if(document.getElementById('divHint') == '[object]'){

         switch(eventCh){
            case 'over' : {
                document.getElementById('divHint').style.display = 'inline';
                document.getElementById('spanHint').innerHTML = document.getElementById(obj).innerHTML;
            } break;
            case 'move' : {

                if (IE) { // grab the x-y pos.s if browser is IE
                    tempX = event.clientX + document.body.scrollLeft;
                    tempY = event.clientY + document.body.scrollTop;
                } else {  // grab the x-y pos.s if browser is NS
                    tempX = e.pageX;
                    tempY = e.pageY;
                }  

                if (tempX < 0){tempX = 0;}
                if (tempY < 0){tempY = 0;}  

                document.getElementById('divHint').style.top = tempY + 10;
                document.getElementById('divHint').style.left = tempX + 10;
                document.getElementById('spanHint').innerHTML = document.getElementById(obj).innerHTML;
                document.getElementById('divHint').style.display = 'inline';
            } break;
            case 'out' : {
                document.getElementById('divHint').style.display = 'none';
                document.getElementById('spanHint').innerHTML = ''+tempX+'/'+tempY;
            } break;
            default : document.getElementById('divHint').style.display = 'none';
         }
     
    }
}

function getMouseXY(e)
{
    if (IE) { // grab the x-y pos.s if browser is IE
        tempX = event.clientX + document.body.scrollLeft;
        tempY = event.clientY + document.body.scrollTop;
    } else {  // grab the x-y pos.s if browser is NS
        tempX = e.pageX;
        tempY = e.pageY;
    }  

    if (tempX < 0){tempX = 0;}
    if (tempY < 0){tempY = 0;}  
    document.Show.MouseX.value = tempX;
    document.Show.MouseY.value = tempY;

    return true;
}

function mp3(musicsrc,loop)
{
    if(!loop) loop = 'infinite';
    if (navigator.appName=="Microsoft Internet Explorer") // ÀÍ½ºÇÃ·Î·¯ÀÇ °æ¿ì
        document.write('<bgsound src="'+musicsrc+'" loop="'+loop+'">')
    else // ÀÍ½ºÇÃ·Î·¯°¡ ¾Æ´Ñ°æ¿ì
        document.write('<embed src="'+musicsrc+'" hidden="true" border="0" width="20" height="20" autostart="true" loop="true">');
}

function swf(name,width,height)
{
    /* --------------------------------------------------------------------------------------------
    ÇÔ¼ö¸í : swf(name,width,height)
    ÀÛ¼ºÀÚ : À¯»ó±Õ
    ÀÛ¼ºÀÏ : 2006-11-22
    ¼³  ¸í : ÇÃ·¡½Ã ÆÄÀÏ ÆÐ½ÃºÎºÐÀÌ´Ù
    -------------------------------------------------------------------------------------------- */

    html = '';
    html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab?Sid=version=7,0,19,0" width="'+width+'" height="'+height+'">';
    html += '<param name="movie" value="'+name+'">';
    html += '<param name="quality" value="high">';
    html += '<param name="wmode" value="TRANSPARENT">';
    html += '<embed src="'+name+'" quality=high bgcolor="white" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
    html += '<\/object>';
    document.write(html);
}

function check_juminno(juminno)
{
    /* --------------------------------------------------------------------------------------------
    ¸í¸í : check_juminno(ÁÖ¹Î¹øÈ£(ÇÏÀÌÇÂ»ý·«))
    ¹ßÃë : PHPSHOOL
    »ý¼º : 2006.09.18
    ¼³¸í : ÁÖ¹Îµî·Ï¹øÈ£¸¦ °ËÁõÇÑ´Ù
    -------------------------------------------------------------------------------------------- */
        if(juminno=="" || juminno==null || juminno.length!=13) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ Àû¾îÁÖ¼¼¿ä.");
                return false;
        }
        var jumin1 = juminno.substr(0,6);
        var jumin2 = juminno.substr(6,7);
        var yy         = jumin1.substr(0,2);        // ³âµµ
        var mm = jumin1.substr(2,2);        // ¿ù
        var dd = jumin1.substr(4,2);        // ÀÏ
        var genda = jumin2.substr(0,1);        // ¼ºº°
        var msg, ss, cc;

        // ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì
        if (!isNumeric(jumin1)) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // ±æÀÌ°¡ 6ÀÌ ¾Æ´Ñ °æ¿ì
        if (jumin1.length != 6) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // Ã¹¹øÂ° ÀÚ·á¿¡¼­ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ±âº» ±¸¼º °Ë»ç
        if (yy < "00" || yy > "99" ||
                mm < "01" || mm > "12" ||
                dd < "01" || dd > "31") {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì
        if (!isNumeric(jumin2)) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // ±æÀÌ°¡ 7ÀÌ ¾Æ´Ñ °æ¿ì
        if (jumin2.length != 7) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // ¼ºº°ºÎºÐÀÌ 1 ~ 4 °¡ ¾Æ´Ñ °æ¿ì
        if (genda < "1" || genda > "4") {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // ¿¬µµ °è»ê - 1 ¶Ç´Â 2: 1900³â´ë, 3 ¶Ç´Â 4: 2000³â´ë
        cc = (genda == "1" || genda == "2") ? "19" : "20";
        // Ã¹¹øÂ° ÀÚ·á¿¡¼­ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ³¯Â¥ Çü½Ä °Ë»ç
        if (isYYYYMMDD(parseInt(cc+yy), parseInt(mm), parseInt(dd)) == false) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // Check Digit °Ë»ç
        if (!isSSN(jumin1, jumin2)) {
                alert("ÀÔ·ÂÇÑ ÁÖ¹Îµî·Ï¹øÈ£¸¦ °ËÅäÇÑ ÈÄ, ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        return true;
}

function objSelectCategory(thisKey, depth, scObj, tgObj)
{
    var scIndex = scObj.selectedIndex;
    var cgText = jsCategory[scIndex];
    var cgValue = '';

    for(var i=0 ; i<scObj.options.length ; i++){
        objSelectDel(tgObj);
    }

    for(var i=0 ; i<cgText.length ; i++){
        objSelectAdd(tgObj,cgText[i][1],cgText[i][2]);
    }
}

// ¹®ÀÚ¿­ÀÇ ±æÀÌ¸¦ °è»ê
function getStringLength(string)
{
    var i, j=0;

    for(i=0;i<string.length;i++) {
        lengthString = escape(string.charAt(i)).length;
        if(lengthString > 4) j++;
        j++;
    }

    return j;
}

// ¹®ÀÚ¿­ÀÇ ³ÐÀÌ¸¦ ÇÈ¼¿ ´ÜÀ§·Î °è»ê
function getStringPixelWidth(string_value)
{
    var ascii_code;
    var string_value_length = string_value.length;
    var character;
    var character_width;
    var character_length;
    var total_width = 0;
    var total_length = 0;

    var special_char_size = 6;
    var multibyte_char_size = 12;
    var base_char_start = 32;
    var base_char_end =  127;
    var ascii_char_size = Array(4,4,4,6,6,10,8,4,5,5,6,6,4,6,4,6,6,6,6,6,6,6,6,6,6,6,4,4,8,6,8,6,12,8,8,9,8,8,7,9,8,3,6,8,7,11,9,9,8,9,8,8,8,8,8,10,8,8,8,6,11,6,6,6,4,7,7,7,7,7,3,7,7,3,3,6,3,11,7,7,7,7,4,7,3,7,6,10,7,7,7,6,6,6,9,6);

    for(i=0; i<string_value_length; i++){
        character = string_value.substring(i,(i+1));
        ascii_code = character.charCodeAt(0);

        if(ascii_code < base_char_start){
            character_width = special_char_size;
        }else if(ascii_code <= base_char_end){
            idx = ascii_code - base_char_start;
            character_width = ascii_char_size[idx];
        }else if(ascii_code > base_char_end){
            character_width = multibyte_char_size;
        }
        total_width += character_width;
    }

    return total_width;
}

function roundTableShow(objId)
{
    var obj = eval('document.all.'+objId);
    if(obj=='[object]') roundTable(objId);    
}

function roundTable(objID)
{
    /* ---------------------------------------------------------------------------
    »ç¿ë¹ý : <script>roundTable("ta_sub");</script>
             radius="2" rborder="#999999" rbgcolor="#FFFFFF"
    --------------------------------------------------------------------------- */

    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);
}

/*****************************************************************************
(int) roundType: ¸ð¼­¸® rounding type (0~6)
(string) edgePos: ¸ð¼­¸® À§Ä¡ ('UL', 'UR', 'LL', 'LR')
(string) borderC: ¹öÆ° °æ°è »ö±ò
(string) lightC: ¹öÆ° ¹ÙÅÁÁß ¿ÞÂÊ°ú À§ÂÊÀÇ ¹àÀº ºÎºÐ »ö±ò
(string) midC: ¹öÆ° ¹ÙÅÁ »ö±ò
(string) darkC: ¹öÆ° ¹ÙÅÁÁß ¿À¸¥ÂÊ°ú ¾Æ·¡ÂÊÀÇ ¾îµÎ¿î ºÎºÐ »ö±ò
(bool) border: °æ°è À¯¹« ('0' or '1') => Tab¿¡¸¸ »ç¿ë
(bool) iduse: color º¯È­¸¦ À§ÇÑ id »ç¿ë À¯¹« ('0' or '1')
*****************************************************************************/
function getEdgeTag (roundType, edgePos, borderC, lightC, darkC, midC, border, iduse) {
  if (!border) border = '1';
  if (!iduse) iduse = '1';

  /* shape for "LL (Lower Left)" */
  shape0 = new Array (5);
  shape0[0] = new Array (1,2,4,4,4);
  shape0[1] = new Array (1,2,4,4,4);
  shape0[2] = new Array (1,2,4,4,4);
  shape0[3] = new Array (1,3,3,3,3);
  shape0[4] = new Array (1,1,1,1,1);
  shape1 = new Array (5);
  shape1[0] = new Array (1,2,4,4,4);
  shape1[1] = new Array (1,2,4,4,4);
  shape1[2] = new Array (1,2,4,4,4);
  shape1[3] = new Array (1,3,3,3,3);
  shape1[4] = new Array (0,1,1,1,1);
  shape2 = new Array (5);
  shape2[0] = new Array (1,2,4,4,4);
  shape2[1] = new Array (1,2,4,4,4);
  shape2[2] = new Array (1,2,4,4,4);
  shape2[3] = new Array (0,1,3,3,3);
  shape2[4] = new Array (0,0,1,1,1);
  shape3 = new Array (5);
  shape3[0] = new Array (1,2,4,4,4);
  shape3[1] = new Array (1,2,4,4,4);
  shape3[2] = new Array (0,1,3,4,4);
  shape3[3] = new Array (0,0,1,3,3);
  shape3[4] = new Array (0,0,0,1,1);
  shape4 = new Array (5);
  shape4[0] = new Array (1,2,4,4,4);
  shape4[1] = new Array (1,2,4,4,4);
  shape4[2] = new Array (0,1,3,4,4);
  shape4[3] = new Array (0,1,1,3,3);
  shape4[4] = new Array (0,0,0,1,1);
  shape5 = new Array (5);
  shape5[0] = new Array (1,2,4,4,4);
  shape5[1] = new Array (0,1,3,4,4);
  shape5[2] = new Array (0,1,3,3,4);
  shape5[3] = new Array (0,0,1,1,3);
  shape5[4] = new Array (0,0,0,0,1);
  shape6 = new Array (5);
  shape6[0] = new Array (0,1,2,4,4);
  shape6[1] = new Array (0,1,2,4,4);
  shape6[2] = new Array (0,0,1,3,3);
  shape6[3] = new Array (0,0,0,1,1);
  shape6[4] = new Array (0,0,0,0,0);

  shape = eval ('shape'+roundType);
  cv0 = ''; cv1 = borderC; cv2 = lightC; cv3 = darkC; cv4 = midC;
  xbegin = 0; xend = 5; xinc= 1;
  ybegin = 0; yend = 5; yinc= 1;

  if (edgePos == "UL") {
    cv3 = lightC;
    xbegin = 4; xend = -1; xinc = -1;
  }
  else if (edgePos == "UR") {
    cv2 = darkC; cv3 = lightC;
    xbegin = 4; xend = -1; xinc = -1;
    ybegin = 4; yend = -1; yinc = -1;
  }
  else if (edgePos == "LR") {
    cv2 = darkC;
    ybegin = 4; yend = -1; yinc = -1;
  }

  str = "<table border=0 cellpadding=0 cellspacing=0>\n";
  for (x = xbegin; x != xend; x += xinc) {
    str += "<tr>";
    for (y = ybegin; y != yend; y += yinc) {
      if (border == '0' && y == 0) continue;

      bgtag = '';
      color = eval ('cv'+shape[x][y]);
      if (color != '') bgtag = " bgcolor="+color;

      idtag = '';
      if (iduse == '1') {
        if (color == lightC && color != darkC) idtag = " id=lightArea_"+btnID;
        else if (color == darkC && color != lightC) idtag = " id=darkArea_"+btnID;
        else if (color == midC) idtag = " id=midArea_"+btnID;
      }

      wtag = ''; htag = '';
      if (x == xbegin) wtag = " width=1"; 
      if (y == ybegin || y == ybegin+yinc) htag = " height=1"; 

      str += "<td" + wtag + htag + idtag + bgtag + ">"
    }
    str += "</tr>\n";
  }
  str += "</table>";

  return str ;
}

function objSelectUpdownSel(ta,type,res)
{
    //1,2,3,4(¸ÇÀ§,À§,¾Æ·¡,¸Ç¾Æ·¡); //¼±ÅÃµÈ option ¼ø¼­ ¹Ù²Ù±â(¸ÖÆ¼ ºÒ°¡)
    var sel_len = ta.length
    var sel_idx = ta.selectedIndex;

    if(res){
        if(sel_idx==-1){alert('´ë»óÀ» ¼±ÅÃÇØÁÖ¼¼¿ä.'); return;}
        if(type<3 && sel_idx==0 ){ alert('´ë»óÀÌ ¸Ç À§¿¡ÀÖ½À´Ï´Ù'); return; }
        if(type>2 && sel_idx==(sel_len-1) ){ alert('´ë»óÀÌ ¸Ç ¾Æ·¡¿¡ÀÖ½À´Ï´Ù'); return; }
    }
    switch(type){
        case 1 : objSelectGoto(ta,sel_idx,0); break;  
        case 2 : objSelectGoto(ta,sel_idx,sel_idx-1); break;
        case 3 : objSelectGoto(ta,sel_idx,sel_idx+1); break;
        case 4 : objSelectGoto(ta,sel_idx,(sel_len-1)); break;  
    }
}
function objSelectGoto(ta,st,ed)
{
    var ta_num =-1;
    var ol,ta_ol;
    if(st<0 || ed<0 || st >=ta.length  || ed >=ta.length ) return;
    if(st<ed){
        while(st<ed){
            ta_num=st+1;
            ol = ta.options[st].cloneNode(true);
            ta_ol = ta.options[ta_num].cloneNode(true);
            ta.options[ta_num]=new Option(ol.innerHTML,ol.value,false,true);
            ta.options[st]=new Option(ta_ol.innerHTML,ta_ol.value,false,false);   
            st=ta_num;
        }
    }else
    if(st>ed){
        while(st>ed){
            ta_num=st-1;
            ol = ta.options[st].cloneNode(true);
            ta_ol = ta.options[ta_num].cloneNode(true);
            ta.options[ta_num]=new Option(ol.innerHTML,ol.value,false,true);
            ta.options[st]=new Option(ta_ol.innerHTML,ta_ol.value,false,false);   
            st=ta_num;
        }
    }
}

function select_all(ta,bool)
{ //¸ðµç option ¼±ÅÃ
    if(!ta){ return; }   
    for(var i=0,m=ta.length;i<m;i++){
        ta.options[i].selected=bool;
    } 
}
function objSelectAdd(ta,t,v)
{
    var sel_len = ta.length
    if(t=='[object]') tValue = t.value; else tValue = t;
    if(v=='[object]') vValue = v.value; else vValue = v;
    //ta.options[ta.length]=new Option(tValue+'('+vValue+')',vValue,false,tValue);
    ta.options[ta.length]=new Option(vValue,vValue,false,tValue);
}

function objSelectDel(ta)
{
    //¼±ÅÃµÈ option »èÁ¦(¸ÖÆ¼ °¡´É)
    if(ta.selectedIndex == -1){ return; }  
    var ol
    for(var i=ta.length-1,m=0;i>=m;i--){
        if(ta.options[i].selected){
            ol = ta.options[i];
            ta.removeChild(ol);
        }
    } 
    ta.focus();
}