function sendText(text) { opener.document.getElementById('<? echo $cell; ?>').value = text; window.close(); }

function vozicek(dokument) {
		Dialog.alert(
		{url: dokument, options: {method: 'get'}},
		{windowParameters: {className: "alphacube", width:650, height:500}, title:"NAKUPOVALNI VOZICEK", okLabel: "Zapri vozicek"});
}

function pokazi_sliko(slika) {
		Dialog.alert('<br /><img src="'+ slika +'" />',
		{windowParameters: {className: "alphacube", width:700, height:500}, title:"OGLED SLIKE", okLabel: "ZAPRI"});
}

function html_ex(dokument) {
var win = new Window({className: "spread", title: "HTML KODA", 
                      left:10,width:800, height:500, 
                      url: dokument, showEffectOptions: {duration:1.5}})
win.show();  
}

function infoDialog() {
	var timeout;
	function openInfoDialog() {
	Dialog.info("Test of info panel, it will close <br>in 3s ...",
		{width:250, height:100, showProgress: true});
		timeout=3;
		setTimeout(infoTimeout, 1000)
	}
	function infoTimeout() {
  		timeout--;
  		if (timeout >0) {
    		Dialog.setInfoMessage("Test of info panel, it will close <br>in " + timeout + "s ...")
    		setTimeout(infoTimeout, 1000)
 		}else Dialog.closeInfo()
	}
	openInfoDialog(); 
}

//**********************
// AJAX
//**********************
// PODPORA ZA RAZLICNE BRSKALNIKE

function ajaxRequest(location,ins_document,post,fields) {
	document.getElementById(location).innerHTML = '<span style="text-align:center"><strong>Trenutek, nalagam vsebino ...</strong><br /><br /><br /><img src="./core/jscript/ajax-loader.gif" title="Working, please wait" /></span>';
	var AJAX = null;
	if (window.XMLHttpRequest) {	AJAX=new XMLHttpRequest();
	} else {	AJAX=new ActiveXObject("Microsoft.XMLHTTP");	}
	if (AJAX==null) {	alert("Your browser doesn't support AJAX.");	return false
	} else {
		AJAX.open("POST", ins_document, true);
		if (post) {
			if (post==1) {
				var passData = '';/*
				var myTextField = document.getElementById('vnos_1');
				if(myTextField.value != "") alert("You entered: " + myTextField.value);
				else alert("Would you please enter some text?");*/
				/*for (i=1;i<fields;i++) {
					passData=passData+'vnos_'+i+'='+document.getElementById('vnos_1').innerHTML+'&';
				}*/
			}
			AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			AJAX.send(passData);
		} else { // GET
			AJAX.send(null); 
		}	
		AJAX.onreadystatechange = function() {
			if (AJAX.readyState==4 || AJAX.readyState=="complete") {
				//callback(AJAX.responseText, AJAX.status); 
				document.getElementById(location).innerHTML = AJAX.responseText;
			}                               
		}
	}
}