﻿function fnAutoSize(s, obj) {
    var m = 20;

    if (s >= m) {
        obj.style.pixelHeight = s + 6;
    } else {
        obj.style.pixelHeight = m;

    }
}

//function commentPwdCheckLayerPop(modeVal, comIdxVal, contIdx) {
//    var scrollY = 0;
//    var lefty = (screen.width) ? (screen.width - 434) / 2 : 0;

//    if (navigator.appName.indexOf("Microsoft") == -1) {
//        scrollY = window.pageYOffset + 200;
//    } else {
//    scrollY = document.getElementById("WishToHopeMail").scrollTop;
//    }

//    Popup.openPopup("PWDCHECKPOP", "/Common/Popup_passInput.aspx?mode=" + modeVal + "&comIdx=" + comIdxVal + "&contIdx=" + contIdx, scrollY + 200, lefty - 200, 495, 277, 'no', 'gray', "D");
//}

//function commentModifyLayerPop(modeVal, comIdxVal, CertificationKey) {

//    Popup.closeLayerD('PWDCHECKPOP');

//    var scrollY = 0;
//    var lefty = (screen.width) ? (screen.width - 434) / 2 : 0;

//    if (navigator.appName.indexOf("Microsoft") == -1) {
//        scrollY = window.pageYOffset + 200;
//    } else {
//    scrollY = document.getElementById("WishToHopeMail").scrollTop;
//    }

//    Popup.openPopup("PWDCHECKPOP", "/Common/Popup_recommentWrite.aspx?contIdx=" + document.getElementById("hdnContIdx").value + "&mode=" + modeVal + "&comIdx=" + comIdxVal + "&certificationKey=" + CertificationKey, scrollY + 200, lefty - 200, 495, 305, 'no', 'gray', "D");

//}

//function commentModifyALayerAdminPop(modeVal, comIdxVal) {

//    Popup.closeLayerD('PWDCHECKPOP');

//    var scrollY = 0;
//    var lefty = (screen.width) ? (screen.width - 434) / 2 : 0;

//    if (navigator.appName.indexOf("Microsoft") == -1) {
//        scrollY = window.pageYOffset + 200;
//    } else {
//        scrollY = document.getElementById("WishToHopeMail").scrollTop;
//    }

//    Popup.openPopup("PWDCHECKPOP", "/Common/Popup_recommentWriteWithLogin.aspx?contIdx=" + document.getElementById("hdnContIdx").value + "&mode=" + modeVal + "&comIdx=" + comIdxVal, scrollY + 200, lefty - 200, 495, 305, 'no', 'gray', "D");

//}
function commentModifyLayerPop(modeVal, comIdxVal, CertificationKey, menuCd) {
    Popup.closeLayerD('PWDCHECKPOP');

    var scrollY = 0;
    var lefty = (screen.width) ? (screen.width - 434) / 2 : 0;

    if (navigator.appName.indexOf("Microsoft") == -1) {
        scrollY = window.pageYOffset + 200;
    } else {
    scrollY = document.getElementById("WishToHopeMail").scrollTop;
    }

    Popup.openPopup("PWDCHECKPOP", "/Common/Popup_recommentWriteWithLogin.aspx?contIdx=" + document.getElementById("hdnContIdx").value + "&mode=" + modeVal + "&comIdx=" + comIdxVal + "&certificationKey=" + CertificationKey + "&menuCd=" + menuCd, scrollY + 200, lefty - 200, 495, 300, 'no', 'gray', "D");

}
function commentDeleteAdmin(comIdx) {
    if (confirm("삭제하시겠습니까?")) {
        document.getElementById("hdnComIdx").value = comIdx;
        __doPostBack('btnCommentDelete', '');
    }
}

function commentDelete(comIdxVal) {
    if (confirm("삭제하시겠습니까?")) {
        document.getElementById("CommentU_hdnComIdx").value = comIdxVal;
        __doPostBack('btnCommentDelete', '');
    }
}





function goSearch() {
    //__doPostBack('ContentComment$Pager1', '' + Number(document.getElementById("ContentComment_hdnPageNo").value) - 1 + '');
    __doPostBack('btnCommentSearch', '');
}


function ComTextChk(txtComment, comIdx) {
    var formObj = document.forms[0];
    var elementObj;

//    elementObj = document.getElementById("txtNickNm");
//    if (elementObj.value.replace("이름", "").chkBlank() == true) {
//        alert("이름을 입력하세요.");
//        elementObj.focus();
//        return false;
//    }

//    elementObj = document.getElementById("txtPwd");
//    if (elementObj.value.chkBlank() == true) {
//        alert("비밀번호를 입력하세요.");
//        elementObj.focus();
//        return false;
//    }

//    elementObj = document.getElementById("txtEmail");
//    if (elementObj.value.replace("이메일", "").chkBlank() == true) {
//        alert("이메일을 입력하세요.");
//        elementObj.focus();
//        return false;
//    }

//    if (email_chk(elementObj.value) == false) {
//        alert("이메일 형식이 올바른지 확인하고 다시 입력하세요.");
//        document.getElementById("txtEmail").focus();
//        return false;
//    }

    elementObj = document.getElementById("txtComment");
    if (elementObj.value.chkBlank() == true) {
        alert("댓글을 입력해 주십시요.");
        elementObj.focus();
        return false;
    }

    elementObj = document.getElementById("checkButtonClickFlag");
    if (elementObj.value == "true") {
        alert("이미 버튼을 클릭하셨습니다.");
        return false;
    } else {
        elementObj.value = "true";
    }

    return true;
}

function replayView(openIdx, closeIdx, colseIdx2, code) {
    document.getElementById(colseIdx2).style.display = "none";

    if (code == "R") {
        if (document.getElementById(openIdx).style.display == "none") {
            document.getElementById(openIdx).style.display = "";
        } else {
            document.getElementById(openIdx).style.display = "none";
        }
    } else {
        if (document.getElementById(openIdx).style.display == "none") {
            document.getElementById(openIdx).style.display = "";
            document.getElementById(closeIdx).style.display = "none";
        } else {
            document.getElementById(openIdx).style.display = "none";
            document.getElementById(closeIdx).style.display = "";
        }
    }

    document.getElementById("ContentComment_checkButtonClickFlag").value = "false";
}
