<style type="text/css">
	.notif_efiling{
		display: block;
		background-color:orange;
	    border:1px solid orange;
	    color:white;
	    font:12px/13px Verdana;
	    min-height:16px;
	    max-height: 20px;
	    min-width:12px;
	    max-height: 16px;
	    padding:2px 3px 0 3px;
	    text-align:center;
	    position:absolute;
	    border-radius:19%;
	    z-index:999;
	    right: 5px;
	    top:-10px;
	     animation: mendalo 2s infinite;
		 -webkit-animation: mendalo 1s infinite;
		 -moz-animation: mendalo 7s infinite;
		 -o-animation: mendalo 1s infinite;
	}
	.hidden{
		display: none;
	}

	@-webkit-keyframes mendalo {
	 0%, 20%, 50%, 80%, 100% {-webkit-transform: translateX(0);} 
	 40% {-webkit-transform: translateX(-0px);}
	 60% {-webkit-transform: translateX(-40px);}
	}
	 
	@-moz-keyframes mendalo {
	 0%, 20%, 50%, 80%, 100% {-moz-transform: translateY(0);}
	 40% {-moz-transform: translateX(-18px);}
	 60% {-moz-transform: translateX(-15px);}
	}
	 

	@keyframes mendalo {
	 0%, 20%, 50%, 80%, 100% {transform: translateX(0);}
	 40% {transform: translateX(-0px);}
	 60% {transform: translateX(-40px);}
	}
</style>

<script type="text/javascript">
$( document ).ready(function() {
	var cek_efiling="<?php echo $this->session->userdata('cek_efiling') ?>";
	//set datetime format RFC3339
	var tc = new Date("<?php echo date("Y-m-d\TH:i:s\Z", strtotime($this->session->userdata('timer_cek_efiling'))) ?>");
	var today = new Date();
	var timer = 60 * 60 * 1000 - (today-tc);
	
    $("body").css({ overflow: 'inherit' })
	$('#loading').hide();
	$('a').click(function(event){
		var id = $(this).attr('id');
		if($(this).attr('href')!='#' && $(this).attr('href').substring(1,0)!='#' && id !='noLoading'){
			openLoadingDialog();
		}
	});
	if (cek_efiling==1) {
			getefiling();
			if (timer < 0 ){
			getefiling();
			reset_ses_ef();
		}
	}
	var notifikasi=setInterval(function(){
			$.ajax({
			     url:"<?php echo base_url('efiling/cek_efiling_server_lokal');?>",
			     dataType:'json',
			     success: function(json) {
			     		if (json.st==1){
			     			$('.notif_efiling').empty();
			     			$('.notif_efiling').append(json.value);
			     			$('.notif_efiling').removeClass('hidden');
			     		}else{
			     			$('.notif_efiling').empty();
			     			$('.notif_efiling').addClass('hidden');
			     		}
		         },
		     })
	}, 10000);
});
function getefiling(){
	$.ajax({
	    url: '<?php echo base_url('efiling/get_efiling_masuk');?>',
	    dataType:'json',
	});	
}
function reset_ses_ef(){
	$.ajax({
	     type: "POST",
	     url: "<?php echo base_url();?>"+'efiling/reset_session_efiling',
	});	
}
</script>