<!--

// automaticke SELECT menu v editaci
function navigator(upraveni_obsahu) { location.href=(document.upraveni_obsahu.vyber.options[document.upraveni_obsahu.vyber.selectedIndex].value);}
function navigator_2(upraveni_obsahu) { location.href=(document.upraveni_obsahu.vyber_2.options[document.upraveni_obsahu.vyber_2.selectedIndex].value);}
function navigator2(ulozitzmeny) { location.href=(document.ulozitzmeny.vyber_zobraceni_listu.options[document.ulozitzmeny.vyber_zobraceni_listu.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;
	}
}

// kontrola formulářových údajů
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";
	}
    } 
} 


// Uprava ceny dle zvolene povrchove upravy
function updateceny(polozka)
{
	stranka = polozka.name;
	povrchova_uprava = polozka.value;
	document.location.href = 'index.php?action=update&stranka='+stranka+'&povrchova_uprava='+povrchova_uprava;
}

function dyngallery()
{
	var picId='bigDynPic';
	var loadingId='loadingmessage';
	var d=document.getElementById('thumbs');
	if(!d){return;}
	if(!document.getElementById(loadingId))
	{
		var lo=document.createElement('div');
		d.parentNode.insertBefore(lo,d);
		lo.id=loadingId;
		lo.style.display='none';
	}
	var piclinks=d.getElementsByTagName('a');
	for(var i=0;i<piclinks.length;i++)
	{
		piclinks[i].onclick=function()
		{
			document.getElementById(loadingId).style.display='block';
			var oldp=document.getElementById(picId);
			if(oldp)
			{
			 oldp.parentNode.removeChild(oldp);
			}
			var nc=document.createElement('div');
			d.parentNode.insertBefore(nc,d);
			nc.style.display='none';
			nc.id=picId;
			var newpic=document.createElement('img');
			newpic.src=this.href;
			newpic.alt=this.getElementsByTagName('img')[0].alt;
			newpic.title='kliknutím na obrázek se toto okno zavře';
			newpic.onload=function()
			{
				document.getElementById(loadingId).style.display='none';
			}
			newpic.onclick=function()
			{
			 this.parentNode.parentNode.removeChild(this.parentNode);
			}
			nc.appendChild(newpic);
			np=document.createElement('p');
			np.appendChild(document.createTextNode(this.getElementsByTagName('img')[0].alt))
			nc.appendChild(np);
			nc.style.display='block';
			return false;
		}
	}		
}

window.onload=function()
{
	if(document.getElementById && document.createTextNode)
	{
		document.body.onmouseover=function()
		{
			dyngallery();	
		}																
		
	}
}


// -->