/**
 * @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 = "fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=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(booChecked)
                    arrobj[i].checked = true;
                else
                    arrobj[i].checked = false;
	    }
        }else {
            if(booChecked)
                arrobj.checked = true;
            else
                arrobj.checked = false;
        }
    }
}

/**
 * @type   : function
 * @access : public
 * @desc   : jsp화면에서 mail을 보내는 함수
 * <pre>사용예 :
 *     sendMail(title);
 * </pre>     
 * @sig    : 
 * @param  : title
 * @return : none
 * @author :  
 */
 /*
function sendMail(lang){
    if(document.all.mail_print != null){
        cfOpenPopup("/enis/en/jsp/sendEmailIn.jsp", "Mail", 170, 520);
    }else{
        alert("Sorry this page is not support Mail");
    }
}
*/

/**
 * @type   : function
 * @access : public
 * @desc   : jsp화면에서 Print하는 메소드
 * <pre>사용예 :
 *     sendPrint();
 * </pre>     
 * @sig    : 
 * @param  : none
 * @return : none
 * @author :  
 */
function sendPrint(lang){
    if(document.all.mail_print != null){
        cfOpenPopup("/enis/en/jsp/sendPrint.jsp", "Print", 500, 800);
    }else{
        alert("Sorry this page is not support Print");
    }
}