var disposisisurat=(function(){
	var hal=0;
	var jumlah=30;
	var iddisposisisurat=0;
	var idjenissurat=0;
	var idkategori=0;
	var namalib="";
	var boxstatussurat=null;
	var boxcatatansurat=null;
	var editstatus=0;
	var hapusstatus=0;
	var statusdisposisi=0;
	var idpegawai=0;
	var idstatus=0;
	var namastatus="";
	var jumlahreq=0;
	var masatahun=0;
	var inout=0;
	var idtemplate=0;
	return{
		reqcb:function(jumlah){
			var requestcb = new reqcb({
			    jumlahReq: jumlah
			});
			return requestcb;
		},
		katch:function(){
			var idkategori=$("#sl_kategori").val();
			$("#boxjenissurat").hide();
			if(idkategori>0){
				$("#boxjenissurat").show();
				var loaderkategori=mload.loading({"el":"sl_jenissurat"});
				var ik_data = {ajax: 1,mode: "mod",cl: "disposisisurat",
					ikdata: {0:"getjenissurat",
						idkategori:idkategori}
				};
				
				$.ajax({url: lokal+"man.ajax.php",type: "POST",dataType: "json",async:true,data: ik_data,
					success: function(e){
						if(e!=false && e.length>0){
							loaderkategori.tutup();
							var htm="<option value='0'>Semua Jenis</option>";
							for(var i=0;i<e.length;i++){
								htm+="<option value='"+e[i]['id']+"'>"+e[i]['nama']+"</option>";
							}
							loaderkategori.pesan(htm);
							
							disposisisurat.loade();
						}else{
							$("#boxjenissurat").hide();
							loaderkategori.pesan("<option value='0'>Semua Jenis</option>");
							disposisisurat.loade();
						}
					}
				});
			}else{
				disposisisurat.loade();
			}
		},
		
		caricanggih:function(){
			var loadercari=mload.loader({"keterangan":"Proses ...."});
			var ik_data = {ajax: 1,mode: "mod",cl: "disposisisurat",
				ikdata: {0:"datacari01",1:1}
			};
			
			$.ajax({url: lokal+"man.ajax.php",type: "POST",dataType: "json",async:true,data: ik_data,
				success: function(e){
					loadercari.tutup();
					if(e!=false){
						var boxcari;
						var obj=new Object;
						obj.proses=function(a){
							$("#cari").val(a);
							boxcari.tutup();
							document.getElementById("btcari").click();
						};
						var datacari={"data":e,"proses":obj}
						boxcari=caricanggih.buka(datacari);
					}
				}
			});
		},
		enter:function(e){
			if(e.which == 13 || e.keyCode == 13){
				disposisisurat.loade();
			}
		},
		loade:function(){
			$("#hal_ke").val(0);
			disposisisurat.load();
		},
		load:function(){
			var nohal=$("#hal_ke").val()
			jumlah=$("#jumlah_hal").val();
			hal=(nohal-1)*jumlah;
			var cr=$("#cari").val();
			
			var idkategori=$("#sl_kategori").val();
			var idjenis=$("#sl_jenissurat").val();
			
			$("#grid_disposisisurat").html("");
			var loaderdata=mload.loading({"el":"loader_datadisposisisurat"});
			var ik_data = {
				ajax: 1,
				mode: "mod",
				cl: "disposisisurat",
				ikdata: {0:"getTabel",1:hal,2:jumlah,3:cr,
					idkategori:idkategori,
					idjenis:idjenis}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",
				type: "POST",
				dataType: "json",
				async:true,
				data: ik_data,
				success: function(e){
					
					loaderdata.tutup();
					//alert(JSON.stringify(e));
					if(e!=false && e.length>0){
						
						if(e.length>0 && e[0]['halaman']>0){
							var htm;
							for(var i=0;i<e[0]['halaman'];i++){
								htm+="<option value='"+(i+1)+"'>"+(i+1)+"</option>";
							}
							$("#hal_ke").html(htm);
							
						}
						$("#hal_ke").val(nohal);
						
						var datatb={
							box:"grid_disposisisurat",
							data:e,
							lebarmin:"500px",
							trklik:{"data":"id","fungsi":"barisklik"},
							title:"kategori Menu",
							isi:[
									{"col":"id","judul":"ID","tipe":"data","align":"center","lebar":"50px"},
									{"col":"tanggal_surat","judul":"Tanggal","tipe":"data","lebar":"90px","format":"tanggal","align":"center"},
									{"col":"jenissurat","judul":"Detail Surat","tipe":"tpl","tpl":"btdetailsurat"},
									{"col":"namastatusdisposisi","judul":"Status Disposisi","tipe":"data","lebar":"190px"},
									{"align":"center","judul":"Catatan","tipe":"tpl","tpl":"btcatatan","lebar":"70px"},
									{"align":"center","judul":"Status Surat","tipe":"tpl","tpl":"btstatus","lebar":"150px"},
									{"align":"center","judul":"","tipe":"tpl","tpl":"btedit","lebar":"70px"},
									
								],
							mod:"mod",
							module:"disposisisurat"
						};
						tabel.multisub(datatb);
					}else{
						loaderdata.pesan("BELUM ADA DATA");
					}
				}
			});
		},
		lihat:function(a,b,c,d){
			document.location=lokal+"member/mod/disposisisurat?id="+a+"&scrmenu="+modmenu.getmenuscr();
		},
		kembali:function(){
			document.location=lokal+"member/mod/disposisisurat?scrmenu="+modmenu.getmenuscr();
		},
		edit:function(a){
			iddisposisisurat=a['id'];
			idpegawai=a['id'];
			idstatus=a['idstatus'];
			namastatus=a['namastatus'];
			editstatus=a['editstatus'];
			hapuststatus=a['hapuststatus'];
			statusdisposisi=a['statusdisposisi'];
			namalib=a['namalib'];
			idkategori=a['idkategori'];
			idjenissurat=a['idjenissurat'];
			inout=a['inout'];
			idtemplate=a['idtemplate'];
			
			$("#btsubmitdisposisi").hide();
			$("#bttutupdisposisi").hide();
			$("#btpreviewsurat").hide();
			if(idtemplate>0) $("#btpreviewsurat").show();
			
			var obj=new Object;
			var cbf=disposisisurat.reqcb(3);
			
			cbf.addCallbackToQueue(true, function() {
	            disposisisurat.getdatasurat(iddisposisisurat);
	        });
	        
	        cbf.addCallbackToQueue(true, function() {
	            disposisisurat.cekdisposisi(iddisposisisurat);
	        });
	        
			cbf.addCallbackToQueue(true, function() {
	            disposisisurat.getcatatansurat(iddisposisisurat);
	        });
		},
		getdatasurat:function(a){
			$("#boxdatasurat").html("");
			$("#boxdatasurat").show();
			var fg="";
			if(idkategori==1){
				var fg="getdatasuratcuti";
				if(idjenissurat==11){
					fg="getdatasurattugas";
				}
			}else if(idkategori==2){
				if(inout==1) {
					fg="getdatasuratmasuk";
					if(idjenissurat==20){
						fg="getdatasuratpkl";
					}
				}else if(inout==2){
					fg="getdatasuratkeluar";
				}
			}
			
			var loadercekdatasurat=mload.loading({"el":"boxdatasurat"});
			var ik_data = {
				ajax: 1,
				mode: "mod",
				cl: "disposisisurat",
				ikdata: {0:fg,idsurat:a}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",
				type: "POST",
				dataType: "json",
				async:true,
				data: ik_data,
				success: function(e){
					if(e.hasOwnProperty("status")){
						loadercekdatasurat.tutup();
						if(e['status']==1) {
							loadercekdatasurat.tutup();
							$("#boxdatasurat").html(e['data']);
						}else{
							loadercekdatasurat.pesan(e['pesan']);
						}
					}else{
						loadercekdatasurat.pesan("Terjadi kesalahan!");
					}
				}
			});
		},
		cekdisposisi:function(a){
			$("#btsubmitdisposisi").hide();
			var loadercekdisposisi=mload.loading({"el":"loader_disposisisurat"});
			var ik_data = {
				ajax: 1,
				mode: "mod",
				cl: "disposisisurat",
				ikdata: {0:"cekstatusdisposisi",idsurat:a}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",
				type: "POST",
				dataType: "json",
				async:true,
				data: ik_data,
				success: function(e){
					if(e.hasOwnProperty("status")){
						loadercekdisposisi.tutup();
						if(e['status']==1) {
							if(editstatus==1) $("#btsubmitdisposisi").show();
						}else{
							if(editstatus==1 && statusdisposisi==0) $("#bttutupdisposisi").show();
						}
					}
				}
			});
		},
		getcatatansurat:function(a){
			$("#grid_catatan").html("");
			var loaderdatacatatan=mload.loading({"el":"grid_catatan"});
			var ik_data = {
				ajax: 1,
				mode: "mod",
				cl: "disposisisurat",
				ikdata: {0:"getcatatansurat",idsurat:a}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",
				type: "POST",
				dataType: "json",
				async:true,
				data: ik_data,
				success: function(e){
					if(e!=false && e.length>0){
						var datactt=e;
						for (var i=0;i<datactt.length;i++){
							datactt[i]['edit']=editstatus;
							datactt[i]['hapus']=hapusstatus;
							datactt[i]['statusdisposisi']=statusdisposisi;
						}
						
						var tabeldata={
							box:"grid_catatan",
							data:datactt,
							lebarmin:"500px",
							trklik:{"data":"id","fungsi":"barisklik"},
							title:"kategori Menu",
							tbclass:"table_grid",
							isi:[
									{"align":"center","judul":"Tanggal","tipe":"data","col":"tanggal","lebar":"140px","format":"tanggal"},
									{"judul":"Nama Pegawai","tipe":"data","col":"namapegawai","lebar":"250px"},
									{"col":"catatan","judul":"Catatan","tipe":"data"},
									{"align":"center","judul":"","tipe":"tpl","tpl":"bteditcatatan","lebar":"70px"},
									
								],
							mod:"mod",
							module:"disposisisurat"
						};
						tabel.multisub(tabeldata);
						
					}else{
						loaderdatacatatan.pesan("Tidak ada catatan");
					}
				}
			});
		},
		getmasakerja:function(a){
			$("#masakerja").hide();
			var loadermasakerja=mload.loading({"el":"loader_masakerja"});
			var ik_data = {
				ajax: 1,
				mode: "mod",
				cl: "disposisisurat",
				ikdata: {0:"getmasakerja",idpegawai:a}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",
				type: "POST",
				dataType: "json",
				async:true,
				data: ik_data,
				success: function(e){
					if(e.hasOwnProperty("tahun")){
						loadermasakerja.tutup();
						$("#masakerja").show();
						var hasil="";
						if(e['tahun']>0) hasil+=e['tahun']+ " Tahun ";
						if(e['bulan']>0) hasil+=e['bulan']+ " Bulan ";
						if(e['hari']>0) hasil+=e['hari']+ " Hari ";
						
						$("#masakerja").html(hasil);
						masatahun=parseInt(e['tahun']);
					}else{
						loadermasakerja.pesan("Terjadi kesalahan");
					}
				}
			});
		},
		submitdisposisi:function(){
			var loadersimpan=mload.loader({"keterangan":"Proses update data"});
			var ik_data = {
				ajax: 1,
				mode: "mod",
				cl: "disposisisurat",
				ikdata: {0:"updatedisposisi",
					idsurat:iddisposisisurat}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",
				type: "POST",
				dataType: "json",
				async:true,
				data: ik_data,
				success: function(e){
					if(e!=false && e.hasOwnProperty("status")){
						if(e['status']==1){
							disposisisurat.kembali();
						}else{
							loadersimpan.error(e['pesan']);
						}
					}else{
						loadersimpan.error([{"pesan":"Gagal proses simpan data"}]);
					}
				}
			});
		},
		hapus:function(a){
			if(a<=0) return;
			var boxyesno=null;
			var databox={
				judul:"Yakin akan menghapus data pengajuan surat ini ?? ",
				proses:function(){
					var loaderhapus=mload.loader({"keterangan":"Proses hapus data.."});
					boxyesno.tutup();
					var ik_data = {
						ajax: 1,
						mode: "mod",
						cl: "disposisisurat",
						ikdata: {0:"hapusData",idsurat:a}
					};
					
					$.ajax({
						url: lokal+"man.ajax.php",
						type: "POST",
						dataType: "json",
						async:true,
						data: ik_data,
						success: function(e){
							if(e!=false && e.hasOwnProperty("status")){
								if(e['status']==1){
									loaderhapus.error([{"pesan":"Berhasil"}]);
									disposisisurat.load();
								}else{
									loaderhapus.error(e['pesan']);
								}
							}else{
								loaderhapus.error([{"pesan":"Gagal hapus data"}]);
							}
						}
					});
				}
			};
			boxyesno=boxwin.yesno(databox);
			boxyesno.buka();
		},
		setstatussurat:function(){
			if(editstatus!=1) return;
			if(statusdisposisi==1) return;
			
			var loadergetstatus=mload.loader({"keterangan":"Get data status surat.."});
			var ik_data = {ajax: 1,mode: "mod",cl: "disposisisurat",
				ikdata: {0:"getstatussurat",
				idsurat:iddisposisisurat}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",type: "POST",dataType: "json",async:true,data: ik_data,
				success: function(e){
					
					if(e!=false && e.length>0){
						var htm="";
						var adaidst=false;
						for(var i=0;i<e.length;i++){
							if(e[i]['idstatus']==idstatus) adaidst=true;
						}
						if(!adaidst) htm+="<option bg='' warna='' value='"+idstatus+"'>"+namastatus+"</option>";
						for(var i=0;i<e.length;i++){
							htm+="<option bg='"+e[i]['bg']+"' warna='"+e[i]['warna']+"' value='"+e[i]['idstatus']+"'>"+e[i]['namastatus']+"</option>";
						}
						
						var ps={"box":"box_statussurat",
							"judul":"Update Status Surat",tinggi:"auto","lebar":"700"};
				
						boxstatussurat=boxwin.load(ps);
						boxstatussurat.idsurat=iddisposisisurat;
						boxstatussurat.buka();
						
						$("#sl_statussurat").html(htm);
						$("#sl_statussurat").val(idstatus);
						
						$("#keterangansr").val($("#keterangansurat").html());
						
						loadergetstatus.tutup();
					}else{
						loadergetstatus.error([{"pesan":"Tidak diijinkan"}]);
					}
				}
			});
		},
		prosesstatussr:function(){
			var idstatus=$("#sl_statussurat").val();
			var keterangan=$("#keterangansr").val();
			var bg=kudus.getattrselect("sl_statussurat","bg");
			var warna=kudus.getattrselect("sl_statussurat","warna");
			var namastatus=kudus.selecttext("sl_statussurat");
			
			var keterangan=$("#keterangansr").val();
			
			var loadersetstatus=mload.loader({"keterangan":"Update data status surat.."});
			var ik_data = {ajax: 1,mode: "mod",cl: "disposisisurat",
				ikdata: {0:"updatestatussurat",
				idsurat:iddisposisisurat,
				idstatus:idstatus,
				keterangan:keterangan}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",type: "POST",dataType: "json",async:true,data: ik_data,
				success: function(e){
					
					if(e!=false && e.hasOwnProperty("status")){
						if(e['status']==1){
							document.location=document.location.href;
						}else{
							loadersetstatus.error(e['pesan']);
						}
						
					}else{
						loadersetstatus.error([{"pesan":"Tidak diijinkan"}]);
					}
				}
			});
		},
		batalstatussr:function(){
			if(boxstatussurat!=null) boxstatussurat.tutup();
			boxstatussurat=null;
		},
		tutupdisposisi:function(){
			var loadertutup=mload.loader({"keterangan":"Update data status surat.."});
			var ik_data = {ajax: 1,mode: "mod",cl: "disposisisurat",
				ikdata: {0:"tutupDisposisi",
				idsurat:iddisposisisurat}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",type: "POST",dataType: "json",async:true,data: ik_data,
				success: function(e){
					
					if(e!=false && e.hasOwnProperty("status")){
						if(e['status']==1){
							disposisisurat.kembali();
						}else{
							loadertutup.error(e['pesan']);
						}
						
					}else{
						loadertutup.error([{"pesan":"Tidak diijinkan"}]);
					}
				}
			});
		},
		lihatcatatan:function(a,b,c,d){
			var idtb=b+"_"+c;
            
            var htm="<div align='left' style='padding-top:10px;padding-bottom:10px;width:100%;'>";
            htm+="<div style='margin-top:10px;margin-bottom:10px;'><b>CATATAN </b></div>";
            htm+="<select id=\"jumlah_hal_"+idtb+"\" class=\"slkecil\" onchange=\"disposisisurat.loaddatacttpe("+b+","+c+")\">";
            htm+="<option value=\"30\">30</option>";
            htm+="<option value=\"50\">50</option>";
            htm+="<option value=\"100\">100</option>";
            htm+="</select>";
            htm+="&nbsp;&nbsp;Hal <select id=\"hal_ke_"+idtb+"\" class=\"slkecil\" onchange=\"disposisisurat.loaddatactt("+b+","+c+")\"><option value=\"1\">1</option></select>";
            htm+="<div style='margin-top:10px;margin-bottom:10px;'>";
            htm+="<div id='loader_sub_"+idtb+"'></div>";
            htm+="<div id='grid_sub_"+idtb+"'></div>";
            
            htm+="<div style='margin-top:10px;margin-bottom:10px;'>";
            htm+="<div align='left'>";
            htm+="<span class='btmerah medium' id='bt_hide_"+idtb+"'>TUTUP</span>&nbsp;&nbsp;";
            
            htm+="</div>";
            htm+="</div>";
            
            htm+="</div>";
            var obj=new Object;
            obj.html=htm;
            
            if(tabel.gettabel(b)!=null){
                tabel.gettabel(b).maxim(obj,c);
                var trparr=d.offsetParent.parentNode;
                var tdarr=trparr.childNodes;
                for(var n=0;n<tdarr.length;n++){
                    tdarr[n].removeAttribute("class");
                    tdarr[n].setAttribute("class","garis_kiri_td");
                }
                d.offsetParent.setAttribute("class","garis_kiri_td bghijau");
            };
            
            document.getElementById("bt_hide_"+idtb).onclick=function(){
                tabel.gettabel(b).minim(c);
                var trparr=d.offsetParent.parentNode;
                var tdarr=trparr.childNodes;
                for(var n=0;n<tdarr.length;n++){
                    tdarr[n].removeAttribute("class");
                    tdarr[n].setAttribute("class","garis_kiri_td");
                }
            };
            
            disposisisurat.loaddatactt(b,c);
		},
		loaddatactte:function(b,c){
			var idtb=b+"_"+c;
			$("#hal_ke_"+idtb).val(0);
			disposisisurat.loaddatactt(b,c);
		},
		loaddatactt:function(b,c){
			var idtb=b+"_"+c;
			var idsurat=tabel.gettabel(b).getdata(c,"id");
			var loaderdatasub=mload.loading({"el":"loader_sub_"+idtb});
			var hal=$("#hal_ke_"+idtb).val();
			var jumlah=$("#jumlah_hal_"+idtb).val();
			var posisiawal=(hal-1)*jumlah;
			
			var ik_data = {
				ajax: 1,
				mode: "mod",
				cl: "disposisisurat",
				ikdata: {0:"getdataCatatan",
					halaman:hal,jumlah:jumlah,
					idsurat:idsurat}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",
				type: "POST",
				dataType: "json",
				async:true,
				data: ik_data,
				success: function(e){
					if(e!=false && e.hasOwnProperty("data")){
						loaderdatasub.tutup();
						var data=e['data'];
						var jumlahhalaman=e['totalhalaman'];
						if(data.length>0){
							var htm="";
							for(var i=0;i<jumlahhalaman;i++){
								htm+="<option value=\""+(i+1)+"\">"+(i+1)+"</option>";
							}
							$("#hal_ke_"+idtb).html(htm);
							$("#hal_ke_"+idtb).val(hal);
							
							var tabeldata={
								box:"grid_sub_"+idtb,
								data:data,
								lebarmin:"500px",
								trklik:{"data":"id","fungsi":"barisklik"},
								title:"kategori Menu",
								tbclass:"table_grid-1",
								tabelpar:b,
                            	barispar:c,
								isi:[
										{"align":"center","judul":"Tanggal","tipe":"data","col":"tanggal","lebar":"140px","format":"tanggal"},
										{"judul":"Nama Pegawai","tipe":"data","col":"namapegawai","lebar":"120px"},
										{"col":"catatan","judul":"Catatan","tipe":"data"},
									],
								mod:"mod",
								module:"disposisisurat"
							};
							tabel.multisub(tabeldata);
						}else{
							loaderdatasub.pesan("TIDAK ADA DATA");
						}
					}
				}
			});
		},
		inputcatatan:function(){
			var ps={"box":"box_catatan",
				"judul":"Input Catatan Surat",tinggi:"auto","lebar":"700"};
	
			boxcatatansurat=boxwin.load(ps);
			boxcatatansurat.id=0;
			boxcatatansurat.idsurat=iddisposisisurat;
			boxcatatansurat.buka();
			
			$("#catatansurat").html("");
			$("#loader_catatansurat").html("");
		},
		editctt:function(a,b,c,d){
			var ps={"box":"box_catatan",
				"judul":"Edit Catatan Surat",tinggi:"auto","lebar":"700"};
	
			boxcatatansurat=boxwin.load(ps);
			boxcatatansurat.id=a;
			boxcatatansurat.idsurat=iddisposisisurat;
			boxcatatansurat.buka();
			
			$("#catatansurat").html(tabel.gettabel(b).getdata(c,"catatan"));
			$("#loader_catatansurat").html("");
		},
		simpancatatan:function(){
			$("#loader_catatansurat").html("");
			var ctt=$("#catatansurat").val();
			var err="";
			if(ctt=="") err+="Catatan belum di buat!";
			if(err!=""){
				$("#loader_catatansurat").html(err);
				return;
			}
			
			var loaderinctt=mload.loader({"keterangan":"Proses input catatan"});
			var fg="inputcatatansurat";
			if(boxcatatansurat.id>0) fg="editcatatansurat";
			
			var ik_data = {
				ajax: 1,
				mode: "mod",
				cl: "disposisisurat",
				ikdata: {0:fg,
					catatan:ctt,
					idsurat:boxcatatansurat.idsurat,
					id:boxcatatansurat.id}
			};
			
			$.ajax({
				url: lokal+"man.ajax.php",
				type: "POST",
				dataType: "json",
				async:true,
				data: ik_data,
				success: function(e){
					if(e!=false && e.hasOwnProperty("status")){
						if(e['status']==1){
							disposisisurat.getcatatansurat(iddisposisisurat);
							loaderinctt.tutup();
							disposisisurat.batalcatatan();
						}else{
							loaderinctt.error(e['pesan']);
						}
						
					}else{
						loaderinctt.error([{"pesan":"Terjadi kesalahan"}]);
					}
				}
			});
		},
		hapusctt:function(a,b,c,d){
			if(a<=0) return;
			var boxyesno=null;
			var databox={
				judul:"Yakin akan menghapus data catatan surat ini ?? ",
				proses:function(){
					var loaderhapusctt=mload.loader({"keterangan":"Proses hapus data.."});
					boxyesno.tutup();
					var ik_data = {
						ajax: 1,
						mode: "mod",
						cl: "disposisisurat",
						ikdata: {0:"hapusDatactt",id:a}
					};
					
					$.ajax({
						url: lokal+"man.ajax.php",
						type: "POST",
						dataType: "json",
						async:true,
						data: ik_data,
						success: function(e){
							if(e!=false && e.hasOwnProperty("status")){
								if(e['status']==1){
									loaderhapusctt.tutup();
									disposisisurat.getcatatansurat(iddisposisisurat);
								}else{
									loaderhapusctt.error(e['pesan']);
								}
							}else{
								loaderhapusctt.error([{"pesan":"Gagal hapus data"}]);
							}
						}
					});
				}
			};
			boxyesno=boxwin.yesno(databox);
			boxyesno.buka();
		},
		batalcatatan:function(){
			if(boxcatatansurat!=null) boxcatatansurat.tutup();
			boxcatatansurat=null;
		},
		lihatdokumen:function(a){
			var iddok=a;
			if(iddok<=0) return;
			var myWindow = window.open(lokal+"service.php?pos=disposisisurat&mode=mod&fl=download&id="+iddok, "", "left=100,top=50,width=800, height=600");
		},
		cetaksurat:function(){
			var jenissurat=$("#frmjenissurat").html();
			//var namapegawai=$("#frmjenissurat").html();
			var judulsurat="Cetak "+jenissurat;
			//if(namapegawai!="") judulsurat+=" "+namapegawai; 
			var obj={
				"judul":judulsurat,
				"lib":namalib,
				"data":{"idsurat":iddisposisisurat,"prev":1}
			};
			cetak.cetaksample(obj);
		}
	};
})();