function hide(id) {
        var obj=document.getElementById(id);
        obj.style.display="none";
}

function show(id) {
        var obj=document.getElementById(id);
        obj.style.display="";
}

function konfirmasi() {
        var JadiHapus=confirm("Anda Yakin Akan Menghapus?");
        if(JadiHapus!=true) return false;
                else return true;
}

function Msg(Pesan) {
        var JadiHapus=confirm(Pesan);
        if(JadiHapus!=true) return false;
                else return true;
}

function ceklis(id,index) {
        var objid=document.getElementById(id+"["+index+"]");
        if(objid.checked)
                objid.checked=false;
        else
                objid.checked=true;
}

function hapus(id) {
                var obj=document.getElementById(id);
                if(konfirmasi()) obj.submit();
}

function kirim_form(id) {
                var obj=document.getElementById(id);
                obj.submit();
}

function konfirmasi_password(id1,id2) {
                var pass1=document.getElementById(id1);
                var pass2=document.getElementById(id2);
                if(pass1.value!=pass2.value) {
                        alert("Konfirmasi Password Tidak Sama");
                        return false;
                }
                else
                        return true;
}

function detail(atribut1,idKat){
                var oO = document.getElementsByTagName('tr');

    for (var ii = 0; ii < oO.length; ii++) {
        if(oO[ii].getAttribute(atribut1) == idKat) {
            if(oO[ii].style.display == 'none') {
                oO[ii].style.display = 'table-row'
            }
            else {
                oO[ii].style.display = 'none'
            }
        }
    }
}

function ganti_password(ket,id1,id2) {
        var objket=document.getElementById(ket);

        if(objket.checked) {
                show(document.getElementById(id1));
                show(document.getElementById(id2));
        }
        else {
                hide(document.getElementById(id1));
                hide(document.getElementById(id2));
        }
}

var newWin = null;
function PopUp(strURL, strType, strHeight, strWidth) {
 if (newWin != null && !newWin.closed)
   newWin.close();
 var strOptions="";
 if (strType=="console")
   strOptions="scrollbars,resizable,height="+
     strHeight+",width="+strWidth;
 if (strType=="fixed")
   strOptions="status,height="+
     strHeight+",width="+strWidth;
 if (strType=="elastic")
   strOptions="toolbar,menubar,scrollbars,"+
     "resizable,location,height="+
     strHeight+",width="+strWidth;
 newWin = window.open(strURL, 'newWin', strOptions);
 newWin.focus();
}

function over(id)
{
      document.getElementById(id).style.backgroundColor="#D9FFCC";
      document.getElementById(id).style.cursor="pointer";
}

function out(id)
{
      document.getElementById(id).style.backgroundColor="#FFF7EE";
      document.getElementById(id).style.cursor="pointer";
}