var IE = document.all?true:false

//change the opacity for different browsers
function setOpacity(object, value) {
	object.style.opacity = value/10;
	object.style.filter = 'alpha(opacity=' + value*10 + ')';
}

// zavesa
document.write('<div id="curtain" style="height:100%; width:100%; position:absolute; background-color: #000; opacity: 0.4; filter:alpha(opacity=40); display:none;"></div>');
function Curtain(color) {
	color = typeof(color) != 'undefined' ? color : "#000";

	document.getElementById("curtain").style.display = ''; 
	document.getElementById("curtain").style.backgroundColor = color; 
}
function UnCurtain() { document.getElementById("curtain").style.display = 'none'; }

// funkcija za ajax
function getXmlHttpRequestObject() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else if(window.ActiveXObject) {
		return new ActiveXObject('Microsoft.XMLHTTP');
	} else {
		alert('Vas brskalnik ne podpira zahtevane tehnologije.');
	}
}

function getElemenXPos(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
		} while (obj = obj.offsetParent);
	}
	return curleft;
}

function getElemenYPos(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		do {
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return curtop;
}