function del(num)
{
if (confirm("Apakah anda yakin akan menghapus data ini?"))
if (num==2) document.form2.submit();
else document.form.submit()
}

function delConfirm(num, formName)
{
if (confirm("Apakah anda yakin akan menghapus data ini?"))
if (num==2) document.form2.submit();
else document.form.submit()
}


function wopen(alamat,tinggi,lebar)
{
 
wnew1=window.open(alamat,"wnew1","resizable,toolbar,scrollbars,width="+lebar+",height="+tinggi+",screenX=50,screenY=100");
wnew1.focus();

}

var response = null 
function prompt2(promptpicture, prompttitle, message, sendto,params) { 
	promptbox = document.createElement('div style="z-index : 150 " '); 
	promptbox.setAttribute ('id' , 'prompt'); 
	document.getElementsByTagName('body')[0].appendChild(promptbox); 
	promptbox = eval("document.getElementById('prompt').style"); 
	promptbox.position = 'absolute'; 
	promptbox.top = 100 ;
	promptbox.left = 200 ;
	promptbox.width = 300 ;
	promptbox.border = 'outset 1 #bbbbbb' ;
	document.getElementById('prompt').innerHTML = "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr valign='middle'><td width='22' height='22' style='text-indent:2;' class='titlebar'><img src='" + promptpicture + "' height='18' width='18'></td><td class='titlebar'>" + prompttitle + "</td></tr></table>" ;
	document.getElementById('prompt').innerHTML = document.getElementById('prompt').innerHTML + "<table cellspacing='0' cellpadding='0' border='0' width='100%' class='promptbox'><tr><td>" + message + "</td></tr><tr><td><input type='text' id='promptbox' onblur='this.focus()' class='promptbox'></td></tr><tr><td align='right'><br><input type='button' class='prompt' value='OK' onMouseOver='this.style.border=\"1 outset #dddddd\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(document.getElementById(\"promptbox\").value,\""+ params +"\"); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'> <input type='button' class='prompt' value='Cancel' onMouseOver='this.style.border=\"1 outset transparent\"' onMouseOut='this.style.border=\"1 solid transparent\"' onClick='" + sendto + "(\"\"); document.getElementsByTagName(\"body\")[0].removeChild(document.getElementById(\"prompt\"))'></td></tr></table>" ;
	document.getElementById("promptbox").focus() ;
	} 
	
/* tree menu script */
	
	var head="display:''"
	img1=new Image()
	img1.src="fold.gif"
	img2=new Image()
	img2.src="open.gif"
	
	var ns6=document.getElementById&&!document.all
	var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
	
	function checkcontained(e){
	var iscontained=0
	cur=ns6? e.target : event.srcElement
	i=0
	if (cur.id=="foldheader")
	iscontained=1
	else
	while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
	if (cur.id=="foldheader"||cur.id=="foldinglist"){
	iscontained=(cur.id=="foldheader")? 1 : 0
	break
	}
	cur=ns6? cur.parentNode : cur.parentElement
	}
	
	if (iscontained){
	var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
	if (foldercontent.style.display=="none"){
	foldercontent.style.display=""
	cur.style.listStyleImage="url(open.gif)"
	}
	else{
	foldercontent.style.display="none"
	cur.style.listStyleImage="url(fold.gif)"
	}
	}
	}
	
	if (ie4||ns6)
	document.onclick=checkcontained
	
/**************/
var idx;
function stop() {
        clearTimeout(id); }

function tickit() {
        var dt=new Date();
        var mm,dd,yy,h,m,s;
        var date="",time="";
        mm=dt.getMonth()+1;
        dd=dt.getDate();
        yy=dt.getYear();
        if (navigator.appName.indexOf("Netscape")>=0) yy+=1900;
        h=dt.getHours(); if (h<10) h ="0"+h;
        m=dt.getMinutes(); if (m<10) m="0"+m;
        s=dt.getSeconds(); if (s<10) s="0"+s;
        if(mm==1) date+="Jan";
        if(mm==2) date+="Feb";
        if(mm==3) date+="Mar";
        if(mm==4) date+="Apr";
        if(mm==5) date+="Mei";
        if(mm==6) date+="Jun";
        if(mm==7) date+="Jul";
        if(mm==8) date+="Aug";
        if(mm==9) date+="Sep";
        if(mm==10) date+="Okt";
        if(mm==11) date+="Nov";
        if(mm==12) date+="Des";
        date= dd+" " +date+" "+(yy);
        time+=h+":"+m+":"+s;
        document.waktu.tgl.value=date;
        document.waktu.jam.value=time;
        idx=setTimeout("tickit()",999); }

/**************/
		
function getOther(obj,fld,val) {
  fld.style.display = (obj.selectedIndex==obj.options.length-1)?"none":"inline";
  if (obj.selectedIndex==obj.options.length-1) {
  document.getElementById(val).style.display = 'block';
  } else {
  document.getElementById(val).style.display = 'none';
  }
}

