
function SendDelete(form)
{
    if( confirm("Á¤¸»·Î »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?") )
        form.submit();
    else
        return;
}


function DeleteConfirm()
{
    if( confirm("Á¤¸»·Î »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?") )
        return true;
    else
        return false;
}


/*++*
function classProperty()
{
    this.name = "";
    this.id = "";

    this.title = "";
    this.content = "";
    this.link = "";
    this.writer = "";
    this.comment = "";
    this.regdate = "";
    this.reader = "";

    this.writelink = "";
    this.deletelink = "";
}
/*--*/


function attrComment()
{
    this.name = "";
    this.num = "";      // comment key value
    this.comment = "";
    this.writer = "";   // comment writer's ID
    this.regdate = "";  // yyyy.mm.dd
}


function classParam(name, value)
{
    this.name = "";
    this.value = "";

    if( name != undefined )
        this.name = name;

    if( value != undefined )
        this.value = value;
}


function classComment_2(parent_num)
{
    //var comment_id = "";
    this.id = "";
    this.name = "";

    this.parent_num = "";
    this.writepage = "";        // write page's url except parameter
    this.deletepage = "";       // delete page's url except parameter
    this.curdate = "";
    this.visibility = "hidden"; // visible/hidden
    this.reader = "";           // current reader's ID

    this.returl = "";           // returl must be encoded by "Server.URLEncode" VBScript at server-side
    this.comments = new Array();

    if( parent_num != undefined && parent_num != "" )
    {
        this.parent_num = parent_num;
        this.setID("Comment_" + parent_num);
    }

    this.setID = function classComment_setID(id)
    {
        if( id != undefined )
            this.id = "Comment_" + id;
        else
        {
            if( this.parent_num != "" )
                this.id = "Comment_" + this.parent_num;
                //comment_id = "Comment_" + this.parent_num;
        }

        //return comment_id;
        return this.id;
    }

    this.getID = function classComment_getID()
    {
        //return comment_id;
        return this.id;
    }

    this.add = function classComment_add(num, writer, comment, regdate)
    {
        var i = this.comments.length;

        this.comments[i] = new attrComment();
        if( num != undefined )
        {
            this.comments[i].num = num;
            this.comments[i].writer = writer;
            this.comments[i].comment = comment;
            this.comments[i].regdate = regdate;
        }

        return this.comments[i];
    }

    this.getCount = function classComment_getCount()
    {
        return this.comments.length;
    }

    this.render = function classComment_render()
    {

        var i;
        var html = "";

        //if( this.id = "" ) this.id = "Comment_" + this.parent_num;
        if( comment_id = "" ) this.setID(this.parent_num);

        html = '<span id="' + this.id + '" style="visibility:' + this.visibility + ';">'
             + '<table width="603" border="0" cellspacing="0" cellpadding="0">'
        //html = '<table id="' + this.id + '" style="visibility:' + this.visibility + ';"'
        //     + ' width="603" border="0" cellspacing="0" cellpadding="0">'
             +   '<tr>'
             +     '<td>&nbsp;</td>'
             +     '<td>&nbsp;</td>'
             +     '<td height="45" valign="top" align="center" bgcolor="F7F7F7">'

             +       '<table width="520" border="0" cellspacing="3" cellpadding="2">'
             +         '<tr>'
             +           '<td colspan="3" align="center">'
             +             '<table width="505" border="0" cellspacing="0" cellpadding="0">';

        //
        // comment view
        //
        for(i=0; i < this.comments.length; i++)
        {
            html +=          '<tr>'
                 +             '<td width="87"><strong>' + this.comments[i].writer + '</strong></td>'
                 +             '<td width="363" height="25">'
                 +                this.comments[i].comment
                 +               '&nbsp;&nbsp;&nbsp;'
                 +               '<span class="copy">'
                 +                  this.comments[i].regdate
                 +               '</span>&nbsp;';

            if( this.comments[i].regdate == this.curdate )
                html +=          '<img src="/images/2004/icon_new.gif" width="8" height="11">&nbsp;';

            if( this.comments[i].writer == this.reader )
            {
                html +=          '<a href="' + this.deletepage
                     +             '?Num=' + this.comments[i].num
                     +             '&RetUrl=' + this.returl + '">'
                     +             '<img src="/images/icon_new/btn_delete2.gif" border="0" width="26" height="11">'
                     +           '</a>';
            }

            html +=            '</td>'
                 +           '</tr>'
                 +           '<tr>'
                 +             '<td background="/images/common/dot_3_1.gif" colspan="2" height="1"></td>'
                 +           '</tr>';
        }

        html +=            '</table>'
             +           '</td>'
             +         '</tr>';

        //
        // comment write form
        //
        html +=        '<form name="CommentForm" method="post" action="' + this.writepage + '">'
             +         '<input type="hidden" name="Parent" value="' + this.parent_num + '">'
             +         '<input type="hidden" name="RetUrl" value="' + this.returl + '">'
             +         '<tr>'
             +           '<td width="55" valign="top"><img src="/images/common/comment01.gif" width="46" height="13"></td>'
             +           '<td width="410">'
             +             '<textarea name="Comment" cols="54" id="Text1" style="border:1 solid #707070"></textarea>'
             +           '</td>'
             +           '<td width="55" align="right" valign="top">'
             +             '<input type="image" src="/images/icon_new/btn_final.gif" border="0" width="49" height="18">'
             +           '</td>'
             +         '</tr>'
             +         '</form>'
             +       '</table>'

             +     '</td>'
             +   '</tr>'
             +   '<tr>'
             +     '<td height="5" colspan="3"></td>'
             +   '</tr>'
             //+ '</table>'
             //+ '</span>'

             //+ '<table width="603" border="0" cellspacing="0" cellpadding="0">'
             +   '<!-- dot line -->'
             +   '<tr>'
             +     '<td width="60" height="1"></td>'
             +     '<td width="13" height="1"></td>'
             +     '<td width="530" height="1" background="/images/common/dot_3_1.gif"></td>'
             +   '</tr>'
             + '</table>'
             + '</span>';

        return html;
    }
}


function ToggleComment()
{
}


function classArticle_2(num)
{
    this.name = "";
    this.permalink = "";
    this.num = "";
    this.writer = "";

    this.weekday = "";  // day of week
    //this.year = "";
    //this.month = "";
    //this.day = "";
    this.date = "";
    this.post = "";

    this.title = "";
    this.category_str = "";
    //this.category_num = "";
    //this.categorylink = "";
    this.viewlink = "";
    this.modifylink = "";
    this.deletelink = "";

    this.content = "";

    // this params are automatically filled by object Articles
    this.folder = "";
    this.category = "";
    this.page = "";
    this.keyword = "";
    this.keyfield = "";


    if( num != undefined )
        this.num = num;

    this.comment = new classComment(num);

    this.setCommentID = function classArticle_setCommentID(id)
    {
        return this.comment.setID(id);
    }

    this.getCommentID = function classArticle_getCommentID()
    {
        return this.comment.getID();
    }

    this.addComment = function classArticle_addComment(num, writer, comment, regdate)
    {
        return this.comment.add(num, writer, comment, regdate);
    }

    this.render = function classArticle_render()
    {
        var html = "";

        //
        // date/title/post, title/category, etc.
        //
        html =  '<a name="' + this.num + '">'
             +  '<table width="603" border="0" cellspacing="0" cellpadding="0">'
             +    '<tr>'
             +      '<td width="60" valign="top">';

        if( this.weekday != "" && this.date != "" ) //&& this.post != "" )
        {
            // <!-- If this article is last of that day, date & post is showed. -->
            html +=   '<table width="60" height="60" border="0" cellpadding="0" cellspacing="0">'
                 +      '<tr>'
                 +        '<td align="center">'
                 +          '<span class="copy"><font color="#333333">' + this.weekday + '</font></span><br>'
                 +          '<font size="5"><strong>' + this.date + '</strong></font><br>'
                 +          '<span class="copy"><font color="DF0009">post [' + this.post + ']</font></span>'
                 +        '</td>'
                 +      '</tr>'
                 +    '</table>';
                 //+          '<font size="5"><strong>' + this.month + '.' + this.day + '</strong></font><br>'
        }

        //
        // title, category, more...
        //
        html +=     '</td>'
             +      '<td width="13">&nbsp;</td>'
             +      '<td width="530">'
             +        '<table width="520" border="0" cellspacing="0" cellpadding="0">'
             +          '<tr>'
             +            '<td width="480">'
             +              '<strong><img src="/images/icon_new/icon_i_title3.gif" width="7" height="8">&nbsp;'
             +                this.title
             +              '</strong>'
             +            '</td>'
             +            '<td width="40" align="right">'
             //+              '<a href="' + this.viewlink + '">'
             //+                '<img src="/images/icon_new/btn_more.gif" border="0" width="37" height="11">'
             //+              '</a>'
             +            '</td>'
             +          '</tr>'
             +          '<tr>'
             +            '<td>&nbsp;&nbsp;&nbsp;<span class="copy">[ºÐ¾ß : ' 
             +              '<a href="' + this.categorylink + '">' + this.category + '</a>'
             +              ']</span></td>'
             +            '<td>&nbsp;</td>'
             +          '</tr>'
             +        '</table>'
             +      '</td>'
             +    '</tr>'
             +    '<!-- content -->'
             +    '<tr>'
             +      '<td width="60">&nbsp;</td>'
             +      '<td width="13">&nbsp;</td>'
             +      '<td width="530">'
             +        '<font color="#333333">' + this.content + '</font>'
             +      '</td>'
             +    '</tr>'
             +    '<tr>'
             +      '<td colspan="3" height="10"></td>'
             +    '</tr>'
             +    '<!-- dot line -->'
             +    '<tr>'
             +      '<td width="60" height="1"></td>'
             +      '<td width="13" height="1"></td>'
             +      '<td width="530" height="1" background="/images/common/dot_3_1.gif"></td>'
             +    '</tr>'
             +    '<!-- comment, e-mail send, perman link -->'
             +    '<tr>'
             +      '<td>&nbsp;</td>'
             +      '<td width="13">&nbsp;</td>'
             +      '<td width="530" height="25" align="right">';

        // modify
        if( this.modifylink != "" )
        {
            html +=   '<a href="' + this.modifylink + '">'
                 +      '<img src="/images/icon_new/btn_modify2.gif" border="0">'
                 +    '</a>&nbsp;&nbsp;';
        }

        // delete
        if( this.deletelink != "" )
        {
            html +=   '<a href="' + this.deletelink + '">'
                 +      '<img src="/images/icon_new/btn_delete.gif" border="0">'
                 +    '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
        }

                      // comment
        html +=       '<a href="javascript:ShowHide(' + this.comment.getID() + ')">'
             //+        '<a href="javascript:ShowHide(Comment_1)">'
             +          '<img src="/images/common/icon.gif" border="0" width="5" height="5"> '
             +          'comment [' + this.comment.getCount() + ']'
             +        '</a> &nbsp;&nbsp;&nbsp;&nbsp;'
             +        '<!----'
             +        '<img src="/images/common/icon.gif" border="0" width="5" height="5"> e-mail º¸³»±â &nbsp;&nbsp;&nbsp;&nbsp;'
             +        '<img src="/images/common/icon.gif" border="0" width="5" height="5"> perman link&nbsp;&nbsp;'
             +        '<!---->'
             +      '</td>'
             +    '</tr>'
             +  '</table>';

        html += this.comment.render();

        return html;
    }
}


function IsStrEmpty(strValue)
{
    var EmptyStr = " \n\t";
    var i;
    
    if(strValue.length == 0) return true;
    
    for(i=0; i < strValue.length; i++)
    {
    	//if( strValue.charAt(i) != ' ' && strValue.charAt(i) != '\n' )
        if( EmptyStr.indexOf(strValue.charAt(i)) == -1 )
        {
            return false;
        }
    }

    return true;
}


function send_comment(form)
{
    if( !IsStrEmpty(form.Comment.value) )
        return true;
    else
    {
        alert("³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
        form.Comment.focus();
        return false;
    }
}

function classComment(parent_num)
{
    //var comment_id = "";
    this.id = "";
    this.name = "";

    this.parent_num = "";
    this.writepage = "";        // write page's url except parameter
    this.deletepage = "";       // delete page's url except parameter
    this.curdate = "";

    this.isnew = false;

    //this.visibility = "hidden"; // visible/hidden
    this.display = "none";      // none/block
    this.reader = "";           // current reader's ID

    this.folder = "";
    this.category = "";
    this.page = "";
    this.keyfield = "";
    this.keyword = "";

    this.returl = "";           // returl must be encoded by "Server.URLEncode" VBScript at server-side
    this.comments = new Array();

    if( parent_num != undefined && parent_num != "" )
    {
        this.parent_num = parent_num;
        this.setID("Comment_" + parent_num);
    }

    this.setID = function classComment_setID(id)
    {
        if( id != undefined )
            this.id = "Comment_" + id;
        else
        {
            if( this.parent_num != "" )
                this.id = "Comment_" + this.parent_num;
                //comment_id = "Comment_" + this.parent_num;
        }

        //return comment_id;
        return this.id;
    }

    this.getID = function classComment_getID()
    {
        //return comment_id;
        return this.id;
    }

    this.add = function classComment_add(num, writer, comment, regdate)
    {
        var i = this.comments.length;

        this.comments[i] = new attrComment();
        if( num != undefined )
        {
            this.comments[i].num = num;
            this.comments[i].writer = writer;
            this.comments[i].comment = comment;
            this.comments[i].regdate = regdate;
        }

        return this.comments[i];
    }

    this.getCount = function classComment_getCount()
    {
        return this.comments.length;
    }

    this.render = function classComment_render()
    {

        var i;
        var html = "";

        //if( this.id = "" ) this.id = "Comment_" + this.parent_num;
        if( comment_id = "" ) this.setID(this.parent_num);

        //html = '<span id="' + this.id + '" style="visibility:' + this.visibility + ';">'
        //html = '<div id="' + this.id + '" style="visibility:' + this.visibility + ';">'
        html = '<a name="cmt' + this.parent_num + '">'
             + '<div id="' + this.id + '" style="display:' + this.display + ';">'
             + '<table width="603" border="0" cellspacing="0" cellpadding="0">'
             //+ '<table id="' + this.id + '" style="visibility:' + this.visibility + ';"'
             //+ ' width="603" border="0" cellspacing="0" cellpadding="0">'
             +   '<tr>'
             //+     '<td width="13" height="1"></td>'
             +     '<td width="23" height="1"></td>'
             //+     '<td width="590" height="1"></td>'
             +     '<td width="580" height="1"></td>'
             +   '</tr>'
             +   '<tr>'
             +     '<td>&nbsp;</td>'
             +     '<td height="45" valign="top" align="center" bgcolor="F7F7F7">'

             +       '<table width="580" border="0" cellspacing="3" cellpadding="2">'
             +         '<tr>'
             +           '<td colspan="3" align="center">'
             //+             '<table width="505" border="0" cellspacing="0" cellpadding="0">';
             +             '<table width="580" border="0" cellspacing="0" cellpadding="0">';

        //
        // comment view
        //
        for(i=0; i < this.comments.length; i++)
        {
            if( this.comments[i].num != "" )
            {
                //html +=      '<form name="CmtDel_' + this.comments[i].num + '" method="post" action="' + this.writepage + '">'
                html +=      '<form name="CmtDel_' + this.comments[i].num + '" method="post" action="' + this.writepage + '" onsubmit="return DeleteConfirm();">'
                     +       '<input type="hidden" name="Num" value="' + this.comments[i].num + '">'
                     +       '<input type="hidden" name="Parent" value="' + this.parent_num + '">'
                     +       '<input type="hidden" name="Page" value="' + this.page + '">'
                     +       '<input type="hidden" name="Folder" value="' + this.folder + '">'
                     +       '<input type="hidden" name="category" value="' + this.category + '">'
                     +       '<input type="hidden" name="keyfield" value="' + this.keyfield + '">'
                     +       '<input type="hidden" name="keyword" value="' + this.keyword + '">'
                     +       '<input type="hidden" name="Mode" value="DEL">';
            }

            html +=          '<tr>'
                 +             '<td width="60"><strong>' + this.comments[i].writer + '</strong></td>'
                 //+             '<td width="530" height="25">'
                 +             '<td height="25">'
                 +                this.comments[i].comment
                 +               '&nbsp;&nbsp;&nbsp;'
                 +               '<span class="copy">'
                 +                  this.comments[i].regdate
                 +               '</span>&nbsp;';

            //alert(this.curdate);

            ///if( this.comments[i].regdate == this.curdate )
            if( this.comments[i].isnew == true )
                html +=          '<img src="/images/2004/icon_new.gif" width="8" height="11">&nbsp;';

            //if( this.comments[i].writer == this.reader )
            if( this.comments[i].num != "" )
            {
                /*++*
                html +=          '<a href="' + this.deletepage
                     +             '?Num=' + this.comments[i].num
                     +             '&RetUrl=' + this.returl + '">'
                     +             '<img src="/images/icon_new/btn_delete2.gif" border="0" width="26" height="11">'
                     +           '</a>';
                /*--*/
                html +=          '<input type="image" src="/images/icon_new/btn_delete2.gif" border="0" width="26" height="11">';
            }

            html +=            '</td>'
                 +           '</tr>'
                 +           '<tr>'
                 +             '<td background="/images/common/dot_3_1.gif" colspan="2" height="1"></td>'
                 +           '</tr>';

            if( this.comments[i].num != "" )
            {
                html +=      '</form>';
            }
        }

        html +=            '</table>'
             +           '</td>'
             +         '</tr>';

        //
        // comment write form
        //
        html +=        '<form name="CmtWr_' + this.parent_num + '" method="post" action="' + this.writepage + '" onsubmit="return send_comment(this);">'
             +         '<input type="hidden" name="Parent" value="' + this.parent_num + '">'
             +         '<input type="hidden" name="Page" value="' + this.page + '">'
             +         '<input type="hidden" name="Folder" value="' + this.folder + '">'
             +         '<input type="hidden" name="category" value="' + this.category + '">'
             +         '<input type="hidden" name="keyfield" value="' + this.keyfield + '">'
             +         '<input type="hidden" name="keyword" value="' + this.keyword + '">'
             +         '<input type="hidden" name="Mode" value="WRITE">'
             +         '<tr>'
             +           '<td width="60" valign="top"><img src="/images/common/comment01.gif" width="46" height="13"></td>'
             //+           '<td width="480">'
             +           '<td>'
             +             '<textarea name="Comment" cols="63" id="Text1" style="border:1 solid #707070"></textarea>'
             +           '</td>'
             +           '<td width="50" align="right" valign="top">'
             +             '<input type="image" src="/images/icon_new/btn_final.gif" border="0" width="49" height="18">'
             +           '</td>'
             +         '</tr>'
             +         '</form>'
             +       '</table>'

             +     '</td>'
             +   '</tr>'
             +   '<tr>'
             //+     '<td height="5" colspan="3"></td>'
             +     '<td height="5" colspan="2"></td>'
             +   '</tr>'
             +   '<tr>'
             //+     '<td width="13" height="1"></td>'
             //+     '<td width="590" height="1"></td>'
             +     '<td colspan="2" height="1"></td>'
             +   '</tr>'
             + '</table>'
             //+ '</span>';
             + '</div>';

             /*++*
             + '<table width="603" border="0" cellspacing="0" cellpadding="0">'
             +   '<!-- dot line -->'
             +   '<tr>'
             +     '<td width="60" height="1"></td>'
             +     '<td width="13" height="1"></td>'
             +     '<td width="530" height="1" background="/images/common/dot_3_1.gif"></td>'
             +   '</tr>'
             + '</table>';
             //+ '</span>';
             /*--*/

        //alert(html);

        return html;
    }
}


function classArticle(num)
{
    this.name = "";
    this.permalink = "";
    this.num = "";
    this.writer = "";

    this.weekday = "";  // day of week
    //this.year = "";
    //this.month = "";
    //this.day = "";
    this.date = "";
    this.post = "";

    this.title = "";
    this.category_str = "";
    //this.category_num = "";
    //this.categorylink = "";
    this.viewlink = "";
    this.modifylink = "";
    this.deletelink = "";

    this.reflink1 = "";
    this.reflink2 = "";
    this.attachfile = "";

    this.content = "";

    // this params are automatically filled by object Articles
    this.folder = "";
    this.category = "";
    this.page = "";
    this.keyword = "";
    this.keyfield = "";


    if( num != undefined )
        this.num = num;

    this.comment = new classComment(num);

    this.setCommentID = function classArticle_setCommentID(id)
    {
        return this.comment.setID(id);
    }

    this.getCommentID = function classArticle_getCommentID()
    {
        return this.comment.getID();
    }

    this.addComment = function classArticle_addComment(num, writer, comment, regdate)
    {
        return this.comment.add(num, writer, comment, regdate);
    }

    this.render = function classArticle_render()
    {
        var html = "";
        var titwidth = "590";

        //this.comment.writepage = this.

        //
        // date/title/post, title/category, etc.
        //
        html =  '<a name="atc' + this.num + '">'
             +  '<table width="603" border="0" cellspacing="0" cellpadding="0">'
             +    '<tr>'
             +      '<td width="13" height="1"></td>'
             +      '<td width="47"></td>'
             +      '<td width="13"></td>'
             +      '<td width="530"></td>'
             +    '</tr>'
             +    '<tr>';

        if( this.weekday != "" && this.date != "" ) //&& this.post != "" )
        {
            titwidth = "530";

            // <!-- If this article is last of that day, date & post is showed. -->
            html += '<td colspan="2" valign="top">'
                 +    '<table width="60" height="60" border="0" cellpadding="0" cellspacing="0">'
                 +      '<tr bgcolor="F7F7F7">'
                 +        '<td align="center">'
                 +          '<span class="copy"><font color="#333333">' + this.weekday + '</font></span><br>'
                 +          '<font size="5"><strong>' + this.date + '</strong></font><br>'
                 +          '<span class="copy"><font color="DF0009">post [' + this.post + ']</font></span>'
                 +        '</td>'
                 +      '</tr>'
                 +    '</table>'
                 +  '</td>'
                 +  '<td width="13"></td>'
                 +  '<td align="right">';
                 //+          '<font size="5"><strong>' + this.month + '.' + this.day + '</strong></font><br>'
        }
        else
        {
            html += '<td width="13"></td>'
                 +  '<td colspan="3">';
        }


        //
        // title, category, more...
        //
        //html +=     '<td width="13">&nbsp;</td>'
        //     +      '<td width="530">'
        html +=       '<table width="' + titwidth + '" border="0" cellspacing="0" cellpadding="0">'
             +          '<tr>'
             //+            '<td width="' + titwidth - 100 + '">'
             +            '<td>'
             +              '<strong><img src="/images/icon_new/icon_i_title2.gif" width="7" height="8">&nbsp;'
             +              '<font color="00A651" size="3">'
             +                this.title
             +              '</font>'
             +              '</strong>'
             ///+            '</td>'
             ///+            '<td width="40" align="right">'
             //+              '<a href="' + this.viewlink + '">'
             //+                '<img src="/images/icon_new/btn_more.gif" border="0" width="37" height="11">'
             //+              '</a>'
             ///+            '</td>'
             ///+          '</tr>'
             ///+          '<tr>'
             ///+            '<td>'
             +            '</td>'
             +            '<td width="190" align="right">'
             //+              '&nbsp;&nbsp;&nbsp;'
             +              '<span class="copy">[ºÐ¾ß : ' 
             +               this.category_str
             +              ']</span>&nbsp;&nbsp;'
             +            '</td>'
             //+            '<td>&nbsp;</td>'
             +          '</tr>'
             +          '<tr>'
             +            '<td colspan="2" height="10"></td>'
             +          '</tr>'
             +          '<tr>'
             +            '<td bgcolor="D8D8E3" colspan="2" height="1"></td>'
             +          '</tr>'
             +        '</table>'
             +      '</td>'
             +    '</tr>'
             +    '<tr>'
             +      '<td colspan="4" height="10"></td>'
             +    '</tr>'
             +    '<!-- content -->'
             +    '<tr>'
             //+      '<td width="60">&nbsp;</td>'
             //+      '<td width="13">&nbsp;</td>'
             //+      '<td width="530">'
             +      '<td></td>'
             +      '<td colspan="3">'
             +        '<font color="#333333">' + this.content + '</font>'
             +      '</td>'
             +    '</tr>';

        if( this.attachfile != "" || this.reflink1 != "" || this.reflink2 != "" )
        {
            html += '<tr>'
                 +    '<td colspan="4" height="20"></td>'
                 +  '</tr>'
                 +  '<tr>'
                 +    '<td></td>'
                 +    '<td colspan="3">'
                 +      '<table width="590">';

            if( this.attachfile != "" )
            {
                html +=   '<tr>'
                     +      '<td width="70" height="25" valign="top">'
                     +        '<font color="779D00">* Ã·ºÎÆÄÀÏ :</font>'
                     +      '</td>'
                     +      '<td width="520" valign="top">'
                     +        this.attachfile
                     +      '</td>'
                     +    '</tr>';
            }

            if( this.reflink1 != "" || this.reflink2 != "" )
            {
                html +=   '<tr>'
                     +      '<td width="70" height="25" valign="top">'
                     +        '<font color="779D00">* °ü·Ã¸µÅ© :</font>'
                     +      '</td>'
                     +      '<td width="520" valign="top">';

                if( this.reflink1 != "" )
                    html +=   '<u>' + this.reflink1 + '</u><br>';

                if( this.reflink2 != "" )
                    html +=   '<u>' + this.reflink2 + '</u>';

                html +=     '</td>'
                     +    '</tr>';
            }

            html +=     '</table>'
                 +    '</td>'
                 +  '</tr>'
        }

        html +=   '<tr>'
             +      '<td colspan="4" height="10"></td>'
             +    '</tr>'
             +    '<!-- dot line -->'
             +    '<tr>'
             //+      '<td width="60" height="1"></td>'
             //+      '<td width="13" height="1"></td>'
             //+      '<td width="530" height="1" background="/images/common/dot_3_1.gif"></td>'
             +      '<td></td>'
             +      '<td colspan="3" height="1" background="/images/common/dot_3_1.gif"></td>'
             +    '</tr>'
             +    '<!-- comment, e-mail send, perman link -->'
             +    '<tr>'
             +      '<td></td>'
             //+      '<td width="13">&nbsp;</td>'
             //+      '<td width="530" height="25" align="right">';
             +      '<td colspan="3" height="25" align="right">';

        html +=       '<table width="590" border="0" cellspacing="0" cellpadding="0">'
             +          '<tr>';

        if( this.deletelink != "" )
        {
            html +=       '<form name="del_' + this.num + '" action="delete.asp" mehtod="post">'
                 +        '<input type="hidden" name="Num" value="' + this.num + '">'
                 +        '<input type="hidden" name="Page" value="' + this.page + '">'
                 +        '<input type="hidden" name="Folder" value="' + this.folder + '">'
                 +        '<input type="hidden" name="Category" value="' + this.category + '">'
                 +        '<input type="hidden" name="Keyfield" value="' + this.keyfield + '">'
                 +        '<input type="hidden" name="Keyword" value="' + this.keyword + '">';
        }

        html +=           '<td width="470" align="right">';

        // modify
        if( this.modifylink != "" )
        {
            html +=   '<a href="' + this.modifylink + '">'
                 //+      '<img src="/images/icon_new/btn_modify2.gif" border="0">'
                 +      '[¼öÁ¤]'
                 +    '</a>&nbsp;&nbsp;';
        }

        //html +=           '</td>'
        //     +            '<td width="40">';

        // delete
        if( this.deletelink != "" )
        {
            //html +=   '<a href="' + this.deletelink + '">'
            //html +=   '<a href="javascript:del_' + this.num + '.submit();">'
            html +=   '<a href="javascript:SendDelete(document.del_' + this.num + ');">'
                 //+      '<img src="/images/icon_new/btn_delete.gif" border="0">'
                 +      '[»èÁ¦]'
                 +    '</a>';
                 //+    '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
        }


        html +=           '</td>';
        if( this.deletelink != "" )
            html +=       '</form>';

        html +=           '<td width="120" align="right">';


                      // comment
        html +=       '<a href="javascript:ShowHide(' + this.comment.getID() + ')">'
             //+        '<a href="javascript:ShowHide(Comment_1)">'
             +          '<img src="/images/common/icon.gif" border="0" width="5" height="5"> '
             +          'comment [' + this.comment.getCount() + ']'
             +        '</a>&nbsp;&nbsp;'
             +        '<!----'
             +        '<img src="/images/common/icon.gif" border="0" width="5" height="5"> e-mail º¸³»±â &nbsp;&nbsp;&nbsp;&nbsp;'
             +        '<img src="/images/common/icon.gif" border="0" width="5" height="5"> perman link&nbsp;&nbsp;'
             +        '<!---->'


             +            '</td>'
             +          '</tr>'
             +        '</table>'


             +      '</td>'
             +    '</tr>'
             +  '</table>';

        html += this.comment.render();

        html += '<table width="603" border="0" cellspacing="0" cellpadding="0">'
             +    '<!-- dot line -->'
             +    '<tr>'
             +      '<td width="13"></td>'
             +      '<td width="590" height="1" background="/images/common/dot_3_1.gif"></td>'
             +    '</tr>'
             +    '<tr>'
             +      '<td colspan="2" height="30"></td>'
             +    '</tr>'
             +  '</table>';
             //+  '<br>';

        return html;
    }
}


function ShowHide(objID)
{
    /*++*
    if( objID.style.visibility == "hidden" )
        objID.style.visibility = "visible";
    else
        objID.style.visibility = "hidden";
    /*--*/
    if( objID.style.display == "none" )
        objID.style.display = "block";
    else
        objID.style.display = "none";
}


function Articles()
{
    this.article_viewpage = "";
    this.category_listpage = "";
    this.comment_writepage = "";
    this.comment_deletepage = "";
    this.currentpage_params = "";   // urlencoded params

    this.cur_year = "";
    this.cur_month = "";
    this.cur_day = "";
    this.cur_weekday_index = "";    // index of current day of week, 1 is Sunday, ... 7 is Saturday

    // return parameter
    this.param_folder = "";
    this.param_category = "";
    this.param_page = "";
    this.param_keyword = "";
    this.param_keyfield = "";

    //this.articles = new classArticle();
    this.articles = new Array();

    this.add = function Articles_add(num, title, category, content)
    {
        var i = this.articles.length;

        this.articles[i] = new classArticle();
        if( num != undefined )
        {
            this.articles[i].num = num;
            this.articles[i].title = title;
            this.articles[i].category = category;
            this.articles[i].content = content;
        }

        return this.articles[i];
    }

    this.render = function Articles_render()
    {
        var i;
        var html = "";

        for(i=0; i < this.articles.length; i ++)
        {
            this.articles[i].folder = this.param_folder;
            this.articles[i].category = this.param_category;
            this.articles[i].page = this.param_page;
            this.articles[i].keyword = this.param_keyword;
            this.articles[i].keyfield = this.param_keyfield;

            this.articles[i].comment.writepage = this.comment_writepage;
            this.articles[i].comment.deletepage = this.comment_deletepage;

            this.articles[i].comment.folder = this.param_folder;
            this.articles[i].comment.category = this.param_category;
            this.articles[i].comment.page = this.param_page;
            this.articles[i].comment.keyfield = this.param_keyfield;
            this.articles[i].comment.keyword = this.param_keyword;

            html += this.articles[i].render();
        }

        return html;
    }
}


