var shraniBarva = new Array(15);
var shraniBarva2 = new Array(15);
var _POPUP_FEATURES = 'location=0,  statusbar=0,  menubar=0,  width=715,  height=615';
function oznON(x)
{
	oznacen2=document.getElementById(x);
	var trs = oznacen2;
    var tds = trs.getElementsByTagName("td");
  // and iterate through them...
	  for (var j = 0; j < tds.length; j++) {	
		var mytd = tds[j];
		// or backgroundColor style
		shraniBarva[j]=mytd.style.backgroundColor;
		shraniBarva2[j]=mytd.style.color;
		//mytd.style.backgroundColor = "#DCE6FF";		 
		mytd.style.backgroundColor = "#3F7FE0";
		mytd.style.color = "#FFF";
	  }

}

function oznOFF(x)
{
	oznacen2=document.getElementById(x);
	var trs = oznacen2;
    var tds = trs.getElementsByTagName("td");
  // and iterate through them...
	  for (var j = 0; j < tds.length; j++) {	
		var mytd = tds[j];
		mytd.style.backgroundColor = shraniBarva[j];
		mytd.style.color = shraniBarva2[j];
	  }
}
function max(a,b)
{
	if(a>b)
		return a;
	return b;
}
function posit(koga,d1,d2,d3,d4)
{
	var kdo,x1,x2,x3,naj;
	if(document.getElementById(d1)==null)
		d1=d4;
	kdo=document.getElementById(koga);
	x1 = document.getElementById(d1).offsetHeight + document.getElementById(d1).offsetTop;
	x2 = document.getElementById(d2).offsetHeight + document.getElementById(d2).offsetTop;
	x3 = document.getElementById(d3).offsetHeight + document.getElementById(d3).offsetTop;
	naj = max(x1,x2);
	naj = max(naj,x3);
	kdo.style.top = naj+10+"px";	
}
function isUndefined(a) { return typeof a == 'undefined'; }
function raw_popup(url, target, features) {
  if (isUndefined(features)) {    features = _POPUP_FEATURES;  }
  if (isUndefined(target)) {    target = '_blank';  }
  var theWindow =window.open(url, target, features);
  theWindow.focus();
  return theWindow;
}

function link_popup(src, features) {
  return    raw_popup(src.getAttribute('href'),  src.getAttribute('target') || '_blank',   features);
}
