// <!--
// Browser identification
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion);
var is_ns    = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)                 && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)              && (agt.indexOf('webtv')==-1));
var is_ns4up = (is_ns && (is_major >= 4));
var is_ie    = (agt.indexOf("msie") != -1);
var is_ie4up = (is_ie  && (is_major >= 4));
var is_docom = (document.getElementById);
if (is_ie) {
	is_docom = 0;
}
if (is_docom) {
	is_ns    = 0;
	is_ns4up = 0;
}

// PopUp Menus...
var LAYER = 0;
var lastMenu = false;
var timeOut = 1000;
var timeoutId = false;
var x, y;

var NS = (is_ns4up) ? 1 : 0;
var IE = (is_ie4up) ? 1 : 0;
var DC = (is_docom) ? 1 : 0;
LAYER = (NS || IE || DC) ? 1 : 0;

var SHOW;
var HIDE;

if (IE) {
SHOW = "visible";
HIDE = "hidden";
} else if (NS || DC) {
SHOW = "show";
HIDE = "hide";
}


function getDim(el){
var rd = {x:0,y:0}
el=document.getElementById(el);
//el=document[el];
 do{
	rd.x += el.offsetLeft
	rd.y += el.offsetTop
	el = el.offsetParent
 } while(el)
return rd
}

function myMouseOver(e) {
if (NS) {
x = e.pageX;
y = e.pageY;
}
if (IE) {
x = window.event.x;
y = window.event.y;
}

return y;
}


// Floating menu
function createLayers(menuName,topPos) {
mem = getDim(menuName);
topPos=mem.y;
//topPos=100;
      if (LAYER) {
		if (NS) {
			screenWidth = window.innerWidth;
			document.layers[menuName].left = x+20;
			document.layers[menuName].top  = topPos;
		} else if (DC) {
			screenWidth = window.innerWidth;
			document.getElementById(menuName).left = x+20;
			document.getElementById(menuName).top  = topPos;
		} else if (IE) {
			//topPos = topPos + 15;
			screenWidth = document.body.clientWidth + 18;
			document.all[menuName].style.pixelLeft = x+20;
			document.all[menuName].style.pixelTop  = topPos;
		}
	}
}

function kick(menuName,status,topPos) {
mem = getDim(menuName);
topPos=mem.y;
	if (LAYER) {
		if (status) {
			createLayers(menuName,topPos);
			if (NS) {
				document.layers[menuName].visibility = SHOW;
			} else if (DC) {
				document.getElementById(menuName).style.visibility = SHOW;
			} else if (IE) {
				document.all[menuName].style.visibility = SHOW;
			}
		} else {
			if (NS) {
				document.layers[menuName].visibility = HIDE;
			} else if (DC) {
				document.getElementById(menuName).style.visibility = HIDE;
			} else if (IE) {
				document.all[menuName].style.visibility = HIDE;
			}
		}
	}
}

function popUp(menuName,show,topPos) {
	if (LAYER) {
		if (lastMenu) {
			kick(lastMenu,false,topPos);
		}
		if (show) {
			kick(menuName,true,topPos);
		}
	lastMenu = menuName;
	clearTimeout(timeoutId);
	}
}

function hide(menuName,topPos) {
	toFunc = "popUp('" + menuName + "',false,'" + topPos + "')";
	timeoutId = setTimeout (toFunc,timeOut);
}



var windowFeatures = 
'resizable=1,scrollbars=1,menubar=0,location=0,toolbar=0,statusbar=0';
var title_img = '';
var popis = '';
var imgUR = '';

function showImage (imgURL,title,popi,w,h) { 
  title_img = title;
  if(popi) popis = popi;
  imgUR = imgURL;
  
  windowFeatures = windowFeatures+",width="+(w+15)+",height="+(h+50);
//    okno = open(imgURL, 'okno', windowFeatures);
//    html = "<table border=0><tr><td><img src='"+imgURL+"' border=0></td></tr><tr><td>"+title+" - "+popis+"</td></tr></table>";
//    okno.document.write(html);
//    okno.document.close();

openImageWindow();
}

function isLoaded() {
 return loaded;
}

function openImageWindow (evt) {
  if (window.innerWidth) {
    var w = this.width+10;
    var h = this.height+110;
    var win = open('about:blank', '_blank', 'innerWidth=' + w + ',innerHeight=' + h + ',' + windowFeatures);
    var html = '';
    html += '<HTML><HEAD>';
    html += '<STYLE>';
    html += '#imgContainer { position: absolute; left: 5px; top: 5px; align: center}';
    html += '<\/STYLE>';
    html += '<TITLE>'+title_img+'<\/TITLE>';        
    html += '<\/HEAD>';
    html += '<BODY>';
    html += '<DIV ID="imgContainer">';
    html += '<IMG SRC="' + imgUR + '"><br>';
    html += popis+'<\/DIV>';
    html += '<\/BODY><\/HTML>';
    win.document.open();
    win.document.write(html);
    win.document.close();
  }
  else if (document.all) {
    var w1 = this.width+10;
    var h1 = this.height+110;
    var win1 = open('about:blank', '_blank', 'width=' + w + 'height=' + h + ',' + windowFeatures);
    var html1 = '';
    html1 += '<HTML><HEAD>';
    html1 += '<STYLE>';
    html1 += '#imgContainer { position: absolute; left: 5px; top: 5px; }';
    html1 += '<\/STYLE>';
    html1 += '<TITLE>'+title_img+'<\/TITLE>';    
    html1 += '<\/HEAD>\n';
    html1 += '<BODY onLoad="window.opener.loaded=true">';
    html1 += '<CENTER>\n<SPAN ID="imgContainer">';
    html1 += '<IMG SRC="' + imgUR + '"><br>';
    html1 += popis;
    html1 += '<\/SPAN>\n<\/CENTER>';
    html1 += '<\/BODY><\/HTML>';
    win1.document.open();
    win1.document.write(html1);
    win1.document.close();
    win1.resizeBy (w1 - win1.document.body.clientWidth,
                  h1 - win1.document.body.clientHeight);
    win1.document.body.scroll = 'yes';

  }
}
