function open_window(url, name, width, height) {
	var left=Math.floor((screen.width-width)/2);
	var top=Math.floor((screen.height-height)/2);
	secondWindow=window.open(url, name,'status=no,width='+width+',height='+height+',top='+top+',left='+left+',resizable=yes,menubar=no,scrollbars=1,toolbar=no,location=no,directories=no');
}

function email_decode(email, text) {
	var out = '';
	var href = true;
	if (email == '') {
		href = false;
		email = text;
	}
	email = email.replace(/ \((zavináč|at)\) /gi, '@');
	email = email.replace(/ \((tečka|dot)\) /gi, '.');
	if (text == '') {
		text = email;
	}
	if (href) {
		document.write ('<a href="mailto:'+email+'">'+text+'</a>');
	} else {
		document.write (email);
	}
}

function set_lang(lang) {
	var time = new Date();
	time.setFullYear(time.getFullYear() + 3);
	document.cookie = 'lang=' + lang + '; expires=' + time.toGMTString() + '; path=/';
	return true;
}

function check_scr_height(height) {
	if (((document.all)?top.document.body.clientHeight:top.innerHeight) < height) {
		var a;
		if (a = document.getElementById('prev')) {
			a.href += '#h';
		}
		if (a = document.getElementById('next')) {
			a.href += '#h';
		}
	}
}
