
/*****************************************************************************
System        : ÀÚ¿¬ÀÌ¶û
Program       :
Title         : ÀÚ¿¬ÀÌ¶û Common Functions
File          : common.js
Program Type  : js
Analyst       :
Author        : hwkim
Date Started  : 20080124
Last Modified :
Called By     :
Parameters    :
Purpose       :
              :
Version       :

Modified     Author     V/M     Reason For Modification
---------    ---------- ---     ----------------------------------------------
20080124     hwkim      1.0     Release first version
******************************************************************************/

/*******************************************************************
 * ÇÊ¼ö ½ºÅ©¸³Æ® ¸ðÀ½
 *******************************************************************/
 
//À©µµ¿ì Áß¾Ó Ç¥½Ã ÁÂÇ¥
var winl = 0, wint = 0;
if (window.innerWidth == null) {
    if(document.body == null) { 
        winl = document.documentElement.offsetWidth / 2;
        wint = document.documentElement.offsetHeight / 2;
    } else {
        winl = document.body.clientWidth / 2;
        wint = document.body.clientHeight / 2;           
    }
} else {
    winl = (window.innerWidth / 2);
    wint = (window.innerHeight / 2);
}

var onbeforeunload_flags = true;

function init_unload() {
    onbeforeunload_flags = true;
}

function clear_unload() {
    onbeforeunload_flags = false;
}
function onbeforeunload_f() {
    if ( onbeforeunload_flags ) {
        event.returnValue = "¡ºÆäÀÌÁö¸¦ ¹þ¾î³ª½Ã¸é Ã³¸® ÁßÀÌ´ø ÀÚ·á¿¡ ½É°¢ÇÑ ¹®Á¦°¡ ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù.¡»\n¡ºÁøÇà ÁßÀÌ´ø ÀÛ¾÷ÀÌ ÀÖ´Ù¸é, ¹Ýµå½Ã ¿Ï·á ¶Ç´Â Ãë¼ÒÃ³¸®¸¦ ÇÏ°í ÀÌµ¿ÇÏ½Ê½Ã¿À!¡»";
    }
    onbeforeunload_flags = true;
}
function onbeforeunload_init() {
    if ( navigator.appName == "Microsoft Internet Explorer" ) {
        onbeforeunload = onbeforeunload_f;
    }
}

/**
 * ÆäÀÌÁö°£ ÀÌµ¿Áß Loading...¸Þ½ÃÁö¸¦ Ç¥½ÃÇÑ´Ù.
 *
 * »ç¿ë¹ý: submit() Àü¿¡ ±â¼úÇÑ´Ù.
 * <%@include file="/common/waiting.jsp" %>
 *
 */
function showWaiting() {
    var dv = document.getElementById("divWaiting");
    dv.style.display = "block";
    var dvHeight = parseInt(dv.style.height);
    var dvWidth = parseInt(dv.style.width);
    var dvTop = wint - (dvHeight / 2);
    var dvLeft = winl - (dvWidth / 2);

    dv.style.display = "block";
    dv.style.top = dvTop +'px';
    dv.style.left = dvLeft +'px';

    //È­¸é Disable È¿°ú
    var xwall = document.getElementById("divXwall");

    if (window.innerWidth == null) {
        xwall.style.width = document.documentElement.scrollWidth + 'px';
        
        if(eval(document.documentElement.scrollHeight) < eval(screen.availHeight)) {
            xwall.style.height = screen.availHeight + 'px';
        } else {
            xwall.style.height = document.documentElement.scrollHeight + 'px';
        }
        
    } else {
        xwall.style.width = window.innerWidth + 'px';
        xwall.style.height = screen.availHeight + 'px';
    }

    xwall.style.filter = "alpha(opacity=65)";
    xwall.style.opacity = "0.6";
    xwall.style.display = "block";
}

function hideWaiting() {
    var dv = document.getElementById("divWaiting");
    dv.style.display = "none";
    if(document.getElementById("divXwall")) document.getElementById("divXwall").style.display = "none";
}
 
function show_waiting() {
    showWaiting();
}

function hide_waiting() {
    hideWaiting();
}

/**
 * ÁöÁ¤ÇÑ DIV¸¦ Áß¾Ó¿¡ Ç¥½ÃÇÏ°í ¼û±ä´Ù (¼³Á¤È­¸é¿¡ ÁÖ·Î »ç¿ë)
 *
 * divN: DIV id
 */
function showDivPanel(divN) {
    var dv = document.getElementById(divN);
    var dvHeight = parseInt(dv.style.height);
    var dvWidth = parseInt(dv.style.width);
    var dvTop = wint - (dvHeight / 2);
    var dvLeft = winl - (dvWidth / 2);

    dv.style.position = "absolute";
    dv.style.top = dvTop +'px';
    dv.style.left = dvLeft +'px';
    dv.style.zIndex = "9992";

    var xwall = document.getElementById("divXwall");

    if(xwall) {
        
        if (window.innerWidth == null) {
            xwall.style.width = document.documentElement.scrollWidth + 'px';
            
            if(eval(document.documentElement.scrollHeight) < eval(screen.availHeight)) {
                xwall.style.height = screen.availHeight + 'px';
            } else {
                xwall.style.height = document.documentElement.scrollHeight + 'px';
            }
            
        } else {
            xwall.style.width = window.innerWidth + 'px';
            xwall.style.height = screen.availHeight + 'px';
        }
        xwall.style.filter = "alpha(opacity=65)";
        xwall.style.opacity = "0.6";
        xwall.style.display = "block";
    }

    dv.style.visibility = "visible";
    dv.style.display = "block";
}

function hideDivPanel(divN) {
    var dv = document.getElementById(divN);
    dv.style.visibility = "hidden";
    dv.style.display = "none";
    if(document.getElementById("divXwall")) document.getElementById("divXwall").style.display = "none";
}

/**
 * ÁöÁ¤ÇÑ div¸¦ ÀÚµ¿ ½ºÅ©·Ñ À§Ä¡¸¦ Á¶Á¤ÇÑ´Ù.
 *
 * setAutoScrollDiv() ÇÔ¼ö¿¡ Á¾¼ÓÀû ÀÓ.
 */
function autoScrollDiv(divName) {
    var yMenuFrom, yMenuTo, yOffset;

    var obj = document.getElementById(divName);
    yMenuFrom = parseInt(obj.style.top, 10);
    yMenuTo = document.body.scrollTop;

    if( yMenuFrom != yMenuTo) {
        yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
        if(yMenuTo < yMenuFrom) {
            yOffset = -yOffset;
        }
        obj.style.top = parseInt(obj.style.top, 10) + yOffset;
    }
    setTimeout ("autoScrollDiv('"+divName+"')", 10);
}

/**
 * ÀÚµ¿ ½ºÅ©·ÑÀÌ ÇÊ¿äÇÑ div¸¦ ÁöÁ¤ÇÏ°í body¿¡¼­ Á÷Á¢ È£ÃâÇÑ´Ù
 *
 * ¿¹) <script> setAutoScrollDiv('autoScrollDiv'); </script>
 */
function setAutoScrollDiv(divName) {
    if(top.frames.length) {
        document.getElementById(divName).style.display = "inline";
    }
    autoScrollDiv(divName);
    return true;
}

/**
 * iframe Å©±â¸¦ ÃÖ´ë·Î Å°¿ò.
 * (ÀÏ¹ÝÀûÀ¸·Î ºÎ¸ðÆäÀÌÁö°¡ ·Îµù µÉ ¶§ ½ÇÇàÇÔ ex) init() )
 */
function voidResizeFrame(){   
    self.resizeTo(document.body.offsetWidth, document.body.scrollHeight+20);
}

/**
 * ÁÖ¾îÁø element¸¦ ¼û±â°Å³ª º¸ÀÌ°Ô ÇÑ´Ù
 */
function toggleMenu(elName) {
    var el = document.getElementById(elName);
    var isVisible = (el.style.visibility == "hidden") ? true : false;
    var isDisplay = (el.style.display == "none") ? true : false;
    
    el.style.visibility = isVisible ? "visible" : "hidden";
    el.style.display = isDisplay ? "inline" : "none";
}

function toggleMenuOnlyOne(elName) {
    //¸ÕÀú ¸Þ´ºÀÇ ¸ðµç spanÀ» ´Ý´Â´Ù
    var xl = document.getElementsByTagName("SPAN");
    for(var i=0; i<xl.length; i++) {
        //Å¸ÀÌÆ²(Á¦¸ñÇ¥½Ã) span tag´Â Á¦¿ÜÇÑ´Ù.
        if(xl[i].getAttribute("classname") != "title") {
            xl[i].style.visibility = "hidden";
            xl[i].style.display = "none";
        }
    }        
    var el = document.getElementById(elName);
    var isVisible = (el.style.visibility == "hidden") ? true : false;    
    el.style.visibility = isVisible ? "visible" : "hidden";
    el.style.display = isVisible ? "inline" : "none";
}

function toggleMenuAllOpen() {
    //¸ðµç ¸Þ´º¸¦ ¿­¾î ³õ´Â´Ù
    var xl = document.getElementsByTagName("SPAN");
    for(var i=0; i<xl.length; i++) {
        //Å¸ÀÌÆ²(Á¦¸ñÇ¥½Ã) span tag´Â Á¦¿ÜÇÑ´Ù.
        if(xl[i].getAttribute("classname") != "title"
        && xl[i].id.substring(0,4) == "menu" ) {
            xl[i].style.visibility = "visible";
            xl[i].style.display = "inline";
        }
    }               
    //¸Þ´º»óÅÂÁ¤º¸¸¦ ÄíÅ°¿¡ ÀúÀåÇÑ´Ù
    setCookie("leftMenu", "OPEN", 365);      
}

function toggleMenuAllClose(elName) {
    //¸ðµç ¸Þ´º¸¦ ¿­¾î ³õ´Â´Ù
    var xl = document.getElementsByTagName("SPAN");
    for(var i=0; i<xl.length; i++) {
        //Å¸ÀÌÆ²(Á¦¸ñÇ¥½Ã) span tag´Â Á¦¿ÜÇÑ´Ù.
        if(xl[i].getAttribute("classname") != "title"
        && xl[i].id.substring(0,4) == "menu" ) {
            xl[i].style.visibility = "hidden";
            xl[i].style.display = "none";
        }
    }  
    var el = document.getElementById(elName);
    var isVisible = (el.style.visibility == "hidden") ? true : false;    
    el.style.visibility = isVisible ? "visible" : "hidden";
    el.style.display = isVisible ? "inline" : "none";  
    
    //¸Þ´º»óÅÂÁ¤º¸¸¦ ÄíÅ°¿¡ ÀúÀåÇÑ´Ù
    setCookie("leftMenu", "CLOSE", 365);    
}

 /**
  * ÄíÅ°°ª °¡Á®¿À±â
  */
function getCookie(key)	{
  	var cook = document.cookie + ";";
  	var idx =  cook.indexOf(key, 0);
  	var val = "";
 
  	if(idx != -1) {
    	cook = cook.substring(idx, cook.length);
    	begin = cook.indexOf("=", 0) + 1;
    	end = cook.indexOf(";", begin);
    	val = unescape( cook.substring(begin, end) );
  	}
 
  	return val;
}

/**
 * ÄíÅ°°ª ¼³Á¤
 */
function setCookie(name, value, expiredays) {
    var today = new Date();
    today.setDate( today.getDate() + expiredays );
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";"
}
    
/*******************************************************************
 * ³¯Â¥ °ü·Ã ½ºÅ©¸³Æ® ¸ðÀ½
 *******************************************************************/

/**
 * ³¯Â¥ Çü½Ä Ã³¸® ÇÔ¼ö(YYYY-MM-DD)
 * »ç¿ë¹ý:
 * <input type="text" size="10" name="fromdate" value="<%=fromdate%>" onfocus="delDateHyphen(this)" onblur="addDateHyphen(this)">
 *
 * "-" Ãß°¡ : 19961230(8ÀÚ¸®) => 1996-12-30(10ÀÚ¸®)
 */
function addDateHyphen( date ) {

    var newVal  = "";
    var Year = "";

    if(date.value.length < 8) return;
    if(date.value.length == 8) {
        newVal = date.value.substring(0,4);
        newVal += "-";
        newVal += date.value.substring(4,6);
        newVal += "-";
        newVal += date.value.substring(6,8);
    } else {
        // ¸¸¾à ÇöÀç "-"ÀÌ ÀÖ´Ù¸é
        for(var x = 0; x < date.value.length ; x++) {
               ch= date.value.substring(x,x+1);
               if( ch == "-") return;
        }

        newVal += date.value.substring(0,4);
        newVal += "-";
        newVal += date.value.substring(4,6);
        newVal += "-";
        newVal += date.value.substring(6,8);
    }
    date.value = newVal;
    return;
}

/**
 * ÀÏÀÚ Á¶Á¤
 * 
 * "-" »èÁ¦ : 1996-12-30(10ÀÚ¸®) => 19961230(8ÀÚ¸®)
 */
function delDateHyphen(date) {
    var  x, ch;
    var  i=0;
    var  newVal="";

    if( date.value.length != 10 ) return;
    for(x = 0; x < date.value.length ; x++) {
        ch= date.value.substring(x,x+1);
        if( ch != "-") newVal += ch;
    }
    date.value = newVal;
    date.select();
    return;
}

/**
 * ³¯Â¥ Çü½Ä Ã³¸® ÇÔ¼ö(YYYY-MM)
 *
 * "-" Ãß°¡ : 199612(6ÀÚ¸®) => 1996-12(7ÀÚ¸®)
 *
 * »ç¿ë¹ý:
 * <input type="text" size="10" name="fromdate" value="<%=fromdate%>" onfocus="delDateHyphen(this)" onblur="addMonthlyHyphen(this)">
 */
function addMonthlyHyphen( date ) {
    var newVal  = "";
    var Year = "";

    if(date.value.length < 6) return;
    if(date.value.length == 6) {
        newVal = date.value.substring(0,4);
        newVal += "-";
        newVal += date.value.substring(4,6);
    } else {
        // ¸¸¾à ÇöÀç "-"ÀÌ ÀÖ´Ù¸é
        for(var x = 0; x < date.value.length ; x++) {
               ch= date.value.substring(x,x+1);
               if( ch == "-") return;
        }

        newVal += date.value.substring(0,4);
        newVal += "-";
        newVal += date.value.substring(4,6);
    }
    date.value = newVal;
    return;
}

/**
 * ³¯Â¥ ÇÊµå Á¶Á¤
 * 
 * "-" »èÁ¦ : 1996-12(7ÀÚ¸®) => 199612(6ÀÚ¸®)
 */
function delMonthHyphen(date) {
    var  x, ch;
    var  i=0;
    var  newVal="";

    if( date.value.length != 7 ) return;
    for(x = 0; x < date.value.length ; x++) {
        ch= date.value.substring(x,x+1);
        if( ch != "-") newVal += ch;
    }
    date.value = newVal;
    date.select();
    return;
}

/**
 * ¿Ã¹Ù¸¥ ³¯Â¥Çü½ÄÀÎÁö¸¦ ÆÇ´ÜÇÑ´Ù.
 */
function isDate(as_date){
    var xflag = false;
    
    if(as_date.value=="") { 
        return true;
    }
    
    if(as_date.value.length != 10) {
        xflag = true;
    } else { 
        var li_yy=as_date.value.substring(0,4);
        var li_mm=as_date.value.substring(5,7);
        var li_dd=as_date.value.substring(8,10);
        
        if ((li_yy<1)||(li_mm<1)||(li_dd<1)) { //³â¿ùÀÏÀÌ ¿µ¶Ç´Â À½¼öÀÏ°æ¿ì
            xflag = true;
        } else if ((li_mm==1) ||(li_mm==3) ||(li_mm==5) ||(li_mm==7) ||(li_mm==8) ||(li_mm==10) ||(li_mm==12)){ //1,3,5,7,8,10,12¿ùÀÎ°æ¿ì(31ÀÏ)
            if(li_dd>31){ //31ÀÏº¸´Ù Å«°æ¿ì
                xflag = true;
            }
        } else if((li_mm==4)||(li_mm==6)||(li_mm==9)||(li_mm==11)){ //4,6,9,11¿ùÀÎ°æ¿ì(30ÀÏ)
            if(li_dd>30){ //30ÀÏº¸´Ù Å«°æ¿ì
                xflag = true;
            }
        } else if(li_mm==2){ //2¿ùÀÎ°æ¿ì
            if(IsLeapYear(li_yy)==true){ //À±³â
                if(li_dd>29){ //29ÀÏº¸´Ù Å«°æ¿ì
                    xflag = true;
                }
            } else { //Æò³â
                if(li_dd>28){//28ÀÏº¸´Ù Å«°æ¿ì
                    xflag = true;
                }
            }
        } else {//¿ù¹üÀ§¸¦ ¹þ¾î³­°æ¿ì
            xflag = true;
        }
    }
            
    if(xflag) {
        alert("³¯Â¥ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù");
        as_date.select();
        //showCalendar(as_date);
        return false;
    } else {
        return true;
    }
}

/**
 * (±ÇÀåÇÏÁö ¾ÊÀ½, isDate¸¦ »ç¿ëÇÏ½Ã¿À)
 * ¿Ã¹Ù¸¥ ³¯Â¥Çü½ÄÀÎÁö¸¦ ÆÇ´ÜÇÑ´Ù.
 */
function IsDate(as_date){
    var li_yy=as_date.value.substring(0,4);
    var li_mm=as_date.value.substring(5,7);
    var li_dd=as_date.value.substring(8,10);
    if(as_date.value=="") {
        return true;
    } else {
        if ((li_yy<1)||(li_mm<1)||(li_dd<1)) { //³â¿ùÀÏÀÌ ¿µ¶Ç´Â À½¼öÀÏ°æ¿ì
            alert("³¯Â¥ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù");
            as_date.select();
            return false;
        } else if ((li_mm==1) ||(li_mm==3) ||(li_mm==5) ||(li_mm==7) ||(li_mm==8) ||(li_mm==10) ||(li_mm==12)){ //1,3,5,7,8,10,12¿ùÀÎ°æ¿ì(31ÀÏ)
            if(li_dd>31){ //31ÀÏº¸´Ù Å«°æ¿ì
                alert("³¯Â¥ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù");
                as_date.select();
                return false;
            }
        } else if((li_mm==4)||(li_mm==6)||(li_mm==9)||(li_mm==11)){ //4,6,9,11¿ùÀÎ°æ¿ì(30ÀÏ)
            if(li_dd>30){ //30ÀÏº¸´Ù Å«°æ¿ì
                alert("³¯Â¥ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù");
                as_date.select();
                return false;
            }
        } else if(li_mm==2){ //2¿ùÀÎ°æ¿ì
            if(IsLeapYear(li_yy)==true){ //À±³â
                if(li_dd>29){ //29ÀÏº¸´Ù Å«°æ¿ì
                    alert("³¯Â¥ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù");
                    as_date.select();
                    return false;
                }
            } else { //Æò³â
                if(li_dd>28){//28ÀÏº¸´Ù Å«°æ¿ì
                    alert("³¯Â¥ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù");
                    as_date.select();
                    return false;
                }
            }
        } else {//¿ù¹üÀ§¸¦ ¹þ¾î³­°æ¿ì
            alert("³¯Â¥ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù");
            as_date.focus();
            return false;
        }
        return true;
    }
}

function IsLeapYear(ai_year){ //À±³â¿©ºÎ È®ÀÎ
    if((ai_year%4)==0){ //³âµµ¸¦ 4·Î ³ª´©¾îÁö´Â °æ¿ì(À±³â´ë»ó)
        if((ai_year%100)==0){ //³âµµ¸¦ 100À¸·Î ³ª´©¾îÁö´Â °æ¿ì(À±³â´ë»ó)
            if((ai_year%400)==0){ //³âµµ¸¦ 400À¸·Î ³ª´©¾îÁö´Â °æ¿ì(À±³â)
                return true;
            } else{ //400À¸·Î ³ª´©¾îÁöÁö¾Ê´Â°æ¿ì(Æò³â)
                return false;
            }
        } else { //³âµµ¸¦ 100À¸·Î ³ª´©¾îÁöÁö ¾Ê´Â°æ¿ì(À±³â)
            return true;
        }
    } else { //³âµµ¸¦ 4·Î³ª´©¾îÁöÁö ¾Ê´Â°æ¿ì(Æò³â)
        return false;
    }
}

function chkDateSeq( date1, date2 ) {
    if(date1.value=="" && date2.value=="") {
        return true;
    }else{
        if( date1.value != "" && date2.value == "") {
            alert("Á¾·áÀÏÀÚ¸¦ ³Ö¾î ÁÖ½Ê½Ã¿À!");
            date2.focus();
            return false;
        }
        if( date1.value == "" && date2.value != "") {
            alert("½ÃÀÛÀÏÀÚ¸¦ ³Ö¾î ÁÖ½Ê½Ã¿À!");
            date1.focus();
            return false;
        }
        if( date1.value > date2.value) {
            alert ("½ÃÀÛÀÏÀÌ Á¾·áÀÏ º¸´Ù ´Ê½À´Ï´Ù.");
            date2.focus();
            return false;
        }
    }
}

/**
*ÇöÀçÀÏÀÚ¿Í ºñ±³ÇÏ±â
*/
function chkDateSeq2(date, toDay) {
    if(date.value=="" ) {
        return true;
    }else{
        if( date.value < toDay.value) {
            alert ("°ú°ÅÀÏÀÚ¸¦ ÁöÁ¤ÇØ¼­´Â ¾ÈµË´Ï´Ù.");
            date.value = toDay.value;
            date.focus();
            return false;
        } else {
            return true;
        }
    }
}

/**
 * µÎ°³ÀÇ ÇÊµå·Î ³¯Â¥°£°ÝÀ» ³ªÅ¸³»¾ß ÇÒ °æ¿ì »ç¿ë, calendar.js °¡ ÇÊ¿äÇÔ.
 * ¿¹ : <input type="text" class="input" name="fFromDate" id="fFromDate" size="11" maxlength="10" value="<%=fFromDate%>" onfocus="delDateHyphen(this)" onblur="addDateHyphen(this); if(isDate(this)) chkDateSeq3(this,this,document.mainx.fToDate);" onkeydown="if(event.keyCode==13) movePage(<%=pageNum%>)"><img src="/images/down2.gif" align="absmiddle" border="0" style="cursor:pointer" onclick="showCalendar(document.getElementById('fFromDate'));"> -
 *      <input type="text" class="input" name="fToDate" id="fToDate" size="11" maxlength="10" value="<%=fToDate%>" onfocus="delDateHyphen(this)" onblur="addDateHyphen(this); if(isDate(this)) chkDateSeq3(this,document.mainx.fFromDate,this);" onkeydown="if(event.keyCode==13) movePage(<%=pageNum%>)"><img src="/images/down2.gif" align="absmiddle" border="0" style="cursor:pointer" onclick="showCalendar(document.getElementById('fToDate'));">
 */
function chkDateSeq3( cntl, date1, date2 ) {
    if(date1.value=="" && date2.value=="") {
        return true;
    } else {
        if( date1.value != "" && date2.value == "") {
            alert("Á¾·áÀÏÀÚ¸¦ ³Ö¾î ÁÖ½Ê½Ã¿À!");
            //showCalendar(date2);
            return false;
        }
        if( date1.value == "" && date2.value != "") {
            alert("½ÃÀÛÀÏÀÚ¸¦ ³Ö¾î ÁÖ½Ê½Ã¿À!");
            //showCalendar(date1);
            return false;
        }
        if( date1.value > date2.value) {
            alert ("½ÃÀÛÀÏÀÌ Á¾·áÀÏ º¸´Ù ´Ê½À´Ï´Ù.");
            //showCalendar(cntl);
            return false;
        }
    }
}

/**
*ÇöÀçÀÏÀÚ¿Í ºñ±³ÇÏ±â, calendar.js °¡ ÇÊ¿äÇÔ.
*/
function chkDateSeq4(date, toDay) {
    if(date.value=="" ) {
        return true;
    }else{
        if( date.value < toDay.value) {
            alert ("°ú°ÅÀÏÀÚ¸¦ ÁöÁ¤ÇØ¼­´Â ¾ÈµË´Ï´Ù.");
            date.value = toDay.value;
            //showCalendar(date);
            return false;
        } else {
            return true;
        }
    }
}

/**
 * ´Þ·Â¾øÀÌ ¿À´ÃÀÇ ³¯Â¥¸¸À» 'YYYY-MM-DD'Çü½ÄÀ¸·Î ¸®ÅÏ
 */
function toDay() {
    now = new Date;

    var dMonth;
    var dDate;
    var dNow;

    if(now.getMonth()+1 > 9) { dMonth = now.getMonth()+1; } else { dMonth = "0"+(now.getMonth()+1); }
    if(now.getDate() > 9) { dDate = now.getDate(); } else { dDate = "0"+now.getDate(); }

    dNow = now.getFullYear() + "-" + dMonth + "-" + dDate;
    return dNow;
}

/**
 * 'YYYY-MM-DD'Çü½ÄÀÇ ³¯Â¥¿¡ ¼ýÀÚÀÇ ÀÏ¼ö ´õÇÏ±â(»©±â)
 */
function addDate(baseDate,addDay) {
    var yr = baseDate.substring(0,4);
    var mn = baseDate.substring(5,7)-1;
    var dy = baseDate.substring(8,10);

    var A = new Date(yr,mn,dy);

    //´Ü¼øÈ÷ ¼ýÀÚ·Î ´õÇÏ±â
    A.setDate(A.getDate() + parseInt(addDay));

    //ÃÊ·Î È¯»êÇÏ¿© ´õÇÏ±â.
    /*var aTime = A.getTime();
    aTime = aTime + parseInt(addDay)*24*60*60*1000;
    A.setTime(aTime);*/

    var rYear = A.getFullYear();
    var rMonth = A.getMonth()+1;
    var rDay = A.getDate();

    if(rMonth<10) rMonth = "0" + rMonth;
    if(rDay<10) rDay = "0" + rDay;

    var B = rYear + "-" + rMonth + "-" + rDay;

    return B;
}

/**
 * 'YYYY-MM-DD'Çü½ÄÀÇ Æ¯Á¤ ³¯Â¥ÀÇ ¿äÀÏ¹ÝÈ¯.
 * ÀÏ¿äÀÏ : 0 ~ Åä¿äÀÏ : 6 À¸·Î ¹ÝÈ¯.
 */
function calcWeekDay(sDate) {

    var nYear = sDate.substring(0,4);
    var nMonth = sDate.substring(5,7)-1;
    var nDay = sDate.substring(8,10);

    var xDate = new Date(nYear,nMonth,nDay);
    nYear = xDate.getFullYear();
    nMonth = xDate.getMonth()+1;
    nDay = xDate.getDate();

    if(nMonth >= 3) {
        nMonth -= 2;
    } else {
        nMonth += 10;
    }

    if( (nMonth == 11) || (nMonth == 12) ){
        nYear--;
    }

    var nCentNum = parseInt(nYear / 100);
    var nDYearNum = nYear % 100;

    var g = parseInt(2.6 * nMonth - .2);

    g += parseInt(nDay + nDYearNum);
    g += nDYearNum / 4;
    g = parseInt(g);
    g += parseInt(nCentNum / 4);
    g -= parseInt(2 * nCentNum);
    g %= 7;

    if(nYear >= 1700 && nYear <= 1751) {
        g -= 3;
    } else {
        if(nYear <= 1699) {
            g -= 4;
        }
    }

    if(g < 0) {
        g += 7;
    }

    return g;
}

/** ½Ã°£ À¯Æ¿ **/
/** 
 * ½ÃºÐÇ¥±â¿¡ ":" Ãß°¡ : 1230(4ÀÚ¸®) => 12:30(5ÀÚ¸®)
 */
function addTimeColon(oTime) {

    var newVal  = "";
    var Year = "";

    if(oTime.value.length < 4) return;
    if(oTime.value.length == 4) {
        newVal = oTime.value.substring(0,2);
        newVal += ":";
        newVal += oTime.value.substring(2,4);
    } else {
        // ¸¸¾à ÇöÀç "-"ÀÌ ÀÖ´Ù¸é
        for(var x = 0; x < oTime.value.length ; x++) {
            ch = oTime.value.substring(x,x+1);
            if( ch == ":") return;
        }

        newVal += oTime.value.substring(0,2);
        newVal += ":";
        newVal += oTime.value.substring(2,4);
    }
    oTime.value = newVal;
    return;
}

/** 
 * ½ÃºÐÇ¥±â¿¡ ":" »èÁ¦ : 12:30(5ÀÚ¸®) => 1230(4ÀÚ¸®)
 */
function delTimeColon(oTime) {
    var  x, ch;
    var  i=0;
    var  newVal="";

    if( oTime.value.length != 5 ) return;
    for(x = 0; x < oTime.value.length ; x++) {
        ch= oTime.value.substring(x,x+1);
        if( ch != ":") newVal += ch;
    }
    oTime.value = newVal;
    oTime.select();
    return;
}

/** 
 * ½ÃºÐÇ¥±â°¡ Á¦´ë·Î µÇ¾ú´ÂÁö È®ÀÎ.
 */
function isHourMinute(oTime) {
    var xFlag = false;
    var hour = 0;
    var minute = 0;

    if(oTime.value=='') return true;

    if(oTime.value.length==5) {
        hour = oTime.value.substring(0,2);
        minute = oTime.value.substring(3,5);
        if(hour=='' || hour<0|| hour>23) xFlag = true;
        if(minute=='' || minute<0 || minute>59) xFlag = true;
    } else {
    	xFlag = true;
    }
    //alert("hour: "+hour+", minute: "+minute);
    if(xFlag) {
        alert("½Ã¿Í ºÐÀÇ ÀÔ·ÂÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");
        oTime.select();
        return false;
    } else {
        return true;
    }
}

/**
 * ½ÃÀÛ½Ã°¢ÀÌ Á¾·á½Ã°¢º¸´Ù °°°Å³ª ÀÛÀºÁö È®ÀÎ
 */
function chkTimeSeq(sTime, cTime) {
    if(sTime.value!='' && cTime.value!='') {
        if(sTime.value > cTime.value) {
            alert("Á¾·á½Ã°¢ÀÌ ½ÃÀÛ½Ã°¢º¸´Ù ¾Õ¼³ ¼ö ¾ø½À´Ï´Ù.");
            cTime.select();
            return false;
        } else {
            return true;
        }
    } else {
        return false;
    }
}

/*******************************************************************
 * ±âÅ¸ À¯Æ¿ ½ºÅ©¸³Æ® ¸ðÀ½
 *******************************************************************/

/*
 * ÅØ½ºÆ® ¹Ú½º¿¡ ±âº» ¸Þ½ÃÁö¸¦ º¸¿©ÁÖ´Â ÇÔ¼ö
 * »ç¿ë¹ý: <input type="text" value="°Ë»ö¾î¸¦ ÀÔ·Â ÇÏ¼¼¿ä" onfocus="clearText(this)">
 */
function clearText(thefield) {
    if(thefield.defaultValue==thefield.value) {
        thefield.value = "";
        thefield.focus();
    }
}

/*
 * ¿ÀÁ÷ ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ´Â ÇÔ¼ö
 * »ç¿ë¹ý: <input type="text" value="" onKeyDown="onlyNumber(event);" onBlur="if(isNaN(this.value)) this.value='';">
 * ¼Ò¼öÁ¡À» À§ÇØ¼­ '.'Àº Á¦¿ÜÇÑ´Ù.
 * 2005-04-19 sykim ¼Ò¼ýÁ¡ ÄÞ¸¶'.'Ç¥½Ã Ãß°¡.
 * keyCode 8 : BackSpace
 * keyCode 9 : Tab
 * keyCode 13 : Enter
 * keyCode 37 : ¡ç Key
 * keyCode 39 : ¡æ Key
 * keyCode 46 : Delete Key
 * keyCode 110 : ¼ýÀÚÆÐµå ÄÞ¸¶'.'
 * keyCode 190 : ¹®ÀÚÆÐµå ÄÞ¸¶'.'
 * keyCode 48 ~ 57 : ¹®ÀÚÆÐµå ¼ýÀÚ 0 ~ 9
 * keyCode 96 ~ 105 : ¼ýÀÚÆÐµå ¼ýÀÚ 0 ~ 9
 */
function onlyNumber(event) {

    if( (event.keyCode==8) || (event.keyCode==9) || (event.keyCode==13) ||
        (event.keyCode==37) || (event.keyCode==39) || (event.keyCode==46) ||
        (event.keyCode==110) || (event.keyCode==190) ||
        ((event.keyCode>=48)&&(event.keyCode<=57)) ||
        ((event.keyCode>=96)&&(event.keyCode<=105)) ) {
        event.returnValue=true;
    } else {
        event.returnValue=false;
    }
}

function commaSplit(str) {
    str = ""+str+"";
    var retValue = "";
    for(i=0; i<str.length; i++) {
        if(i > 0 && (i%3)==0) {
            retValue = str.charAt(str.length - i -1) + "," + retValue;
        } else {
            retValue = str.charAt(str.length - i -1) + retValue;
        }
    }
    return retValue
}

/**
 * ¿øÇÏ´Â ÆäÀÌÁö·Î ÀÌµ¿
 * »ç¿ë¹ý: onclick="goPage('xxx.jsp');
 */
function goPage(pg) {
    location.href=pg;
}

/**
 * ¼±ÅÃÇÑ ÆäÀÌÁö ÀÎ¼â.
 * »ç¿ë¹ý: onclick="printPage();"
 */
function printPage() {
    if(window.print) {
        window.print()
    } else {
        alert("ÀÌ ºê¶ó¿ìÀú´Â ÀÎ¼â ±â´ÉÀ» Áö¿øÇÏÁö ¾Ê½À´Ï´Ù!");
    }
}

/**
 * ¼±ÅÃ½Ã Å×ÀÌºí ¿­ÀÇ »ö±òÀ» º¯ÇÏ°Ô ÇÕ´Ï´Ù.
 * val: check box, cname: Æ÷Ä¿½º ÄÁÆ®·Ñ, fgcolor: ±ÛÀÚ»ö, bgcolor: ¹è°æ»ö
 */
function changRowColor(val,cname,fgcolor,bgcolor) {
    if(val.checked) {
        while (val.tagName!="TR") {
            val=val.parentElement;
        }
        val.style.color=fgcolor;
        val.style.backgroundColor=bgcolor;
        cname.select();
    } else {
        while (val.tagName!="TR") {
            val=val.parentElement;
        }
        val.style.color="";
        val.style.backgroundColor="";
    }
}
/**
 * ¹öÆ°ÀÇ »ö±ò º¯°æÇÕ´Ï´Ù.
 * »ç¿ë¹ý: <form onMouseover="changeBtnColor('gold')" onMouseout="changeBtnColor('')">
 */
function changeBtnColor(color){
    if(navigator.appName=="Microsoft Internet Explorer") {
        if (event.srcElement.tagName=="INPUT")
            event.srcElement.style.backgroundColor=color
    }
}

function changeBtnFontColor(color) {
    if(navigator.appName=="Microsoft Internet Explorer") {
        if(event.srcElement.tagName=="INPUT")
            event.srcElement.style.color=color
    }
}

/** 
 * »ç¿ë¹ý: <img src="ÀÌ¹ÌÁöURL" onmouseover="rolloverImage(this,'_line')" onmouseout="rolloverImage(this,'_line')" />
 */
function rolloverImage(obj,postfix) {
    var imgsrc = obj.src; 
    var imgdir = imgsrc.substring(0,imgsrc.lastIndexOf("/")); 
    var imgname = imgsrc.substring(imgsrc.lastIndexOf("/"),imgsrc.lastIndexOf(".")); 
    var imgext = imgsrc.substring(imgsrc.lastIndexOf("."),imgsrc.length); 
    
    if(imgname.indexOf("_") > 0) {
        imgname = imgname.substring(0,imgname.indexOf("_")); 
    } else { 
        imgname = imgname + postfix; 
    }
    
    obj.src = imgdir + imgname + imgext; 
    return true; 
} 


/**
 * CheckÇ×¸ñµéÀ» ¸ðµÎ Ã¼Å©ÇÏ°Ô ÇÏ°Å³ª ¸ðµÎ ÇØÁ¦ÇÕ´Ï´Ù.
 * »ç¿ë¹ý : onclick È¤Àº <a href= ¿¡ ±â¼úÇÔ, parameter´Â ¹è¿­¸í
 */
var isChecked = false;

function checkAll(control) {
    var X=eval("document.mainx."+control);
    
    if(!isChecked) {
        if(X.length==null) {
            X.checked=true;
        } else {
            for(i=0;i<X.length;i++) {
                X[i].checked=true;
            }
        }
        isChecked = true;
    } else {
        if(X.length==null) {
            X.checked=false;
        } else {
            for(i=0;i<X.length;i++) {
                X[i].checked=false;
            }
        }
        isChecked = false;
    }
}

/**
 * CheckÇ×¸ñ src´Â ´Ù¸¥ Check Ç×¸ñµéÀÎ tarµéÀ» ¸ðµÎ Ã¼Å©ÇÏ°Ô ÇÏ°Å³ª ¸ðµÎ ÇØÁ¦ÇÕ´Ï´Ù.
 * »ç¿ë¹ý : <input type="checkbox" id="chkx" name="chka" onclick="checkalls('chkx','chk')"> --> src
 *          <input type="checkbox" name="chk" value="<%=³Ñ±æ°ª%>" onclick="checkout('chka');"> --> tar
 */
function checkalls(src,tar) {
    var X=eval("document.mainx."+src);
    var Y=eval("document.mainx."+tar);
    if(X.checked==true) {
        if(Y.length==null) {
            Y.checked=true;
        } else {
            for(i=0;i<Y.length;i++) { Y[i].checked=true; }
        }
    } else {
        if(Y.length==null) {
            Y.checked=false;
        } else {
            for(i=0;i<Y.length;i++) { Y[i].checked=false; }
        }
    }
}

/**
 * À§ÀÇ checkalls¿¡¼­ Â¦À¸·Î »ç¿ëµÈ´Ù. ¿©·¯ tarÁß¿¡ ÇÏ³ª¶óµµ checkoutÇÏ¸é srcµµ checkoutÇÑ´Ù.
 * »ç¿ë¹ýÀº checkallsÀÇ ¼³¸í¿¡ ÀÖÀ½.
 */
function checkout(name) {
    var X=eval("document.mainx."+name);
    X.checked=false;
}

/**
 * ÁÖ·Î textarea¿¡¼­ ±ÛÀÚ¼ö¸¦ Á¦ÇÑÇÒ¶§ »ç¿ëÇÑ´Ù.
 * textareaLimitColor([Á¦ÇÑ±ÛÀÚ¼ö])¿Í Â¦À¸·Î »ç¿ëµÊ.
 * »ç¿ë¹ý:100±ÛÀÚ·Î Á¦ÇÑÇÏ°íÀÚ ÇÒ °æ¿ì (onblur È¤Àº onchange¿¡ »ç¿ë)
 * <textarea ... onblur="textareaLimitGetNames(this.form.name,this.name,100)">
 *
 */
function textareaLimitGetNames(formName,fieldName,limit) {
    var textareaFormObj=document.getElementById(formName);
    var textareaObj=document.getElementById(fieldName);
    
    if(textareaObj.value.length <= limit) {
        textareaObj.style.backgroundColor="";
    } else {
        textareaObj.style.backgroundcolor="#FFFFFF";
        alert(limit+"ÀÚ ÀÌ³»·Î ÀÛ¼ºÇØ ÁÖ½Ê½Ã¿À.");
        textareaObj.value = textareaObj.value.substring(0,limit);
        textareaObj.select();
    }
}


/**
 * ¼ýÀÚ¸¦ ±Ý¾×ÀÇ Ç¥ÇöÀ¸·Î(ÄÞ¸¶¸¦ »ðÀÔ) ¹Ù²Ü ¶§ »ç¿ëµÈ´Ù.
 * presentCash()¿Í cashReturn()Àº Â¦À¸·Î »ç¿ëµÈ´Ù.
 * »ç¿ë¹ý : <input... onKeyDown="onlyNumber()" onKeyUp="presentCash(this);"
 * ÁÖÀÇ»çÇ× : 16ÀÚ¸®±îÁö¸¸ ¼ýÀÚÇã¿ëÇÏµµ·Ï ÇÑ´Ù.
 */
function presentCash(val) {
    var tmpstr = "";
    var cash = eval(val);
    if(cash.value=="" || cash.value==null) {
        cash.value = "0";
    }
    var len = cash.value.length;
    for (var i=0 ; i<len ; i++) {
        if(cash.value.charAt(i)!=',') {
            tmpstr = tmpstr + cash.value.charAt(i);
        } else {
            tmpstr = tmpstr + '';
        }
    }
    var amt = parseInt(tmpstr);
    cash.value = (amt==0 ? "" : cashReturn(amt));
}

//¼ýÀÚ¸¦ ±Ý¾×Çü½ÄÀ¸·Î ¸®ÅÏ (000,000,000)
function cashReturn(num) {
    var numValue = "" + num;
    var cashReturn = "";
    for (var i=numValue.length-1 ; i>=0 ; i--) {
        cashReturn = numValue.charAt(i) + cashReturn;
        if(i!=0 && i%3==numValue.length%3) {
            cashReturn = "," + cashReturn;
        }
    }
    return cashReturn;
}

/**
 * ÇöÀç½Ã°£À» Ç¥ÇöÇÑ´Ù.
 * »ç¿ë¹ý: onload ¼³Á¤, <span id="liveclock"></span>
 */
function showCurrentTime(){

    var curtime = new Date();
    var hours = curtime.getHours();
    var minutes = curtime.getMinutes();
    var seconds = curtime.getSeconds();
    var dn = "¿ÀÀü";
    
    if (hours>12) { 
        dn = "¿ÀÈÄ";
        hours = hours - 12;
    }
    if (hours == 0) hours=12;
    if (minutes <= 9) minutes = "0" + minutes;
    if (seconds<=9) seconds = "0" + seconds;
    
    // ±Û²ÃÀ» ¼öÁ¤ ÇÒ ¼ö ÀÖ½À´Ï´Ù
    var myclock=dn+"&nbsp;" + hours + ":" + minutes + ":" + seconds;
    document.getElementById("liveclock").innerHTML = myclock;
    setTimeout("showCurrentTime()",1000);
    
}


/**
 * Parameter ½Ã°£¸¸Å­ ¶ç¿î Ã¢´Ý±â ½Ã°£À» Áö¿¬ÇÑ´Ù.
 */
function pauseTime(timex){
    var time= new Date();
    hours= time.getHours();
    mins= time.getMinutes();
    secs= time.getSeconds();
    closeTime=hours*3600+mins*60+secs;
    closeTime+=(eval(timex)/1000);
    Timer(timex);
}

function Timer(timex){
    var time= new Date();
    hours= time.getHours();
    mins= time.getMinutes();
    secs= time.getSeconds();
    curTime=hours*3600+mins*60+secs
    if (curTime>=closeTime){
    	self.close();
    }else{
    	window.setTimeout("Timer()",eval(timex));	 // ¿­·ÁÀÖÀ» ½Ã°£
    } 
}

function timer(t) {
    Timer(t);
}

/**
 * Æ¯Á¤ ÀÔ·ÂÇÊµå¿¡ ÇÑ±ÛÀÔ·Â ±ÝÁö
 * <input type="text" name="fieldx" onBlur="hanCheck(this);">
 */
function hanCheck(x) {
    for(i=0 ; i<x.value.length ; i++) {
        var a = x.value.charCodeAt(i);
        if(a > 128) {
            alert('ÀÌ ÇÊµå¿¡´Â ÇÑ±ÛÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù!');
            x.value = "";
            x.focus();
            //x.select();
            return;
        }
    }
}

/**
 * ¸µÅ©¸¦ Å¬¸¯ÇßÀ» °æ¿ì, ÁöÁ¤ÇÑ»ö±ò·Î Å¬¸¯Çß´ø °´Ã¼ÀÇ »ö±òÀ» Ç¥½ÃÇØ µÐ´Ù.
 */
var row_tcolor='';
var row_tid='';

function clickMarking(idx) {
    if(row_tid!='') document.getElementById(row_tid).bgColor = row_tcolor;
    var obj1=document.getElementById(idx);
    row_tcolor='#FFFFFF';
    row_tid=obj1.id;
    obj1.bgColor='#33FFCC';
}

/*
 * Æ¯Á¤ ID¸¦ °¡Áø iframe¿¡ ¿øÇÏ´Â URLÀ» Ç¥½ÃÇÑ´Ù.
 *
 * (Iframe¿¡ POST¹æ½ÄÀ¸·Î ÇÊµå°ªÀ» ³Ñ±æ ¼ö ÀÖ´Ù.)
 */
function showIframePost(idx,urlx) {
    var xForm = document.getElementsByTagName('FORM');
    var xIframe = document.getElementById(idx);
    var thisForm;
    for(var i = 0; i < xForm.length; i++) {
        if(xForm[i].name=='mainx') {
            thisForm = xForm[i];
            break;
        } 
    }
    
    //Ç¥ÁØÀº nameÀÌ¾Æ´Ï¶ó id·Î ¼³Á¤ÇÑ´Ù.
    thisForm.target = xIframe.id;
    thisForm.action = urlx;
    thisForm.submit(); 
}

/*
 * Æ¯Á¤ ID¸¦ °¡Áø iframe¿¡ ¿øÇÏ´Â URLÀ» Ç¥½ÃÇÑ´Ù.
 *
 * (Iframe¿¡ GET¹æ½ÄÀ¸·Î ÇÊµå°ªÀ» ³Ñ±æ ¼ö ÀÖ´Ù.)
 */
function showIframe(idx,url) {
    var xframe=document.getElementById(idx);  
    xframe.src=url;
    
}

function copyText(msg){ 
    var tempTxt = document.getElementById("dummy");
    tempTxt.value = msg; 
    var doc = tempTxt.createTextRange(); 
    tempTxt.select(); 
    doc.execCommand('copy'); 
    alert("Å¬¸³º¸µå·Î º¹»ç µÇ¾ú½À´Ï´Ù. \n\nCtrl + V·Î ºÙ¿©³Ö±â¸¦ ÇÏ¼¼¿ä."); 
} 


/****************************************************************
 * ¸ðµâÀÇÁ¸ÀûÀÎ ½Å±ÔÃß°¡ ÇÔ¼ö ¸ðÀ½
 ****************************************************************/
function addBasicTag(formName) {
    
    var fName = formName;
    if(fName.basictags.value == "") {
        alert("Ãß°¡ÇÒ ÅÂ±×¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À. ÇÏ³ª ÀÌ»óÀÇ ÅÂ±×¸¦ µî·ÏÇÒ °æ¿ì ¹Ýµå½Ã ½°Ç¥(,)·Î ±¸ºÐÇÏ½Ê½Ã¿À!");
        fName.basictags.focus();
        return false;
    } else {
        var xIframe = document.getElementById("hiddenBasicTagIframe");
        fName.target = xIframe.id;
        //fName.target = "_blank";
        fName.action = "/common/addbasictag.asp";
        fName.submit();
        fName.target = ""; 
    }
} 

function setBasicTag(atag) {
    var tfield = document.getElementById("basictags");
    tfield.value = tfield.value.trim();
    
    if(atag != "") {
        if(tfield.value == "") {
            tfield.value = atag;
        } else if(tfield.value.substring(tfield.value.length-1,1)==',') {
            tfield.value = tfield.value+atag;
        } else {
            tfield.value = tfield.value+","+atag;
        }
    }
}

function addBasicTagNoLogin(returnUrl) {
    if(confirm("ÅÂ±×¸¦ Ãß°¡ÇÏ½Ã·Á¸é ·Î±×ÀÎ ÇÏ¼Å¾ß ÇÕ´Ï´Ù.  ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?")) {
        location.href = "/member/login.asp?backurl="+returnUrl;
    } else {
         return false;
    }   
} 

function addBasicCommentNoLogin(returnUrl) {
    if(confirm("±ÛÀ» ³²±â½Ã·Á¸é ·Î±×ÀÎ ÇÏ¼Å¾ß ÇÕ´Ï´Ù.  ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?")) {
        parent.location.href = "/member/login.asp?backurl="+returnUrl;
    } else {
         return false;
    }   
} 

function addRecommendationNoLogin(returnUrl) {
    if(confirm("¸ÕÀú ·Î±×ÀÎ ÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ ÇÏ½Ã°Ú½À´Ï±î?")) {
        parent.location.href = "/member/login.asp?backurl="+returnUrl;
    } else {
         return false;
    }   
} 
  
function doAgree(rType,rId,rIdx,param) {
    var xIframe = document.getElementById("hiddenRecommandationIframe");
    xIframe.src = "/common/addrecommendation.asp?mode=Y&recommendType="+rType+"&recommendId="+rId+"&recommendIdx="+rIdx+"&param="+param;
}  

function showSecureLoginProcessing() {
    var secustv = getCookie("secust");
    if(secustv == "ON") {
        showDivPanel("divSecureProcessing");
    }
}