<!--

// automaticke SELECT menu v editaci

function navigator(upraveni_obsahu) { 
	location.href=(document.upraveni_obsahu.vyber.options[document.upraveni_obsahu.vyber.selectedIndex].value);
}

// X Standard
function myOnSubmitEventHandler() {
	try {
		if(typeof(document.getElementById('editor1').EscapeUnicode) == 'undefined') {
			throw "Error"
		} else {
			document.getElementById('editor1').EscapeUnicode = true;
			document.getElementById('xhtml1').value = document.getElementById('editor1').value;
		}			
	}
	catch(er) {
		document.getElementById('xhtml1').value = document.getElementById('alternate1').value;
	}
}

function kontrola() 
{ 
	if (window.RegExp) 
	{ 
		znaky=new RegExp("^[a-z,á,ä,č,ď,é,ě,í,ř,š,ť,ů,ü,ý,ž,A-Z,Č,Ď,Š,Ř,Ť,Ž,0-9,-. +]{2,200}$"); 
		if (!znaky.test(formular.jmeno.value)) 
		{ 
		    formular.jmeno.focus(); 
		    InformacniPoleJmeno.style.display = "";
		    return false; 
		} else {
		InformacniPoleJmeno.style.display = "none";
		}
		
		znaky=new RegExp("^[a-z,á,ä,č,ď,é,ě,í,ř,š,ť,ů,ü,ý,ž,A-Z,Č,Ď,Š,Ř,Ť,Ž,0-9,-. ]{4,200}$"); 
		if (!znaky.test(formular.kontaktniosoba.value)) 
		{ 
		    formular.kontaktniosoba.focus(); 
		    InformacniPolekontaktniosoba.style.display = "";
		    return false; 
		} else {
		InformacniPolekontaktniosoba.style.display = "none";
		}
	
		znaky=new RegExp("^[+ 1234567890]{9,32}$"); 
		if (!znaky.test(formular.telefon.value)) 
		{ 
		    formular.telefon.focus(); 
		    InformacniPoleTelefon.style.display = "";
		    return false; 
		} else {
		InformacniPoleTelefon.style.display = "none";
		}
		
		
		 znaky=new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$"); 
		if (!znaky.test(formular.email.value)) 
		{ 
		    formular.email.focus(); 
		    InformacniPoleEmail.style.display = "";
		    return false; 
		} else {
		InformacniPoleEmail.style.display = "none";
		}
	}
}

// Identifikatory textarea, kam je text psan 
// a inputu, kde se vypisuji napsane znaky.

function pocetPismen()
{
	var pocet = document.getElementById("popisek").value.length;
	var maximum = 220;	
	
	if(pocet > maximum)
	{
		document.getElementById("popisek").value = document.getElementById("popisek").value.substring(0, maximum);
		
	}
	else
	{
		document.getElementById("napsano").value = pocet;
		document.getElementById("zbyva").value = maximum - pocet;
	}
}

// zvyrazneni radku tabulky
var hover_color = null;
function highlight_row(obj,w){
	if (hover_color == null) hover_color = getStyle('hover', "backgroundColor");
	var tds = obj.getElementsByTagName('td');
	for(i=0;i < tds.length;i++) {
		if (w == 1) {
			tds[i].style.backgroundColor = hover_color;
		} else tds[i].style.backgroundColor = "";
	}
}

// zjistime hodnotu z CSS, pouze pro IE!
function getStyle(el, style) {
	el = document.getElementById(el);
	var value = el.style[style];
	if(!value) value = el.currentStyle[style];
	return value;
}

// inicializacni fce
function hover_init() {
	if (document.all && document.getElementById && !window.opera) {	
		table = document.getElementById('htabulka');
		trs = table.getElementsByTagName('tr');
		for(var i = 0; i < trs.length; i++){
			trs[i].onmouseover = function(){ highlight_row(this,1); }
			trs[i].onmouseout = function(){ highlight_row(this,0); }
		}
	}
}
