// JavaScript Document

var FadeTime = 5.0;
var FadeWaitTime = 8000;

function PageLoaded()
{
	window.setTimeout("FadeSecond();", 6000);
	//$('PictureBox_01_Image_B').src = $('PictureBox_01_Image_B').src2;
	//$('PictureBox_02_Image_B').src = $('PictureBox_02_Image_B').src2;
	//$('PictureBox_03_Image_B').src = $('PictureBox_03_Image_B').src2;
	//$('PictureBox_04_Image_B').src = $('PictureBox_04_Image_B').src2;
}

function FadeSecond()
{
	$('PictureBox_01_Image_A').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_01_Image_B').fade({from: 0.01, to: 1.00, duration: FadeTime});
	$('PictureBox_02_Image_A').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_02_Image_B').fade({from: 0.01, to: 1.00, duration: FadeTime});
	$('PictureBox_03_Image_A').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_03_Image_B').fade({from: 0.01, to: 1.00, duration: FadeTime});
	$('PictureBox_04_Image_A').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_04_Image_B').fade({from: 0.01, to: 1.00, duration: FadeTime});
	window.setTimeout("FadeThird();", FadeWaitTime);
	//$('PictureBox_01_Image_C').src = $('PictureBox_01_Image_C').src2;
	//$('PictureBox_02_Image_C').src = $('PictureBox_02_Image_C').src2;
	//$('PictureBox_03_Image_C').src = $('PictureBox_03_Image_C').src2;
	//$('PictureBox_04_Image_C').src = $('PictureBox_04_Image_C').src2;
}

function FadeThird()
{
	$('PictureBox_01_Image_B').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_01_Image_C').fade({from: 0.01, to: 1.00, duration: FadeTime});
	$('PictureBox_02_Image_B').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_02_Image_C').fade({from: 0.01, to: 1.00, duration: FadeTime});
	$('PictureBox_03_Image_B').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_03_Image_C').fade({from: 0.01, to: 1.00, duration: FadeTime});
	$('PictureBox_04_Image_B').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_04_Image_C').fade({from: 0.01, to: 1.00, duration: FadeTime});
	window.setTimeout("FadeBegin();", FadeWaitTime);
}

function FadeBegin()
{
	$('PictureBox_01_Image_C').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_01_Image_A').fade({from: 0.01, to: 1.00, duration: FadeTime});
	$('PictureBox_02_Image_C').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_02_Image_A').fade({from: 0.01, to: 1.00, duration: FadeTime});
	$('PictureBox_03_Image_C').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_03_Image_A').fade({from: 0.01, to: 1.00, duration: FadeTime});
	$('PictureBox_04_Image_C').fade({from: 1.00, to: 0.01, duration: FadeTime});
	$('PictureBox_04_Image_A').fade({from: 0.01, to: 1.00, duration: FadeTime});
	window.setTimeout("FadeSecond();", FadeWaitTime);
}

/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Corneliu Lucian 'Kor' Rusu | corneliulucian[at]gmail[dot]com */
var words={
'Monday':'Montag',
'Tuesday':'Dienstag',
'Wednesday':'Mittwoch',
'Thursday':'Donnerstag',
'Friday':'Freitag',
'Saturday':'Samstag',
'Sunday':'Sonntag',
'January':'Januar',
'February':'Februar',
'March':'März',
'April':'April',
'May':'Mai',
'June':'Juni',
'July':'Juli',
'August':'August',
'September':'September',
'October':'Oktober',
'November':'November',
'December':'Dezember'
}
var regs=[];
for(arg in words){regs[regs.length]=new RegExp(arg,'g')}

var words2={
'vor >':'',
'< zurück':''
}
var regs2=[];
for(arg in words2){regs2[regs2.length]=new RegExp(arg,'g')}

function ReplaceEnglishWords()
{
	var tags = document.getElementsByTagName('body')[0].getElementsByTagName('*');
	var i=0,t;
	while(t=tags[i++]){
		if(t.childNodes[0]){
			var j=0, c;
			while(c=t.childNodes[j++]){
				if(c.nodeType==3){
					var k=0;
					for(arg in words){
						c.nodeValue=c.nodeValue.replace(regs[k],words[arg]);
						k++;
					}
				}
			}
		}
	}
	
	if($$('.tx-ttnews-browsebox') == null)
	{
		return;
	}
	if($$('.tx-ttnews-browsebox').length == 0)
	{
		return;
	}
	tags = $$('.tx-ttnews-browsebox')[0].getElementsByTagName('*');
	i=0
	while(t=tags[i++])
	{
		if(t.childNodes[0])
		{
			var j=0, c;
			while(c=t.childNodes[j++])
			{
				if(c.nodeType==3)
				{
					var k=0;
					for(arg in words2)
					{
						c.nodeValue=c.nodeValue.replace(regs2[k],words2[arg]);
						k++;
					}
				}
			}
		}
	}
	
}

document.observe("dom:loaded", function() {
  ReplaceEnglishWords();
});


function ReplaceNews()
{
	var tag = $$('.news-list-container')[0];
	if(tag == null)
		return;
	tag.id = 'firstNews';
	tag = $$('.news-list-container .news-list-item')[0];
	if(tag == null)
		return;
	tag.innerHTML = tag.innerHTML + '<div class="clearer hr"></div>';
}


document.observe("dom:loaded", function() {
  ReplaceNews();
});
