text: var popupBarangRKBMD_v2 = new DaftarObj2({
  	prefix : 'popupBarangRKBMD_v2',
  	url : 'pages.php?Pg=popupBarangRKBMD_v2', 
  	formName : 'popupBarangRKBMD_v2Form',
  	kodeBarang : 'kodeBarang',
  	namaBarang: 'namaBarang',
  	satuanBarang: 'satuanBarang',
  	
  	loading:function(){
  		//alert('loading');
  		this.topBarRender();
  		this.filterRender();
  		this.daftarRender();
  		this.sumHalRender();
  	},
  		
  	daftarRender:function(){
  		var me =this; //render daftar 
  		addCoverPage2(
  			'daftar_cover',	1, 	true, true,	{renderTo: this.prefix+'_cont_daftar',
  			imgsrc: 'images/wait.gif',
  			style: {position:'absolute', top:'5', left:'5'}
  			}
  		);
  		$.ajax({
  		  	url: this.url+'&tipe=daftar',
  		 	type:'POST', 
  			data:$('#'+this.formName).serialize(), 
  		  	success: function(data) {		
  				var resp = eval('(' + data + ')');
  				document.getElementById(me.prefix+'_cont_daftar').innerHTML = resp.content;
  				me.sumHalRender();
  		  	}
  		});
  	},
  	
  	Baru:function(){
  		var me = this;
  		var cover = this.prefix+'_formcover';
  		document.body.style.overflow='hidden';
  		addCoverPage2(cover,1,true,false);	
  		$.ajax({
  			type:'POST', 
  			data:$('#'+this.formName).serialize(),
  		  	url: this.url+'&tipe=formBaru',
  		  	success: function(data) {		
  				var resp = eval('(' + data + ')');
  				if (resp.err ==''){
  					document.getElementById(cover).innerHTML = resp.content;			
  					me.AfterFormBaru(resp);	
  				}else{
  					alert(resp.err);
  					delElem(cover);
  					document.body.style.overflow='auto';
  				}			
  				
  		  	}
  		});
  	},
  	windowShow: function(){
  		var me = this;
  		var cover = this.prefix+'_cover';
  		document.body.style.overflow='hidden';
  		addCoverPage2(cover,4,true,false);	
  		$.ajax({
  			type:'POST', 
  			data:$('#'+this.formName).serialize(),
  			url: this.url+'&tipe=windowshow',
  		  	success: function(data) {		
  				var resp = eval('(' + data + ')');	
  				if(resp.err==''){
  					document.getElementById(cover).innerHTML = resp.content;	
  					me.loading();					
  				}else{
  					alert(resp.err);
  					delElem(cover);
  					document.body.style.overflow='auto';
  				}
  		  	}
  		});
  	},
  		
  	windowClose: function(){
  		document.body.style.overflow='auto';
  		delElem(this.prefix+'_cover');
  	},
  	formatCurrency:function(num) {
  		num = num.toString().replace(/\$|\,/g,'');
  		if(isNaN(num))
  		num = "0";
  		sign = (num == (num = Math.abs(num)));
  		num = Math.floor(num*100+0.50000000001);
  		cents = num%100;
  		num = Math.floor(num/100).toString();
  		if(cents<10)
  		cents = "0" + cents;
  		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
  		num = num.substring(0,num.length-(4*i+3))+'.'+
  		num.substring(num.length-(4*i+3));
  		return (((sign)?'':'-') + '' + num + ',' + cents);
  	},
  	formatCurrency2:function(num) {
  		num = num.toString().replace(/\$|\,/g,'');
  		if(isNaN(num))
  		num = "0";
  		sign = (num == (num = Math.abs(num)));
  		num = Math.floor(num*100+0.50000000001);
  		cents = num%100;
  		num = Math.floor(num/100).toString();
  		if(cents<10)
  		cents = "0" + cents;
  		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
  		num = num.substring(0,num.length-(4*i+3))+'.'+
  		num.substring(num.length-(4*i+3));
  		return (((sign)?'':'-') + '' + num );
  	},
  	windowSave: function(id){
  		var me= this;
  		//alert('save');
  		/*var errmsg = this.CekCheckbox();*/
  
  			
  			var c1 = $("#urusan").val().split(".");
  			c1 = c1[0]; 
  			var c = $("#bidang").val().split(".");
  			c = c[0]; 
  			var d = $("#skpd").val().split(".");
  			d = d[0];
  			var e = $("#unit").val().split(".");
  			e = e[0];
  			var e1 = $("#subunit").val().split(".");
  			e1 = e1[0];
  			 
  			
  			var cover = 'refprogram_getdata';
  			addCoverPage2(cover,1,true,false);				
  			$.ajax({
  				url: 'pages.php?Pg=popupBarangRKBMD_v2&tipe=getdata&id='+id,
  				type : 'POST',
  				data : {c1 : c1, c : c, d : d,e : e,e1 : e1},
  			  	success: function(data) {		
  					var resp = eval('(' + data + ')');			
  					delElem(cover);
  					if(resp.err==''){
  						 $("#kodeBarang").val(resp.content.kodeBarang) ;
  						 $("#namaBarang").val(resp.content.namaBarang);
  						 $("#satuanBarang").val(resp.content.satuanBarang) ;
  						 $("#jumlahKebutuhanMaksimal").val(resp.content.kebutuhanMaksimal) ;
  						 $("#jumlahKebutuhanOptimal").val(resp.content.kebutuhanOptimal) ;
  						 $("#jumlahKebutuhanRiil").val(resp.content.kebutuhanRill) ;
  						me.windowClose();
  					}else{
  						alert(resp.err)	
  					}
  			  	}
  			});		
  		
  	},
  	windowSaveAfter: function(){
  		//alert('tes');
  	},		
  	AfterSimpan : function(){
  		if(document.getElementById('Kunjungan_cont_daftar')){
  		this.refreshList(true);}
  	},
  	
  	Simpan: function(){
  		var me= this;	
  		this.OnErrorClose = false	
  		document.body.style.overflow='hidden';
  		var cover = this.prefix+'_formsimpan';
  		addCoverPage2(cover,1,true,false);	
  		/*this.sendReq(
  			this.url,
  			{ idprs: 0, daftarProses: new Array('simpan')},
  			this.formDialog);*/
  		$.ajax({
  			type:'POST', 
  			data:$('#'+this.prefix+'_form').serialize(),
  			url: this.url+'&tipe=simpan',
  		  	success: function(data) {		
  				var resp = eval('(' + data + ')');	
  				delElem(cover);		
  				//document.getElementById(cover).innerHTML = resp.content;
  				if(resp.err==''){
  					alert('Data berhasil disimpan');
  					me.Close();
  					me.refreshList(true);
  					me.AfterSimpan();	
  				}
  				else{
  					alert(resp.err);
  				}
  		  	}
  		});
  	}
  });
  