﻿
function Control_MemberView(ID)
{
	link = "/Msche/Manager/Member_View_PopUp.aspx?ID="+ID ;
	window.open(link,"","width=790,height=800,top=200,left=300,toolbar=no ,location=no,directory=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no ");
}



function Control_Depth2Cal() {
    //alert( document.all.ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder3$WR_Depth21$TextBox_M1.value);
    var m1 = document.all.ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder3$WR_Depth21$TextBox_M1;
    var m2 = document.all.ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder3$WR_Depth21$TextBox_M2;
    var m3 = document.all.ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder3$WR_Depth21$TextBox_M3;
    var m4 = document.all.ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder3$WR_Depth21$TextBox_M4;
    var m5 = document.all.ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder3$WR_Depth21$TextBox_M5;

    var mTot = document.all.ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder3$WR_Depth21$TextBox_MTot;




    m1.value = commify(parseInt(set0(m1.value.replace(/,/, ""))));
    m2.value = commify(parseInt(set0(m2.value.replace(/,/, ""))));
    m3.value = commify(parseInt(set0(m3.value.replace(/,/, ""))));
    m4.value = commify(parseInt(set0(m4.value.replace(/,/, ""))));
    m5.value = commify(parseInt(set0(m5.value.replace(/,/, ""))));
    
    

    mTot.value = commify(   parseInt(m1.value.replace(/,/, ""))
                  + parseInt(m2.value.replace(/,/, ""))
                  + parseInt(m3.value.replace(/,/, ""))
                  + parseInt(m4.value.replace(/,/, ""))
                  + parseInt(m5.value.replace(/,/, ""))  )
   
    //alert(parseInt(m1.value.replace(/,/,"")) );


}




function set0(str1) {

    if (str1 == "")
        return "0";
    else
        return str1;
}

function commify(n) {
    var reg = /(^[+-]?\d+)(\d{3})/;   // 정규식
    n += '';                          // 숫자를 문자열로 변환

    while (reg.test(n))
        n = n.replace(reg, '$1' + ',' + '$2');

    return n;
}


function Control_ReportView(PartCd, Date) {
    link = "/msche/Manager/WR_Depth_Page.aspx?PartCd="+ PartCd +"&Wdate=" + Date;
    window.open(link, "", "width=760,height=800,top=200,left=300,toolbar=no ,location=no,directory=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no ");
}


function Control_Post(gubun) {
    link = "/msche/Post/PostMain.aspx?gubun=" + gubun;
    window.open(link, "", "width=680,height=500,top=200,left=300,toolbar=no ,location=no,directory=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no ");
}
