function getWindowHeight()
{
	var windowHeight = 0;
	if(typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if(document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if(document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function setbodyheight()
{
	var windowHeight = getWindowHeight();
	if(windowHeight > 0) {
		var bodyx = document.getElementById('bodyx');
		if(bodyx)
			if(document.all && (navigator.appVersion.indexOf("MSIE 7.")==-1) && (navigator.appVersion.indexOf("MSIE 8.")==-1))
		        bodyx.style.height = (windowHeight - 394) + 'px';
			else
				bodyx.style.minHeight = (windowHeight - 392) + 'px';
	}
}

window.onload = function()
{
	setbodyheight();
}

window.onresize = function()
{
	setbodyheight();
}

function vBarSwitch(elementID, color)
{
	var vBarElement = document.getElementById(elementID);
	vBarElement.style.borderLeft = '5px solid ' + color;
}

function popwindow(querystring, width, height)
{
	var popwindow = window.open('include/popimage.php' + querystring, null, 'top=128, left=128, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=' + width + ', height=' + height);
	var agt=navigator.userAgent.toLowerCase();
	this.nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
		&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
		&& (agt.indexOf('webtv')==-1));
	this.opera = (agt.indexOf("opera") != -1);
	if(nav){
		popwindow.resizeTo(width+7, height+48);
	}
	else if(opera) {
		popwindow.resizeTo(width+12, height+31);
	}
	else {
		popwindow.resizeTo(width+10, height+29);
	}
	popwindow.focus();
}

function popwindowconditions()
{
	var popwindow = window.open('/content/opci_uvjeti_koristenja.html', '1', 'top=128, left=128, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=' + 500 + ', height=' + 600);
	
	popwindow.focus();
}

function popwindowacode()
{
	var popwindow2 = window.open('/content/sifra_zastupnika.html', '2', 'top=128, left=128, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=' + 320 + ', height=' + 175);
	
	popwindow2.focus();
}

function UnCryptMailTo(s)
{
	var n = 0;
	var r = "";
	for(var i = 0; i < s.length; i++)
	{
		n=s.charCodeAt(i);
		if (n >= 8364)
		{
			n = 128;
		}
		r += String.fromCharCode(n - (2));
	}
	return r;
}

function linkTo_UnCryptMailTo(s)
{
	location.href=UnCryptMailTo(s);
}


