    <!-- Function courtesy of:  Cyanide_7 (leo7278@hotmail.com) -->

    function formatCurrency(num) { 
        num = num.toString().replace(/$|,/g,'');
        if(isNaN(num)) num = "0";
        cents = Math.floor((num*100+0.5)%100);
        num = Math.floor((num*100+0.5)/100).toString();
        if(cents < 10) cents = "0" + cents;
        for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) {
            num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));
        }
        return (num + ""); // ´Ù¸¥È­Æó´ÜÀ§·Î ¾µ°æ¿ì ("$" +num + "." + cents); Ã³·³ ¼öÁ¤ ÇØ ÁÖ¼¼¿ä
    }

    function ShowDIV(id, aText, open, close){
        if(id.style.display == "none"){
            id.style.display = "" ;
            if(close) aText.innerHTML = open ;
        } else {
            id.style.display = "none" ;
            if(open) aText.innerHTML = close ;
        }
    }

    function ChangeDIV(id, id_shadow){
        if(id.style.display == "none"){
            id.style.display = "" ;
            id_shadow.style.display = "none" ;
        } else {
            id.style.display = "none" ;
            id_shadow.style.display = "" ;
        }
    }

    function popup(goPageURL, goPageName, goPageWidth, goPageHeight, goPageStyle){
        if(!goPageStyle) goPageStyle = "menubar=no, scrollbars=no, resizable=no";
        window.open(goPageURL,goPageName,'width='+goPageWidth+',height='+goPageHeight+',' + goPageStyle);
    }

    function zoom(goPageURL){
        goPageURL = "/_common/image.zoom.html?img_src=" + goPageURL;
        goPageName = "zoom";
        goPageWidth = 100;
        goPageHeight = 100;
        window.open(goPageURL,goPageName,'width='+goPageWidth+',height='+goPageHeight+',menubar=no, scrollbars=no, resizable=no');
    }

    function expire(url, w, h) { 
        // µµ¸ÞÀÎºÎºÐÀº ¿©·¯ºÐÀÇ URL ·Î °íÃÄ »ç¿ëÇÏ¼¼¿ä
        document.cookie = "user=;domain=localhost;path=/"; 
        document.cookie = "chatuser=;domain=localhost;path=/"; 
        document.cookie = "globalc=;domain=localhost;path=/"; 
        document.cookie = "returnurl=;domain=localhost;path=/"; 
        document.cookie = "chatreload=;domain=localhost;path=/"; 
        var getCookie = document.cookie; 
        if ( getCookie.indexOf("NOPOPnew") < 0 ) { 
            //popup_issue();  // ÆË¾÷Ã¢ÀÇ ¼Ó¼ºÀ» ¼³Á¤ ÇÕ´Ï´Ù 
            popup(url, 'fm', w, h);
        } 
    } 

    function cookieSet(dayNum) { 
        var cookieFlag, oDate, expiresDate; 
        cookieFlag = "NOPOPnew"; 
        oDate = new Date(); 
        oDate.setDate(oDate.getDate() + dayNum); 
        expiresDate = oDate.toGMTString(); 

        //ÄíÅ°¼ÂÆÃ 
        if ( document.all.popupCheck.checked == 1 ) { 
            document.cookie = "popnew=" + cookieFlag + "; expires=" + expiresDate + "; path=/;"; 
        } else {
            document.cookie = "popnew=" + "" + "; expires=" + expiresDate + "; path=/;"; 
        }
        //alert(document.cookie);
    }

    function hideStatus() {
        var statusMSG="";
        window.status = statusMSG;
        return true;
    }

    //SMS Àü¼Û¿ë ±ÛÀÚ¼ö Á¦ÇÑ ½ÃÀÛ
    function sms_check_length(hForm) {
        var tmpStr, nStrLen, reserve;
        sInputStr = hForm.sms_message.value;
        nStrLen = sms_calculate_byte(sInputStr);
        if ( nStrLen > 80 ) {
            tmpStr = sms_Cut_Str(sInputStr,80);
            reserve = nStrLen - 80;
            alert("¹ÙÀÌÆ®°¡ ÃÊ°úµÇ¾ú½À´Ï´Ù.(ÃÖ´ë 80Bytes)\r\nÃÊ°úµÈ ºÎºÐÀº Àü¼ÛµÇÁö ¾Ê½À´Ï´Ù."); 
            // 80byte¿¡ ¸Â°Ô ÀÔ·Â³»¿ë ¼öÁ¤
            hForm.sms_message.value = tmpStr;
            nStrLen = sms_calculate_byte(tmpStr);
            hForm.msglen.value = nStrLen;
        } else {
            hForm.msglen.value = nStrLen;
        }
        return;
    }

    function sms_calculate_byte( sTargetStr ) {
        var sTmpStr, sTmpChar;
        var nOriginLen = 0;
        var nStrLength = 0;
        sTmpStr = new String(sTargetStr);
        nOriginLen = sTmpStr.length;
        for ( var i=0 ; i < nOriginLen ; i++ ) {
            sTmpChar = sTmpStr.charAt(i);
            if (escape(sTmpChar).length > 4) {
                nStrLength += 2;
            } else if (sTmpChar!='\r') {
                nStrLength ++;
            }
        }
        return nStrLength;
    }

    function sms_Cut_Str( sTargetStr, nMaxLen ) {
        var sTmpStr, sTmpChar, sDestStr;
        var nOriginLen = 0;
        var nStrLength = 0;
        var sDestStr = "";
        sTmpStr = new String(sTargetStr);
        nOriginLen = sTmpStr.length;
        for ( var i=0 ; i < nOriginLen ; i++ ) {
            sTmpChar = sTmpStr.charAt(i);
            if (escape(sTmpChar).length > 4) {
                nStrLength = nStrLength + 2;
            } else if (sTmpChar!='\r') {
                nStrLength ++;
            }
            if (nStrLength <= nMaxLen) {
                sDestStr = sDestStr + sTmpChar;
            } else {
                break;
            }
        }
        return sDestStr;
    }
    //SMS Àü¼Û¿ë ±ÛÀÚ¼ö ³¡

    function winopen(URL, popName, popWidth, popHeight, popTop, popLeft, popStyle){ 
        if (!popWidth) popWidth = screen.width;
        if (!popHeight) popHeight = screen.height;
        if (!popStyle) popStyle = "scrollbars=no, status=yes"; // ½ºÅ©·Ñ¹Ù ¾øÀ½
        //if (!popStyle) popStyle = "scrollbars"; // ½ºÅ©·Ñ¹Ù ÀÖÀ½
        newwin=window.open(URL,popName,popStyle);
        if (document.all){ 
            newwin.moveTo(popTop, popLeft);
            newwin.resizeTo(popWidth, popHeight);
        }
        //newwin.location = URL;
    }

// JavaScript Document

function flash(c,d,e) {
    var flash_tag = "";
    flash_tag = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
    flash_tag +='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" ';
    flash_tag +='WIDTH="'+c+'" HEIGHT="'+d+'" >';
    flash_tag +='<param name="allowScriptAccess" value="always" />';
    flash_tag +='<param name="allowFullScreen" value="false" />';
    flash_tag +='<param name="movie" value="'+e+'" />';
    flash_tag +='<param name="base" value="." />';
    flash_tag +='<param name="quality" value="high" />';
    flash_tag +='<embed src="'+e+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ';
    flash_tag +='type="application/x-shockwave-flash"  WIDTH="'+c+'" HEIGHT="'+d+'" id="asdf"></embed></object>'
    document.write(flash_tag);
}

    // ÀÌ¹ÌÁö È®´ëÃ¢ ÀÚµ¿»ý¼º ½ºÅ©¸³Æ® : »ç¿ë¹ý : <img src="" onclick="this.src.popupView(img, msg)"> : ÆË¾÷µÉ ÀÌ¹ÌÁö°¡ 1024 * 768 º¸´Ù Å©´Ù¸é ÆË¾÷ °¡·Î¼¼·Î »çÀÌÁî¸¦ 1024 * 768·Î °íÁ¤ÇØÁÝ´Ï´Ù.
    String.prototype.popupView = function (img_view, msg) {
        var x = x + 20;
        var y = y + 30;
        if(!img_view) img_view = this;

        if(msg) {
            img_msg = "<tr><td width='100%' height='30' align='center'>" + msg + "</td></tr>";
            img_y = 25;
        } else {
            img_y = 0;
            img_msg = "";
        }

        //if(msg) img_msg = "<div id='loading_msg' style='DISPLAY:show; position:absolute; width:100%; height:100%; left:0px; top:0px;' width='100%' height='100%'><table width='100%' height='20' border='1' valign='bottom'><tr><td width='100%' height='20' align='center' valign='bottom'>°¡³ª´Ù</td></tr></table></div>";

        htmlz = "<html><head><title>ÀÌ¹ÌÁöÅ©°Ôº¸±â</title><link href='/_include/default.css' rel='stylesheet' type='text/css'><style>body{margin:0;cursor:hand;}</style></head><body scroll=no onload='width1=document.all.Timage.width;/*if(width1>1024) width1=1024*/;height1=document.all.Timage.height;if(height1>768) height1=768; top.window.resizeTo(width1+30,height1+80 + " + img_y + "); this.focus();' onclick='top.window.close();'><table width='100%' _height='100%' border='0'><tr><td width='100%' _height='100%' align='center'><img src='"+img_view+"' title='Å¬¸¯ÇÏ½Ã¸é ´ÝÈü´Ï´Ù.' name='Timage' id='Timage'></td></tr>" + img_msg + "</table></body></html>"
        imagez = window.open('', "image", "width="+ x +", height="+ y +", top=100, left=100, scrollbars=auto, resizable=1, toolbar=0, menubar=0, location=0, directories=0, status=1");
        imagez.document.open();
        imagez.document.write(htmlz)
        imagez.document.close();
    }

    function bluring(){ 
        if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
    }
    document.onfocusing = bluring;

function F_viewSwf(width, height, wmode, url, ref){
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ");
	document.write("		codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' ");
	document.write("		width='"+width+"' height='"+height+"' align='middle'>");	
	document.write("	<param name='movie'				value='"+url+"' /> ");
	document.write("	<param name='quality'			value='high' /> ");
	document.write("	<param name='wmode'				value='"+wmode+"'> ");
	document.write("	<param name='FlashVars'				value='ref="+ref+"' /> ");
	document.write("	<param name='base'				value='.' /> ");
	document.write("	<embed base='.' src='"+url+"' quality='high' width='"+width+"' height='"+height+"' align='middle' id='asdf'");
	document.write("		allowScriptAccess='always' type='application/x-shockwave-flash' ");
	document.write("		pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}

