// ********** Globale Ticker-Variablen definieren **********

    var language=0;
    var nextTickerNews=0;
 		var lineCounter=0;
		var maxLine=0;
		var newLine=0;
		var fadeOut=1;
		var fadeCounter=0;
		var line = new Array();
    var newsLink = new Array();
		line[0] = new String(" ");
    var pos=0;
    
    
    
// ********** startFunctions im onload-attribut, wenn Höhe korrigiert werden soll **********
    
    function startFunctions() {
      rightHeight();
      startTicker();
    }
    
// ********** korrigiert die Höhe des Content-Bereichs relativ zur Bildschirmauflösung, falls zu klein **********
    
    function rightHeight() {
          if (document.getElementById('content').offsetHeight<(screen.height-517)) {
            document.getElementById('content').style.height=screen.height-517;
            document.getElementById('content_frame').style.height=screen.height-517;
            document.getElementById('main').style.height=screen.height-517;
          }
    }
    
// ********** startTicker im onload-attribute, wenn Höhe nicht korrigiert werden soll (Galerie Ansicht) **********    
    
    function startTicker() {
      document.getElementById("ticker_content").innerHTML = '<a href="index.php?c=Berriak&amp;t='+window.newsLink[window.lineCounter]+'&amp;l='+window.language+'&amp;n='+window.nextTickerNews+'" class="ticker_link">'+window.line[window.lineCounter]+'</a>';      
      window.pos=window.line[window.lineCounter].length;
  		window.setTimeout('typing()',10000);
    }

// ********** ticker-funktion **********
    
    function typing() {
     	if (window.newLine==1) {
  	  	document.getElementById("ticker_content").style.color="#4B4B6B"; 
     		document.getElementById("ticker_content").innerHTML=" ";
    		window.newLine=0;
    	}
      maxPos = window.line[window.lineCounter].length;
     	if (window.pos<maxPos) document.getElementById("ticker_content").innerHTML = window.line[window.lineCounter].substr(0,++window.pos-1) + '<span class="ticker_bold">'+window.line[window.lineCounter].substr(window.pos-1,1)+'</span>';
    	if (window.pos==maxPos) {
    		if (window.fadeOut==1) { 
  	  		if (window.fadeCounter==0) {
            document.getElementById("ticker_content").innerHTML = window.line[window.lineCounter];      
            document.getElementById("ticker_content").style.color="#E99A9A";
          }
  	  		if (window.fadeCounter==1) document.getElementById("ticker_content").style.color="#E38484"; 
  	  		if (window.fadeCounter==2) document.getElementById("ticker_content").style.color="#DD6E6E"; 
  	  		if (window.fadeCounter==3) document.getElementById("ticker_content").style.color="#D75858"; 
  	  		if (window.fadeCounter==4) document.getElementById("ticker_content").style.color="#D14242"; 
  	  		if (window.fadeCounter==5) document.getElementById("ticker_content").style.color="#CB2C2C"; 
  	  		if (window.fadeCounter==6) document.getElementById("ticker_content").style.color="#C51616"; 
  	  		if (window.fadeCounter==7) document.getElementById("ticker_content").style.color="#B00000";
	    		window.fadeCounter++;

  		  	if (window.fadeCounter>7) {
            document.getElementById("ticker_content").innerHTML = " ";
  		  		window.fadeOut=0;
  		  		window.fadeCounter=0;
  		  		window.newLine=1;
     				window.lineCounter++;
            window.pos=0;
    				if (lineCounter>maxLine) window.lineCounter=0;
  	  			window.setTimeout('typing()',1000);
  	  		} else window.setTimeout('typing()',80);
  	  	} else {
          document.getElementById("ticker_content").innerHTML = '<a href="index.php?c=news&amp;t='+window.newsLink[window.lineCounter]+'&amp;l='+window.language+'&amp;n='+window.nextTickerNews+'" class="ticker_link">'+window.line[window.lineCounter]+'</a>';
  	  		window.fadeOut=1;
  	  		window.setTimeout('typing()',10000);
  	  	}
    	} else window.setTimeout('typing()',20);
    }

