function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
function tx_a1teasermenu_pi1_findObj(n, d) { //v4.0
				var p,i,x;
				if(!d) d=document;
				if((p=n.indexOf("?"))>0&&parent.frames.length) {
			    	d=parent.frames[n.substring(p+1)].document;
					n=n.substring(0,p);
				}
			  	if(!(x=d[n])&&d.all) x=d.all[n];
				for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
				for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=tx_a1teasermenu_pi1_findObj(n,d.layers[i].document);
				if(!x && document.getElementById) x=document.getElementById(n);
				return x;
			}

function BilderVorladen(){
    document.Vorladen = new Array();
    if(document.images)
    {
        for(var i = 0; i < BilderVorladen.arguments.length; i++)
        {
            document.Vorladen[i] = new Image();
            document.Vorladen[i].src = BilderVorladen.arguments[i];
        }
    }
}

function imgSwitch(){
	var switchImg = document.getElementsByTagName("img");
	
	for(i=0;i<switchImg.length;i++){
		//console.log(switchImg[i].src);
		if (switchImg[i].src=="http://p27866.typo3server.info/fileadmin/PDF/pdf1.gif"  || switchImg[i].src=="http://p27866.typo3server.info/uploads/pics/pdf1.gif"){
			switchImg[i].onmouseover = function(){
				this.src="http://p27866.typo3server.info/fileadmin/PDF/pdf2.gif"
			}
			switchImg[i].onmouseout = function(){
				this.src="http://p27866.typo3server.info/fileadmin/PDF/pdf1.gif"
			}
		}
	}
	
}
/*function imgSwitch(){
	var switchImg = document.getElementsByTagName("img");
	
	for(i=0;i<switchImg.length;i++){
		if (switchImg[i].src=="http://p27866.typo3server.info/uploads/pics/sf_03.gif"  || switchImg[i].src=="http://p27866.typo3server.info/uploads/pics/sf_06.gif"){
			switchImg[i].onmouseover = function(){
				this.src="http://p27866.typo3server.info/fileadmin/pictures/sf_03-bl.gif"
			}
			switchImg[i].onmouseout = function(){
				this.src="http://p27866.typo3server.info/fileadmin/pictures/sf_03.gif"
			}
		}
	}
	
}*/

function NaviFunctions() {
	if (getAElementByHref('index.html')) {
			index = getAElementByHref('index.html');
			if(index.className!="link0_active"){
				index.className="link0";
			}
  	}
  	if (getAElementByHref('110.html')) {
			o110 = getAElementByHref('110.html');
			if(o110.className!="link1_active"){
				o110.className="link1";
			}
	 }
	 if (getAElementByHref('109.html')) {
		 	o109 = getAElementByHref('109.html');
			if(o109.className!="link2_active"){
				o109.className="link2";
			}
	 }
  	 if (getAElementByHref('108.html')) {
		 	o108 = getAElementByHref('108.html');
			if(o108.className!="link3_active"){
				o108.className="link3";
			}
  	 }
}

function pngRepair() {
  if (getBrowserName() == 'IE' && getBrowserVer() < 7) {
    for (i=0; i < document.getElementsByTagName("img").length; i++) {
      if (document.getElementsByTagName("img")[i].src.indexOf(".png")!=-1) {
        width = document.getElementsByTagName("img")[i].width;
        height = document.getElementsByTagName("img")[i].height;
        src = document.getElementsByTagName("img")[i].src;
        document.getElementsByTagName("img")[i].src=BLANK_GIF;
        document.getElementsByTagName("img")[i].height = height;
        document.getElementsByTagName("img")[i].width = width;
        document.getElementsByTagName("img")[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale');";
      }
    }
  }
}

function getBrowserName() {
    if (navigator.userAgent.indexOf("MSIE")!=-1) return 'IE';
    else if (navigator.userAgent.indexOf("Opera")!=-1) return 'Opera';
    else return 'unknown';
}

function getBrowserVer() {
    var sReturn = 'unknown';
    var sBrowser = getBrowserName();
    if (sBrowser == 'IE') {
        arrRes = navigator.userAgent.match(/MSIE (\d+)/);
        if (arrRes[1]) sReturn = arrRes[1];
    }
    if (sBrowser == 'Opera') {
        arrRes = navigator.userAgent.match(/Opera\/([0-9.]+)/);
        if (arrRes[1]) sReturn = arrRes[1];
    }
    return sReturn;
}

function getAElementByHref(strHref) {
  var oLinks = document.getElementsByTagName("a");
  for (var j=0; j < oLinks.length; j++) {
    if (str_search(strHref, oLinks[j].getAttribute('href')) != -1) {
      return oLinks[j];
      break;
    }
  }
}

function str_search(strNeedle, strHaystack) {
  for (var i=0; i<strHaystack.length; i++) {
    if (strNeedle.length > strHaystack.substr(i, strNeedle.length)) break;
    if (strHaystack.substr(i, strNeedle.length) == strNeedle) {
      return i;
    }
  }
  return -1;
}


