// Blurring links:
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror") {version = "n3";} else {version = "n2";}
  function blurLink(theObject)	{
  if (msie4)	{theObject.blur();}
}

// JS function for uncrypting spam-protected emails:
function UnCryptMailto(s) {
	var n=0;
	var r="";
	for(var i=0; i < s.length; i++) {
		n=s.charCodeAt(i);
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(1));
	}
	return r;
}

// JS function for uncrypting spam-protected emails:
function linkTo_UnCryptMailto(s)	{
	location.href=UnCryptMailto(s);
}

//JS function for dropdownsitemap
function tx_dropdownsitemap_pi1_swapClasses(element) {
	if (document.getElementById) {
		var liClass = "tx_dropdownsitemap_pi1_" + element;
		var picture = "pic_" + element;
		document.getElementById(liClass).className = (document.getElementById(liClass).className == "open") ? "closed" : "open";
		document.getElementById(picture).src = (document.getElementById(liClass).className == "open") ? "typo3conf/ext/dropdown_sitemap/pi1/minus.gif" : "typo3conf/ext/dropdown_sitemap/pi1/plus.gif";
	}
}
var expanded = 0;
function tx_dropdownsitemap_pi1_expAll() {
	if (document.getElementsByTagName) {
		var listItems = document.getElementsByTagName("li");
		for (i = 0; i < listItems.length; i++) {
			if (listItems[i].id.indexOf("tx_dropdownsitemap_pi1") != -1) {
				listItems[i].className = (expanded) ? "closed" : "open";
				var picture = "pic_" + listItems[i].id.replace("tx_dropdownsitemap_pi1_","");
				listItems[i].className = (expanded) ? "closed" : "open"
				document.getElementById(picture).src = (expanded) ? "typo3conf/ext/dropdown_sitemap/pi1/plus.gif" : "typo3conf/ext/dropdown_sitemap/pi1/minus.gif";
			}
		}
	expanded = (expanded == 1) ? 0 : 1;
	}
}

//Image Switching

var revert = new Array();
var inames = new Array('anfahrt');

// Preload
if (document.images) {
  var flipped = new Array();
  for(i=0; i<inames.length; i++) {
    flipped[i] = new Image();
    flipped[i].src ="fileadmin/www.dvt.at/bilder/"+inames[i]+"2.gif";
  }
}

function over(num) {
  if(document.images) {
    revert[num] = document.images[inames[num]].src;
    document.images[inames[num]].src = flipped[num].src;
  }
}
function out(num) {
  if(document.images) document.images[inames[num]].src = revert[num];
}

//Reload images: Wasserstand
function reloadCam() {
	reload = new Date();
	reload = "?"+reload.getTime();
	var filename = document.images["lh_webcam1"].src;
	document.images["lh_webcam1"].src = filename+reload;
	setTimeout("reloadCam()", 30000); // zeit-in-ms
}