// JavaScript Document
<!--
//nahradi <zavinac> za @ a vytvori odkaz na odeslani mailu
function milto(addrs, subj){
	if(!confirm('Chcete napsat e-mail na adresu '+addrs.replace('XYZ', '@')+'?')) return;
	this.location='mailto:'+addrs.replace('XYZ', '@')+'?subject='+subj;
}


var curX=0;
var curY=0;
var tahni='';

//obsluha sledovani kurzoru a tazeni objektu "tahni"
function kurzor(cur)
{
	if(tahni=='') return;
	
	if(typeof event=='undefined'){	//neumis 'event', nejsi IE
		curX=cur.layerX;
		curY=cur.layerY;
	}
	else{
		curX=event.x;
		curY=event.y;
	}

	tahni.style.left=curX+20+'px';
	tahni.style.top=curY-20-tahni.offsetHeight+'px';
	tahni.style.visibility='visible';

	window.status=curX+', '+curY;
}
//zviditelnuje vrstvu s popisem drevin
function popup(jmenoElem, ukaz)
{
	objekt=document.getElementById(jmenoElem);
	
	if(ukaz){
		if(document.layers) document.captureEvents(Event.MOUSEMOVE);
		if(typeof event!='undefined') objekt.parentElement.style.zIndex=50;
		tahni=objekt;
		document.onmousemove=kurzor;
	}
	else{
		if(document.layers) document.captureEvents(null);
		objekt.style.visibility='hidden';
		document.onmousemove=null;
		if(typeof event!='undefined') objekt.parentElement.style.zIndex=0;
		tahni='';
	}
}

//nahrazuje innerText nefunkcni v mozille
/*function domInnerText(node, text)
{
	while (node.hasChildNodes()){
		node.removeChild(node.firstChild);
	}
	node.appendChild(document.createTextNode(text));
}*/
//pouziti - domInnerText(document.getElementById('varpopis'), "text");

//meni obrazek varianty a popisek
var varPosledni=0;
function varianta(objekt, hodnota){
	if(varPosledni && hodnota){
		document.getElementById('varpopis' + varPosledni).style.visibility="hidden";
		document.getElementById('varpopis' + varPosledni).style.display="none";
	}
	if(hodnota){
		varPosledni=hodnota;
		objekt.style.backgroundColor="#C93";
		objekt.style.cursor="pointer";
		document.getElementById('varpopis' + hodnota).style.visibility="visible";
		document.getElementById('varpopis' + hodnota).style.display="block";
		document.getElementById('vardetail').src='images/varianty/var'+hodnota+'.gif';
		document.getElementById('varfoto').src='images/varianty/var'+hodnota+'.jpg';
	}
	else{
		objekt.style.backgroundColor="";
	}
}

//meni src obrazku
function zmenaImg(caller, objekt, obrazek)
{
	caller.style.backgroundColor="transparent";
	document.getElementById(objekt).src=obrazek;
}

//meni src obrazku a pozadi elementu
function zmenaImgb(elem, objekt, obrazek)
{	
	this.status=objekt;
	if(typeof obrazek!='undefined'){
		elem.style.backgroundColor='#C93';
		elem.style.cursor='pointer';
		document.getElementById(objekt).src='images'+obrazek;
	}
	else elem.style.backgroundColor='';
}
-->
