/*================================================
              * Æ÷ÀÎÆ®Ã¼Å© *
================================================*/

function view_contents(opt, point, kind, seq, file_field, mypoint)
{
    switch (opt) {
        case "no_member":
            alert("È¸¿ø¸¸ º¸½Ç ¼ö ÀÖ½À´Ï´Ù.\n ·Î±×ÀÎ ÇÏ½Ê½Ã¿À.");
            break;
        case "no_login":
            alert("À¯·áÀÚ·áÀÌ¸ç ·Î±×-ÀÎ ÈÄ º¸½Ç ¼ö ÀÖ½À´Ï´Ù.");
            break;
        case "no_point":
            msg = "Æ÷ÀÎÆ®°¡ ¸ðÀÚ¶ø´Ï´Ù!\n\n"
            msg = msg + "ÃæÀü ÈÄ ÀÌ¿ëÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù. \n\n\n"
            msg = msg + "ÇöÀç Æ÷ÀÎÆ® : " + mypoint + "\n\n"
            msg = msg + "³»¿ë Æ÷ÀÎÆ® : " + point +" \n"
            alert(msg);
            break;
        case "order_ok":
//        case "no_order":
            if (kind== "1") {
                if (confirm('ÀÚ·áº¸±â¿¡ ' + point + ' Æ÷ÀÎÆ®°¡ »ç¿ëµË´Ï´Ù.\nº¸½Ã°Ú½À´Ï±î?')) {
                    location.href='/contents/view_contents.asp?seq=' + seq;
                }
            }
            else {
                if (file_field.charAt(0) == 'f' || file_field.charAt(0) == 'i'){
                    if (confirm('¿¬°áÀÌ¹ÌÁö º¸±â¿¡ ' + point + ' Æ÷ÀÎÆ®°¡ »ç¿ëµË´Ï´Ù.\n º¸½Ã°Ú½À´Ï±î?')) {
                        down_load(seq, file_field);
                    }
                }
                else{
                    if (confirm('Ã·ºÎÆÄÀÏ ´Ù¿î·Îµå¿¡ ' + point + ' Æ÷ÀÎÆ®°¡ »ç¿ëµË´Ï´Ù.\n ´Ù¿î·ÎµåÇÏ½Ã°Ú½À´Ï±î?')) {
                        down_load(seq, file_field);
                    }
                }
            }
            break;
        case "view_ok":
        default :
            if (kind == '1')
                location.href='/contents/view_contents.asp?seq=' + seq;

            else {
                down_load(seq, file_field);
            }

    }
}

function down_load(seq, file_field)
{
    down_load_form.file_field.value = file_field
    down_load_form.seq.value = seq;
    down_load_form.submit();
}

