showContact = true;

this.onload = function() {
  headings = getElementsByClass("contentHeading", null, "li");
  for (i = 0; i < headings.length; i++) {
    headings[i].onclick = new Function ("evt", "moveToHeading('h_" + headings[i].id + "');");
  }
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function go() {
  document.location.href = document.getElementById("navigationSelection").value;
}

function resetForm() {
  document.getElementById("contactForm").reset;
}

function submitForm() {
  document.getElementById("contactForm").submit;
}

function getReady() {
  document.getElementById("Jmeno").focus();
}

function mailLink(mail, domain, additionalParams) {
  link = "<a href='mailto:"+mail+"&#64;"+domain+"'"+additionalParams+">"+mail+"&#64;"+domain+"</a>";
  document.write(link);
}

function moveToHeading(id) {
  obj = document.getElementById(id);
  if (obj) {
    var curleft = curtop = 0;
  	if (obj.offsetParent) {
  		curleft = obj.offsetLeft
  		curtop = obj.offsetTop
  		while (obj = obj.offsetParent) {
  			curleft += obj.offsetLeft
  			curtop += obj.offsetTop
  		}
  	}
  	window.scrollTo(curleft, curtop);
  }
}
