/**
*   ¸ð´Þ´ëÈ­»óÀÚ
*/
function OpenModal( url, args, width, height, left, top, status, help, scroll, unadorned, edge, center )
{
    status = status ? status : "no";
    help   = help   ? help   : "no";
    scroll = scroll ? scroll : "no";
    center = center ? center : "no";

    var t_exp = "";

    if ( width)  t_exp += "dialogWidth:"  + width   + "px;";
    if ( height) t_exp += "dialogHeight:" + height  + "px;";
    if ( left)   t_exp += "dialogLeft:"   + left    + "px;";
    if ( top)    t_exp += "dialogTop:"    + top     + "px;";

    t_exp += "status:"    + status    + ";";
    t_exp += "help:"      + help      + ";";
    t_exp += "scroll:"    + scroll    + ";";
    t_exp += "center:"    + center    + ";";
    t_exp += "unadorned:" + unadorned + ";";
    t_exp += "edge:"      + edge      + ";";

    return showModalDialog( url, args, t_exp );
}

/*
*   °Ô½ÃÆÇ ¸®½ºÆ® Á¤·Ä ¿É¼Ç ÄíÅ° ¸¸µé±â - ±èÁø±¹
*/
function sortOrder( name, value, expiredays )
{
    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + expiredays );
    document.cookie = name + "=" + escape(value)+ "; path=/; expires=" + todayDate.toGMTString()+ ";";

}

/**
*   ¼ýÀÚ¸¸ ÀÔ·Â - ±èÁø±¹
*/
function numCheck( ts )
{
    var keyPattern = /[\x01-\x2F\x3A-\x7E]/g;
    if ( ts.value.match( keyPattern ) )
    {
        ts.value = ts.value.replace( keyPattern, '' );
    }
    else { return false; }
}

/**
*   ¿µ¹®,¼ýÀÚ¸¸ ÀÔ·Â - ±èÁø±¹
*/
function eng_numCheck( ts )
{
    var keyPattern = /[\x01-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E]/g;
    if ( ts.value.match( keyPattern ) )
    {
        ts.value = ts.value.replace( keyPattern, '' );
    }
    else { return false; }
}

/**
 * ÆË¾÷Ã¢¿­±â  - Á¤·¡¼±
*/
function fn_openWindow (s_link , s_windowName ,  n_windowWidth , n_windowHeight)
{
  var n_left         = Math.floor(window.screen.availWidth/2) - n_windowWidth/2;
  var n_top          = 100;//Math.floor(window.screen.availHeight/2) - n_windowHeight/2;
  var s_windowOption = "left="+n_left+",top="+n_top+",width="+n_windowWidth+",height="+n_windowHeight+",";
    s_windowOption+="scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,resizable=no";
  var o_openWindow   =  window.open( s_link  , s_windowName , s_windowOption);
  o_openWindow.focus();
}


/**
 *  ÂÊÁö ÆË¾÷ ¿­±â
*/
function memo_openWindow()
{
  fn_openWindow(g_WEB_ROOT_MNB+"memo/receive.php","memoWindow",770,480);
}

// 3ÀÚ¸® ¸¶´Ù , Âï±â
function number_format( num )
{
    var len, point, str;
    num   = num+"";           // ¹®ÀÚ¿­ º¯È¯
    point = num.length % 3;   //Ä¿¼­À§Ä¡¸¦ Àâ½À´Ï´Ù. 3À¸·Î ³ª´« ³ª¸ÓÁö·Î ÀÚ¸®¸¦ Àâ¾Æ ½ÃÀÛ
    len   = num.length;

    str   = num.substring( 0, point );

    while( point < len )
    {
        if ( str != "" ) str += ",";
        str   += num.substring( point , point + 3 );
        point +=3;
    }
    return str;
}