	function new_image_close(rbr, dest){
		parent.document.getElementById('imgdiv_' + rbr).style.display = 'none';
		if(dest){
			parent.document.getElementById('formfield_' + rbr).value = dest;
			parent.document.getElementById('imgfield_' + rbr).src = 'res/images/person/1/' + dest;
		}
	}
	
	function new_document_close(rbr, dest, name, activeDocument, red_redak){
		parent.document.getElementById('dodajDatotekuLayer').style.display = 'none';
		
		if(activeDocument){
			/*
			if(openNewRow){
				parent.subform_new_row(14, 0, 0, activeDocument);
			}
			*/
			
			var l_redak = '';
			if(parent.redak){
				//l_redak = '_' + parent.redak;
				l_redak = '_' + red_redak;
			}
			/*
			alert(l_redak);
			alert(rbr);
			alert('formfield_' + rbr);
			alert(parent.document.getElementById('formfield_' + rbr).value);
			
			alert('dodajDatotekuImg_1');
			alert(parent.document.getElementById('dodajDatotekuImg').innerHTML);
			alert(parent.document.getElementById('dodajDatotekuImg_1').innerHTML);
			*/
			
			parent.document.getElementById('formfield_' + rbr).value = 'res/documents/files/1/' + dest;
			parent.document.getElementById('lnkDodajDatoteku' + l_redak).style.display = 'none';
			parent.document.getElementById('dodajDatotekuImg' + l_redak).innerHTML = '<img src="res/images/document.jpg" border="0" title="Datoteka je dodana">';
			/*
			alert(parent.document.getElementById('dodajDatotekuImg' + l_redak).innerHTML);
			alert(parent.document.getElementById('formfield_' + rbr).value);
			*/
		}else{
			if(dest){
				parent.document.getElementById('formfield_' + (rbr - 1)).value = 1;
				parent.document.getElementById('formfield_' + rbr).value = 'res/documents/files/1/' + dest;
				parent.document.getElementById('formfield_' + parseInt((parseInt(rbr) + 1))).value = name;
				parent.document.getElementById('dodajDatotekuImg').innerHTML = '<img src="res/images/document.jpg" border="0" title="Datoteka je dodana">';
			}
		}
	}
	
