var name = null;
var dom = true;

if (parseInt(navigator.appVersion)<5) dom=false;
function show(name, sx, sy) {	
	if (dom) {
		ob=document.getElementById(name);
		ob.style.visibility="visible";
		ob.style.left=document.width / 2 - (350 / 2);
		ob.style.top=200;
	} else {

		if (!document.all) { move_x = Math.round(document.layers[name].document.width / 2);
			move_y = Math.round(document.layers[name].document.height / 2); }
		else {	move_x = Math.round(sx/2);
			move_y = Math.round(sy/2); }
		if (!document.all) { y = window.innerHeight;
			x = window.innerWidth;
			x = Math.round(x/2) - move_x;
			y = Math.round(y/2) - move_y;
			y = (y + pageYOffset) - 15;
			document.layers[name].x = x;
			document.layers[name].y = y;
			document.layers[name].visibility = "show"; 
		}
		else {	x = document.body.clientWidth;
			y = document.body.clientHeight;
			x = Math.round(x/2) - move_x;
			y = Math.round(y/2) - move_y;
			y = y + document.body.scrollTop;
			document.all[name].style.posLeft = x;
			document.all[name].style.posTop = y;
			document.all[name].style.visibility = "visible";
		}
	}
}
function hide(name) {
	if (dom) {
		ob=document.getElementById(name);
		ob.style.visibility="hidden";
	} else {

		if (document.all) { document.all[name].style.visibility = "hidden"; }
		else { document.layers[name].visibility = "hide"; }
	}
}

var normal = null;
var bold = null;

normal = new Image(20,16);
normal.src = "pic/obalka-bila.gif";
bold = new Image(20,16);
bold.src = "pic/obalka-zelena.gif";

function hiLite(imgDocID, imgObjName, comment) {
	document.images[imgDocID].src = eval(imgObjName + ".src");
	window.status = comment;
	return true;
}

function set_to(to,br) 
{ 
	var element=null;
	var selection=null;
	
	if (br) { 
		element="\n"; 
	} else {
		element="<BR>\n";
	}

        if (navigator.userAgent.indexOf("MSIE")>0) {
        	selection = document.selection.createRange().text;
	} else {
		selection = document.getSelection();
	}						        
	
	if (selection) {
		document.getElementById("text").value="<B>" + to + "</B>:" + element + "<I>" + selection + "</I>" + element + element; 
	} else {
		document.getElementById("text").value="<B>" + to + "</B>:"; 
	}
} 
