function selectall(checked) {
    var theForm = document.forms[0];
    if (theForm) {
        for (var i=0; i<theForm.elements.length; ++i) {
            var elm = theForm.elements[i];
            if (elm.type == 'checkbox') {
                elm.checked = checked;
            }
        }
    }
}

function unselectall(strChkAll, objChkSelect){
    var checkAll = document.getElementById(strChkAll);
    var checkSelect = objChkSelect;
    if(checkSelect.checked == false)
        checkAll.checked = false;
}

function changeImageBtn(objBtn, strAction) {
    if(strAction == 'over'){
        objBtn.className = 'hoverbutton'; 
    }
    else if(strAction == 'out'){ 
        objBtn.className = 'button'; 
    }
    else{ 
        objBtn.className = 'button'; 
    }
}

function changeImageBtnLong(objBtn, strAction) {
    if(strAction == 'over'){
        objBtn.className = 'hoverbutton-long'; 
    }
    else if(strAction == 'out'){ 
        objBtn.className = 'button-long'; 
    }
    else{ 
        objBtn.className = 'button-long'; 
    }
}

function confirmdelete() {
    var ischeck = false;
    var theForm = document.forms[0];
    if (theForm) {
        for (var i=0; i<theForm.elements.length; ++i) {
            var elm = theForm.elements[i];
            if (elm.type == 'checkbox') {
                if(elm.checked){
                    ischeck = true;
                    break;
                }
            }
        }
    }
    if(ischeck){
        agree = confirm("Do you really want to delete this data?");
        if (agree) return true ; 
        else return false;
    }
    else{
        alert("Please select data before deleting.");
    }
}

function deleteConfirm(isCancel) {
    var agree = '';
    if(isCancel == 'false')
        agree = confirm("Do you really want to cancel this reservation?");
    else
        agree = confirm("Do you really want to recurrence cancel this reservation?");
        
    if (agree) return true ;
    else return false ;
}

function checkinConfirm(isCheckin) {
    var agree = '';
    if(isCheckin == 'false')
        agree = confirm("Do you really want to check-in this reservation?");
    else
        agree = confirm("Do you really want to recurrence check-in this reservation?");
           
    if (agree) return true ;
    else return false ;
}

function transConfirm(){
    var isCheck = false;
    var theForm = document.forms[0];
    if (theForm) {
        for (var i=0; i<theForm.elements.length; ++i) {
            var elm = theForm.elements[i];
            if (elm.type == 'checkbox') {
                if(elm.checked){
                    isCheck = true;
                    break;
                }
            }
        }
    }
    if(isCheck){
        agree = confirm("Do you really want to do action this data?");
        if (agree) return true ;
		else return false;
    }
    else{
        alert("Please select data before do action.");
    }
}

function cancelClick() {
    return false;
}
