function externalLinks() {
 	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
			if (anchor.getAttribute("href") &&
				anchor.getAttribute("rel") == "external")
				anchor.target = "_blank";
	}
}
window.onload = externalLinks;

//SuckerTree Horizontal Menu (Sept 14th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/

var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus_horizontal(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
			ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
		}
		else{ //else if this is a sub level menu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    	ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
		}
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.visibility="visible"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)



//rolovatko
iens6=document.all||document.getElementById
		ns4=document.layers
		
//rychlost scrolovani
var speed=5


// check data
function isblank(co){
	for (var i=0; i < co.length; i++)
	{
		var c=co.charAt(i);
   		if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
	}
	return true;
}

function isemail(co){
	ok = false;
	for (var i=0; i < co.length; i++)
	{
		var c=co.charAt(i);
   		if ((c == '@')) ok = true;
	}
	return ok;
}




function chForm(){
	if ((document.forms.ezpravodaj.us_jmeno.value == "") || (isblank(document.forms.ezpravodaj.us_jmeno.value))) {
		alert("Není vyplněné Vaše jméno.");
		document.forms.ezpravodaj.us_jmeno.focus();
		return false;
	};
	if ((document.forms.ezpravodaj.us_email.value == "") || (isblank(document.forms.ezpravodaj.us_email.value))) {
		alert("Není vyplněný Váš email.");
		document.forms.ezpravodaj.us_email.focus();
		return false;
	};
	if(!isemail(document.forms.ezpravodaj.us_email.value)) {
		alert("Zadaná emailová adresa má nesprávný formát.");
		document.forms.ezpravodaj.us_email.focus();
		return false;
	};
}


function ukaz(id){
var lajer =  document.getElementById(id)
if (lajer.style.display == 'block')
	lajer.style.display = 'none';
else
	lajer.style.display = 'block';
}
