//=====================================================================
//  DOM Image Rollover v3 (hover)
//
//  Demo: http://chrispoole.com/scripts/dom_image_rollover_hover
//  Script featured on: Dynamic Drive (http://www.dynamicdrive.com)
//=====================================================================
//  copyright Chris Poole
//  http://chrispoole.com
//  This software is licensed under the MIT License 
//  <http://opensource.org/licenses/mit-license.php>
//=====================================================================

function $(element){
  return document.getElementById(element);
}



function hl(ids){
   for(i=1; i<=9; i++){
      if($('a'+i)){
       $('a'+i).setAttribute('src', $('a'+i).getAttribute('xsrc'));
			 $('a'+i).setAttribute('touch', '1');
			 $('a'+i).parentNode.parentNode.setAttribute('touch', '1');
			 $('a'+i).parentNode.parentNode.style.background="";
   }
   }
   ids = ids.split(',');
   for (i=0; i<ids.length; i++){
     if($(ids[i])){
      $(ids[i]).setAttribute('src', $(ids[i]).className.match(/domroll (\S+)/)[1]);
      $(ids[i]).setAttribute('touch', '0');
      $(ids[i]).parentNode.parentNode.setAttribute('touch', '0');
      $(ids[i]).parentNode.parentNode.style.background="URL(_img/pfeil.gif) no-repeat 39px 5px";
   }}
}

function change_links_out(){
   $('archivlink').src = link = $('archivlink').getAttribute('xsrc');
	 $('l1').style.textDecoration="none";
   $('l2').style.textDecoration="none";
   $('l3').style.textDecoration="none";
   $('l1').style.color="#4f739d";
   $('l2').style.color="#4f739d";
   $('l3').style.color="#4f739d";
}

function set_navi_height(){
     if($('main').clientHeight<=490)
		   y=500;
		 else
		   y=$('main').clientHeight;
		 $('navi').style.height =  y+'px';
}

function domRollover() {
	if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion <7) return;
	var imgarr=document.getElementsByTagName('img');
	var imgPreload=new Array();
	var imgSrc=new Array();
	var imgClass=new Array();
	for (i=0;i<imgarr.length;i++){
		if (imgarr[i].className.indexOf('domroll')!=-1){
			imgSrc[i]=imgarr[i].getAttribute('src');
			imgClass[i]=imgarr[i].className;
			imgPreload[i]=new Image();
			if (imgClass[i].match(/domroll (\S+)/)) {
				imgPreload[i].src = imgClass[i].match(/domroll (\S+)/)[1]
			}
			imgarr[i].setAttribute('xsrc', imgSrc[i]);
			imgarr[i].onmouseover=function(){
				 this.setAttribute('src',this.className.match(/domroll (\S+)/)[1])
			}
			imgarr[i].onmouseout=function(){
				if(this.getAttribute('touch')!=0) this.setAttribute('src',this.getAttribute('xsrc'))
			}
		}
	}
}


