// bildwechsel für die Startseite und generell den Contentbereich
function changeImages() {
 if(!document.getElementById('content_right')) { return; }
 container = document.getElementById('content_right');
 elements = container.getElementsByTagName('img');
 for(i=0;i<elements.length;i++) {
  elements[i].onmouseover = function() {
	 if(this.id == "") { return; }
	 oldsrc = this.src;
	 newsrc = this.id.replace("-","/");
	 this.src = newsrc;
	 this.id = oldsrc;
	}
 elements[i].onmouseout = function() {
	 if(this.id == "") { return; } 
	 oldsrc = this.src.replace("/","-");
	 newsrc = this.id;
	 this.src = newsrc;
	 this.id = oldsrc;
	}	
 }
}

// Highlight für die Navigation links
function hlNavBlock() {
 if(!document.getElementById('navblock')) { return; }
 container = document.getElementById('navblock');
 elements2 = container.getElementsByTagName('li');
  for(i=0;i<elements2.length;i++) {
  elements2[i].onmouseover = function() {
	 if(this.id == "active") { return; }
	 this.className = "hover";
	}
  elements2[i].onclick = function() {
	 if(this.id == "active") { return; }
	 this.className = "hover";
	 location.href=this.firstChild;
	}	
 elements2[i].onmouseout = function() {
 	if(this.id == "active") { return; }
  this.className = "unhover";
	}	
 }
}

function table_alt(tbl) {
  if(!document.getElementById(tbl)) { return; }
   rows = document.getElementById(tbl).getElementsByTagName('tr');
   for(i=0;i<rows.length;i=(i+2)) {
    tds =  rows[i].getElementsByTagName('td');
     for(z=0;z<tds.length;z++) {
	  tds[z].className = tds[z].className + "odd"; 
     }
   }
 }

function adjustAdressblockPosition() {
 container = document.getElementById('wrapper'); 
 block = document.getElementById('navblock');
 contained = document.getElementById('adressblock');
 container_oHeight = container.offsetHeight;
 container.style.height = (container_oHeight + 20) + "px";  
// contained.style.position = "absolute";
 contained.style.marginTop = (container_oHeight - block.offsetHeight - contained.style.height - 140 ) + "px";  
// contained.style.position = "absolute";
 contained.style.visibility = "visible";
} 
 
function init() {
 changeImages();
 hlNavBlock();
 adjustAdressblockPosition(); 
 table_alt('terminetable','#cc0000');
 container = document.getElementById('wrapper');
}
window.onload = init;