//fce obarvuje radky a muze pustit nejakou dalsi fci
function getRow(rowHandle, rowId, action, actionColor,secColor,defColor)
{
  var theCells = null;

  if (typeof(rowHandle.style) == 'undefined') //pokud nejde urcit radek tak exit
    return false;

  if(action == 'click') {
    if((selectedRow == null) || (selectedRow != rowHandle)) {
      paintRow(rowHandle,actionColor);
	
	  if (selectedRow != null) 
	    paintRow(selectedRow,defColor);
	  selectedRow = rowHandle;
	}  
	else {
	  paintRow(rowHandle,secColor);
	  if (selectedRow != null) 
	    selectedRow = null;
	}  
  }	
  if( (action != 'click') && ((selectedRow == null) || (selectedRow != rowHandle)) )
    paintRow(rowHandle,actionColor);
  
   if( (action == 'click') && (selectedRow == rowHandle))
     rowAction(rowHandle,rowId);
  if( (action == 'click') && (selectedRow == null))
     rowAction(rowHandle,0);	 
    
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//vysouvaci submenu

function IsB() {
    agent  = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns    = ((agent.indexOf('mozilla')   !=   -1) && 
                 ((agent.indexOf('spoofer')   ==   -1) && 
                  (agent.indexOf('compatible') ==  -1)));
    this.ns4   = (this.ns && (this.major      ==    4));
    this.ns6   = (this.ns && (this.major      >=    5));
    this.ie    = (agent.indexOf("msie")       !=   -1);
    this.ie3   = (this.ie && (this.major      < 4	));
    this.ie4   = (this.ie && (this.major      ==    4) && 
                 (agent.indexOf("msie 5.0")   ==   -1));
    this.ie5   = (this.ie && (this.major      ==    4) && 
                 (agent.indexOf("msie 5.0")   !=   -1));
    this.ie55  = (this.ie && (this.major      ==    4) && 
                 (agent.indexOf("msie 5.5")   !=   -1));
    this.ie6   = (this.ie && (agent.indexOf("msie 6.0")!=-1) );
}
var is = new IsB();

var layerRef;
var styleSwitch;

function whatis(){

	if (is.ie5|| is.ie55|| is.ie6|| is.ns6){
		return 'new';
	} else if(is.ie4){
	
		return 'ieold';
	} else if(is.ns4) {

		return 'nsold';
	}
}

function init(){
	if (whatis() == 'new') {
		layerRef="document.getElementById";
		styleSwitch=".style";
	}else if(whatis() == 'ieold'){
		layerRef="document.all";
	    styleSwitch=".style";
	}else{
		layerRef="document.layers";
	    styleSwitch="";
	}
}

function openmenu(name,id){
  init();
	if (whatis()=='ieold' || whatis()=='nsold'){
	  eval(layerRef+'["'+name+'"]'+styleSwitch+'.visibility="visible"');
	}else{
	  eval(layerRef+'("'+name+'")'+styleSwitch+'.visibility="visible"');		
	}
	  if(id)select(id);
}

function closemenu(menuname){
  init();
  if(notNN() && !(window.event.toElement && window.event.toElement.className != "menu"))return
  
  if (whatis()=='ieold' || whatis()=='nsold'){
      eval(layerRef+'["eshop"]'+styleSwitch+'.visibility="hidden"');
	}else{
	  eval(layerRef+'("lynx")'+styleSwitch+'.visibility="hidden"');   
	}
}
function closepodmenu(menuname){
  init();
  if(notNN() && !(window.event.toElement && window.event.toElement.className != "menu"))return
  
  if (whatis()=='ieold' || whatis()=='nsold'){
	eval(layerRef+'["bios"]'+styleSwitch+'.visibility="hidden"');   
	}
	else
	{
	eval(layerRef+'("bios")'+styleSwitch+'.visibility="hidden"');   
	}
}

var canSwitch = false;
if (parseInt(navigator.appVersion) >= 5 && navigator.appName != "Opera" || navigator.userAgent.indexOf("MSIE") != -1) {
    canSwitch = true;
}

plus = new Image();     plus.src = "images/pic_plus.gif";
minus = new Image();    minus.src = "images/pic_minus.gif";

function hide(kat, imgname){
if(canSwitch){
  var podmenu;
  podmenu = document.getElementById(kat);
  if(podmenu && podmenu.style) podmenu.style.display = 'none';
  eval("document."+imgname+".src=plus.src");
}
}

function show(kat, imgname){
if(canSwitch){
  var podmenu;
  podmenu = document.getElementById(kat);
  var visible = (podmenu.style.display!='none');
  if(visible){
      podmenu.style.display='none';
	  //eval("document."+imgname+".src=plus.src");
  }else{
      podmenu.style.display='block';
	  //eval("document."+imgname+".src=minus.src");
  }
}
return false;
}

function print_image(image_name, file_name) { //v2.0
  window.open("image.php?image_name=" + image_name + "&file_name=" + file_name,
		"","scrollbars=no,resizable=no")
}

function OpenWindow(wndName,wndPage, wndWidth, wndHeight, wndLeft, wndTop, showScrollBars, isParent,isFullScreen) {
  var scWidth = screen.width;
  var scHeight = screen.height;
  if(wndName == undefined) wndName = 'Noname';
  if(wndPage == undefined) {
    alert('Nelze zobrazit nedefinovanou stránku!');
	return false;
  }
  if(wndWidth == undefined) wndWidth = '300';
  if(wndHeight == undefined) wndHeight = '300';
  if(isParent == undefined) isParent = 'yes';
  if(isFullScreen == undefined) isFullScreen = 'no';
  if(showScrollBars == undefined) showScrollBars = 'no';
  
  if(wndLeft == undefined) {
     wndLeft = (scWidth - wndWidth)/2; 	
  } 
  
  if(wndTop == undefined) {
    wndTop = (scHeight - wndHeight)/2; 	
  }	

  wnd = window.open (wndPage, wndName, 'scrollbars=no,dependent='+isParent+',width='+wndWidth+',height='+wndHeight+',top='+wndTop+',left='+wndLeft+',fullscreen='+isFullScreen);
  wnd.focus();
}

// pocitadlo refresh

	var bTimeOut = false;
	function doOnScroll()
	{
	if(!bTimeOut)
	{
	pocitadlo.style.visibility = "hidden";
	window.setTimeout("pocitadlo.style.bottom = 20; pocitadlo.style.visibility = \"visible\"; bTimeOut = false;", 500)
	bTimeOut = true;
	}
}  