	
	var interval;
	var is_done = 0;
	function new_inventura_close(rbr, uploaded){
		if(rbr == 1){
			var ul = document.getElementById('all-codes');
			var items = ul.getElementsByTagName('li');
			var l_cnt = 0;
			interval = setInterval(function(){
			
				l_cnt++;
				
				if(l_cnt - 1 >= items.length){
					clearInterval(interval);
				}
				
				if(l_cnt - 1 < items.length){
				
					parent.subform_new_row(129, 0, 0, 0, 0, '', 'Inventura');
				
					setTimeout(function(){
						if(is_done == 0){
							parent.document.getElementById('formfield_2_' + l_cnt + '_1').value = items[l_cnt - 1].getAttribute('id').replace('code-', '');
							//console.log(items[l_cnt - 1].getAttribute('id').replace('code-', ''));
						}
					}, 125);
					setTimeout(function(){
						if(is_done == 0){
							var l_obj = parent.document.getElementById('formfield_2_' + l_cnt + '_1');
							parent.get_inventura_data(l_obj, '2', '5', '6', '15', '16', '3', '4', '12', '2', '3');
							//parent.select_ajax_fill(l_obj, 154, 2, 0);
						}
					}, 200);
					setTimeout(function(){
						if(is_done == 0){
							parent.document.getElementById('formfield_16_' + l_cnt + '_1').value = items[l_cnt - 1].innerHTML;
						}
					}, 300);
					setTimeout(function(){
						if(is_done == 0){
							var l_obj = parent.document.getElementById('formfield_16_' + l_cnt + '_1');
							parent.get_razlika_inventura(l_obj, '16', '3', '15', '4', '12', '5', '6', '2', '3');
						}
					}, 375);
					
				}
				
				if(l_cnt - 1 >= items.length){
					is_done = 1;
					parent.document.getElementById('clickHereIDInv').style.display = 'none';
				}
			}, 500);
		}
		parent.document.getElementById('dodajDatotekuLayer').style.display = 'none';
	}
	parent.window.onblur = function(){
		clearInterval(interval);
		if(is_done == 0){
			is_done = 1;
			parent.document.getElementById('subformRedak1_0').innerHTML = '';
			parent.a_redak[0] = 0;
			parent.a_is_redak_set[0] = 1;
		}
	}
