/**
 * @type   : function
 * @access : public
 * @desc   : ÆË¾÷Ã¢À» º¸ÀÎ´Ù.
 * <pre>»ç¿ë¿¹ :
 *     cfOpenPopup( openUrl, winNm, h, w );
 * </pre>
 * @sig    : 
 * @param  : Url
 * @param  : winNm : window ÀÌ¸§
 * @param  : h height
 * @param  : w width
 * @return : none
 * @author : 
 */
function cfOpenPopup( openUrl, winNm, h, w, status ) {
    var varHeight = h;
    var varWidth = w;
    
    if(!status) {
        status = 0;
    }
    window.open(openUrl,winNm,"width=" + varWidth + ",height=" + varHeight + ",top=" + (screen.height - varHeight)/2 + ",left=" + (screen.width - varWidth)/2 +
                              "toolbar=0,location=0,directories=0,status="+status+",menubar=0,scrollbars=1,resizable=yes, copyhistory=1");
}

function PopUpWindowOpenName(surl, winname, popupwidth, popupheight, scrollbar) {
    var Top = '';
    var Left = '';
    if(popupwidth  > window.screen.width)
	popupwidth = window.screen.width;
    if(popupheight > window.screen.height)
	popupheight = window.screen.height; 
		
    if( isNaN(parseInt(popupwidth)) ){
	Top = (window.screen.availHeight - 600) / 2;
	Left = (window.screen.availWidth - 800) / 2;
    }else {
	Top = (window.screen.availHeight - popupheight) / 2;
	Left = (window.screen.availWidth - popupwidth) / 2;
    }
        
    if(Top < 0) Top = 0;
    if(Left < 0) Left = 0;
    Future = "status=no,scrollbars="+scrollbar+",resizable=yes,left="+Left+",top="+Top+",width="+popupwidth+",height="+popupheight;
        
    PopUpWindow = window.open("about:blank", winname , Future)
    PopUpWindow.location = (surl!="") ? surl : "about:blank";
    PopUpWindow.focus();
}

function checkBox(obj) {
    var boo = false;
    if(obj != null){
        if(obj.length != null){
            for(var i=0; i<obj.length; i++) {
                if(obj[i].checked) {
                    boo = true;
                    break;    
                }
	    }
        }else {
            if(obj.checked)
                boo = true;
        }
    }
    return boo;
}

function selectAll(thisObj,arrobj) {
    var booChecked = thisObj.checked;
    if(arrobj != null){
        if(arrobj.length != null) {
            for(var i=0; i<arrobj.length; i++) {
                if(arrobj[i].disabled != true) {
                    if(booChecked)
                        arrobj[i].checked = true;
                    else
                        arrobj[i].checked = false;
                }
            }
        }else {
            if(arrobj.disabled != true) {
                if(booChecked)
                    arrobj.checked = true;
                else
                    arrobj.checked = false;
            }
        }
    }
}

function enisSendMail() {
    if(document.all.mail_print != null) {
    	cfOpenPopup( "/enis/en/jsp/sendEmailIn.jsp", "Mail", 170, 520 );
    }else {
        alert("Sorry this page is not support Mail");
    }
}

function enisSendPrint() {
    if(document.all.mail_print != null) {
    	cfOpenPopup( "/enis/en/jsp/sendPrint.jsp", "Print", 500, 800 );
    }else {
        alert("Sorry this page is not support Print");
    }
}