var color1=0;//ColorRotation
var color2=0;
var color3=0;
var BC1;//ByteColor
var BC2;
var BC3;
var Directory="UP";
var ReStart="Y";
var ReStartColor;
var AktColor;
var StartStop=0;
var x=400;//FensterGrösse
var y=300;
var NewsFlashFrame=true;//IFrame
var SitemapFrame=true;
function InhaltEinblenden(Einblenden){
	document.getElementById(Einblenden).style.display="";
	document.getElementById('Inhaltsverzeichnis').style.backgroundColor="lightgrey";
	document.getElementById('Inhaltsverzeichnis').style.width="550px";
	document.getElementById('InhaltText').style.display="none";
}
function InhaltAusblenden(Ausblenden){
	document.getElementById(Ausblenden).style.display="none";
	document.getElementById('Inhaltsverzeichnis').style.backgroundColor="";
	document.getElementById('Inhaltsverzeichnis').style.width="15px";
	document.getElementById('InhaltText').style.display="";
}
function NewsEinblenden(Einblenden){
	document.getElementById(Einblenden).style.display="";
	document.getElementById('NewsTicker').style.backgroundColor="lightgrey";
	document.getElementById('NewsTicker').style.width="550px";
	document.getElementById('NewsText').style.display="none";
}
function NewsAusblenden(Ausblenden){
	document.getElementById(Ausblenden).style.display="none";
	document.getElementById('NewsTicker').style.backgroundColor="";
	document.getElementById('NewsTicker').style.width="15px";
	document.getElementById('NewsText').style.display="";
}
function NewsInFrame(){//Prüfen ob im IFrame
	if(top.location==self.location){//Haupfenster
		NewsFlashFrame=false;
		document.getElementById('IFrameNewsScrollbereich').id="PagesScrollbereich";
		LoadInhalt();
		document.getElementById('Header').style.display="";
		var newsbr = document.URL.split("/");
		if(newsbr[newsbr.length-1].slice(0,5)!="news_"&&newsbr[newsbr.length-1].slice(0,5)!="tinc?"){
			for(var a=9;a<=74;a++){
				document.getElementsByTagName('br')[a].style.display="none";
			}
		}
	}else{//IFrame
		NewsFlashFrame=true;
		document.getElementById('Header').style.display="none";
		document.getElementById('Inhaltsverzeichnis').style.display="none";
		document.getElementById('NewsTicker').style.display="none";
	}
}
function SitemapInFrame(){//Prüfen ob im IFrame
	if(top.location==self.location){//Haupfenster
		SitemapFrame=false;
		document.getElementById('IFrameScrollbereich').id="PagesScrollbereich";
		LoadInhalt();
		document.getElementById('Inhaltsverzeichnis').style.display="none";
	}else{//IFrame
		SitemapFrame=true;
		document.getElementById('Header').style.display="none";
		document.getElementById('Inhaltsverzeichnis').style.display="none";
		document.getElementById('NewsTicker').style.display="none";
	}
}
function GroesseGeaendert(){
	Fensterweite();
	Fensterhoehe();
	x=x-45;
	y=y-130;
	document.getElementById('PagesScrollbereich').style.width=x;
	document.getElementById('PagesScrollbereich').style.Height=y;
	if(document.URL.substring(0,33)=="http://www.steffen-hanske.de/rss_"){
		document.getElementById('feedControl').style.width=x-20;
		}
}
function LoadInhalt(){
	if(NewsFlashFrame!=true||SitemapFrame!=true||(SitemapFrame==true&&NewsFlashFrame==true)){
		Footer_DOM.create('Footer');
	}
	if(SitemapFrame==true){
		document.getElementById('Inhaltsverzeichnis').onmouseover=new Function("InhaltEinblenden('InhaltFrame')");
		document.getElementById('Inhaltsverzeichnis').onmouseout=new Function("InhaltAusblenden('InhaltFrame')");
		var TextInhaltText=document.getElementById('Inhaltsverzeichnis').appendChild(document.createElement('div'));
		TextInhaltText.setAttribute('id','InhaltText');
		var IframeInhalt=document.getElementById('Inhaltsverzeichnis').appendChild(document.createElement('iframe'));
		IframeInhalt.setAttribute('class','InhaltFrame');
		IframeInhalt.setAttribute('id','InhaltFrame');
		IframeInhalt.setAttribute('src','sitemap.htm');
		IframeInhalt.setAttribute('name','Sitemap');
		InhaltAusblenden('InhaltFrame');
		document.getElementById('InhaltText').innerHTML='>\n>\n><br><br>*<br><br>I\nN\nH\nA\nL\nT\nS\nV\nE\nR\nZ\nE\nI\nC\nH\nN\nI\nS<br><br>*<br><br>>\n>\n>';
		document.getElementById('InhaltFrame').onmouseover=new Function("InhaltEinblenden('InhaltFrame')");
		document.getElementById('InhaltFrame').onmouseout=new Function("InhaltAusblenden('InhaltFrame')");
		document.getElementById('InhaltText').style.display="";
		document.getElementById('Inhaltsverzeichnis').style.width="15px";
	}
	if(NewsFlashFrame==true){
		document.getElementById('NewsTicker').onmouseover=new Function("NewsEinblenden('NewsFrame')");
		document.getElementById('NewsTicker').onmouseout=new Function("NewsAusblenden('NewsFrame')");
		var TextNewsText=document.getElementById('NewsTicker').appendChild(document.createElement('div'));
		TextNewsText.setAttribute('id','NewsText');
		var IframeNews=document.getElementById('NewsTicker').appendChild(document.createElement('iframe'));
		IframeNews.setAttribute('class','NewsFrame');
		IframeNews.setAttribute('id','NewsFrame');
		IframeNews.setAttribute('src','news.htm');
		IframeNews.setAttribute('name','NewsTicker');
		NewsAusblenden('NewsFrame');
		document.getElementById('NewsText').innerHTML='<\n<\n<<br><br>*<br><br>N\nE\nW\nS<br><br>F\nL\nA\nS\nH<br><br>*<br><br><\n<\n<\n<';
		document.getElementById('NewsFrame').onmouseover=new Function("NewsEinblenden('NewsFrame')");
		document.getElementById('NewsFrame').onmouseout=new Function("NewsAusblenden('NewsFrame')");
		document.getElementById('NewsText').style.display="";
		document.getElementById("NewsTicker").style.width="15px";
	}
	Fensterweite();
	Fensterhoehe();
	x=x-45;
	y=y-130;
	document.getElementById('PagesScrollbereich').style.width=x;
	document.getElementById('PagesScrollbereich').style.Height=y;
	if(document.URL.substring(0,33)=="http://www.steffen-hanske.de/rss_"){
		document.getElementById('feedControl').style.width=x-20;
		}
	SitemapColor();
}
var Footer_DOM={
	create:function(node){
		var My_Footer=document.getElementById(node);
		var GoTo_Home=My_Footer.appendChild(document.createElement('a'));
		GoTo_Home.setAttribute('title','Home');
		GoTo_Home.setAttribute('href','index.htm');
		GoTo_Home.setAttribute('onmouseover',function StatusHomeOn(){window.status='Hier geht es zur Homepage www.steffen-hanske.de'; return true;});
		GoTo_Home.setAttribute('onmouseout',function StatusHomeOff(){window.status=''; return true;});
		var GoTo_Home_Img=GoTo_Home.appendChild(document.createElement('img'));
		GoTo_Home_Img.setAttribute('src','img/home.gif');
		GoTo_Home_Img.setAttribute('alt','HOME');
		GoTo_Home_Img.setAttribute('border','0');
		GoTo_Home_Img.setAttribute('align','right');
GoTo_Home_Img.style.width=24;
		var GoTo_Top=My_Footer.appendChild(document.createElement('a'));
		GoTo_Top.setAttribute('title','Top');
		GoTo_Top.setAttribute('href',document.URL);
		GoTo_Top.setAttribute('onmouseover',function StatusTopOn(){window.status='Top of the Page'; return true;});
		GoTo_Top.setAttribute('onmouseout',function StatusTopOff(){window.status=''; return true;});
		var GoTo_Top_Img=GoTo_Top.appendChild(document.createElement('img'));
		GoTo_Top_Img.setAttribute('src','img/up.gif');
		GoTo_Top_Img.setAttribute('alt','TOP');
		GoTo_Top_Img.setAttribute('border','0');
		GoTo_Top_Img.setAttribute('align','right');
GoTo_Top_Img.style.width=24;
		var GoTo_Inhalt=My_Footer.appendChild(document.createElement('a'));
		GoTo_Inhalt.setAttribute('title','Inhalt');
		GoTo_Inhalt.setAttribute('href','sitemap.htm');
		GoTo_Inhalt.setAttribute('onmouseover',function StatusInhaltOn(){window.status='Hier geht es zum Inhaltsverzeichnis'; return true;});
		GoTo_Inhalt.setAttribute('onmouseout',function StatusInhaltOff(){window.status=''; return true;});
		var GoTo_Inhalt_Img=GoTo_Inhalt.appendChild(document.createElement('img'));
		GoTo_Inhalt_Img.setAttribute('src','img/sitemap.gif');
		GoTo_Inhalt_Img.setAttribute('alt','Inhalt');
		GoTo_Inhalt_Img.setAttribute('border','0');
		GoTo_Inhalt_Img.setAttribute('align','right');
GoTo_Inhalt_Img.style.width=24;
		var GoTo_News=My_Footer.appendChild(document.createElement('a'));
		GoTo_News.setAttribute('title','News');
		GoTo_News.setAttribute('href','news.htm');
		GoTo_News.setAttribute('onmouseover',function StatusNewsOn(){window.status='Aktuelle Nachrichten'; return true;});
		GoTo_News.setAttribute('onmouseout',function StatusNewsOff(){window.status=''; return true;});
		var GoTo_News_Img=GoTo_News.appendChild(document.createElement('img'));
		GoTo_News_Img.setAttribute('src','img/zeitung.gif');
		GoTo_News_Img.setAttribute('alt','News');
		GoTo_News_Img.setAttribute('border','0');
		GoTo_News_Img.setAttribute('align','right');
GoTo_News_Img.style.width=24;
		var GoTo_Favoriten=My_Footer.appendChild(document.createElement('a'));
		GoTo_Favoriten.setAttribute('title','Favoriten');
		GoTo_Favoriten.setAttribute('href','internet-favoriten.htm');
		GoTo_Favoriten.setAttribute('onmouseover',function StatusFavoritenOn(){window.status='Hier geht es zu meinen Favoriten im Internet'; return true;});
		GoTo_Favoriten.setAttribute('onmouseout',function StatusFavoritenOff(){window.status=''; return true;});
		var GoTo_Favoriten_Img=GoTo_Favoriten.appendChild(document.createElement('img'));
		GoTo_Favoriten_Img.setAttribute('src','img/favoriten.gif');
		GoTo_Favoriten_Img.setAttribute('alt','Favoriten');
		GoTo_Favoriten_Img.setAttribute('border','0');
		GoTo_Favoriten_Img.setAttribute('align','right');
GoTo_Favoriten_Img.style.width=24;		
		var GoTo_Impressum=My_Footer.appendChild(document.createElement('a'));
		GoTo_Impressum.setAttribute('title','Impressum und Haftungsausschluss');
		GoTo_Impressum.setAttribute('href','impressum.htm');
		GoTo_Impressum.setAttribute('onmouseover',function StatusFavoritenOn(){window.status='Impressum und Haftungsausschluss'; return true;});
		GoTo_Impressum.setAttribute('onmouseout',function StatusFavoritenOff(){window.status=''; return true;});
		var GoTo_Impressum_Img=GoTo_Impressum.appendChild(document.createElement('img'));
		GoTo_Impressum_Img.setAttribute('src','img/info.gif');
		GoTo_Impressum_Img.setAttribute('alt','Impressum');
		GoTo_Impressum_Img.setAttribute('border','0');
		GoTo_Impressum_Img.setAttribute('align','right');
GoTo_Impressum_Img.style.width=24;
		var GoTo_ValidateHTM=My_Footer.appendChild(document.createElement('a'));
		GoTo_ValidateHTM.setAttribute('title','Valid HTML 4.01 Transitional');
		GoTo_ValidateHTM.setAttribute('target','_blanc');
		GoTo_ValidateHTM.setAttribute('href','http://validator.w3.org/check?uri=referer');
		GoTo_ValidateHTM.setAttribute('onmouseover',function StatusValidateHTMOn(){window.status='HTML Validator W3C'; return true;});
		GoTo_ValidateHTM.setAttribute('onmouseout',function StatusValidateHTMOff(){window.status=''; return true;});
		var GoTo_ValidateHTM_Img=GoTo_ValidateHTM.appendChild(document.createElement('img'));
		GoTo_ValidateHTM_Img.setAttribute('src','http://www.w3.org/Icons/valid-html401-blue');
		GoTo_ValidateHTM_Img.setAttribute('alt','Valid HTML 4.01 Transitional');
		GoTo_ValidateHTM_Img.setAttribute('border','0');
		GoTo_ValidateHTM_Img.setAttribute('align','right');
		var GoTo_ValidateCSS=My_Footer.appendChild(document.createElement('a'));
		GoTo_ValidateCSS.setAttribute('title','Valid CSS!');
		GoTo_ValidateCSS.setAttribute('target','_blanc');
		GoTo_ValidateCSS.setAttribute('href','http://validator.w3.org/check?uri=http%3A%2F%2Fwww.steffen-hanske.de%2Fcss%2Findex.css');
		GoTo_ValidateCSS.setAttribute('onmouseover',function StatusValidateCSSOn(){window.status='CSS Validator W3C'; return true;});
		GoTo_ValidateCSS.setAttribute('onmouseout',function StatusValidateCSSOff(){window.status=''; return true;});
		var GoTo_ValidateCSS_Img=GoTo_ValidateCSS.appendChild(document.createElement('img'));
		GoTo_ValidateCSS_Img.setAttribute('src','http://jigsaw.w3.org/css-validator/images/vcss-blue');
		GoTo_ValidateCSS_Img.setAttribute('alt','CSS ist valide!');
		GoTo_ValidateCSS_Img.setAttribute('border','0');
		GoTo_ValidateCSS_Img.setAttribute('align','right');
		//var GoTo_Zohub=My_Footer.appendChild(document.createElement('a'));
		//GoTo_Zohub.setAttribute('title','zohub - your website');
		//GoTo_Zohub.setAttribute('target','_blanc');
		//GoTo_Zohub.setAttribute('href','http://www.zohub.com');
		//GoTo_Zohub.setAttribute('onmouseover',function StatusZohubOn(){window.status='zohub - your website'; return true;});
		//GoTo_Zohub.setAttribute('onmouseout',function StatusZohubOff(){window.status=''; return true;});
		//var GoTo_Zohub_Img=GoTo_Zohub.appendChild(document.createElement('img'));
		//GoTo_Zohub_Img.setAttribute('src','http://www.zohub.com/banner/zohub_88x31.gif');
		//GoTo_Zohub_Img.setAttribute('alt','zohub - your website');
		//GoTo_Zohub_Img.setAttribute('border','0');
		//GoTo_Zohub_Img.setAttribute('align','right');
		var GoTo_mrrank=My_Footer.appendChild(document.createElement('a'));
		GoTo_mrrank.setAttribute('title','Pagerank');
		GoTo_mrrank.setAttribute('target','_blanc');
		GoTo_mrrank.setAttribute('href','http://www.mr-rank.de');
		GoTo_mrrank.setAttribute('onmouseover',function StatusmrrankOn(){window.status='mr-rank'; return true;});
		GoTo_mrrank.setAttribute('onmouseout',function StatusmrrankOff(){window.status=''; return true;});
		var GoTo_mrrank_Img=GoTo_mrrank.appendChild(document.createElement('img'));
		GoTo_mrrank_Img.setAttribute('src','http://www.mr-rank.de/mr.php?ref=www.steffen-hanske.de&style=12');
		GoTo_mrrank_Img.setAttribute('alt','Besserer Pagerank');
		GoTo_mrrank_Img.setAttribute('border','0');
		GoTo_mrrank_Img.setAttribute('align', 'right');
		var GoTo_beliebtestewebseite=My_Footer.appendChild(document.createElement('a'));
		GoTo_beliebtestewebseite.setAttribute('title','Die beliebteste Webseite');
		GoTo_beliebtestewebseite.setAttribute('target','_blanc');
		GoTo_beliebtestewebseite.setAttribute('href','http://www.beliebtestewebseite.de');
		GoTo_beliebtestewebseite.setAttribute('onmouseover',function StatusbeliebtestewebseiteOn(){window.status='Die beliebteste Webseite'; return true;});
		GoTo_beliebtestewebseite.setAttribute('onmouseout',function StatusbeliebtestewebseiteOff(){window.status=''; return true;});
		var GoTo_beliebtestewebseite_Img=GoTo_beliebtestewebseite.appendChild(document.createElement('img'));
		GoTo_beliebtestewebseite_Img.setAttribute('src','http://www.beliebtestewebseite.de/0pixel.php?mode=microbutton');
		GoTo_beliebtestewebseite_Img.setAttribute('alt','Die beliebteste Webseite');
		GoTo_beliebtestewebseite_Img.setAttribute('border','0');
		GoTo_beliebtestewebseite_Img.setAttribute('align','right');
		//var GoTo_Translate=My_Footer.appendChild(document.createElement('script'));
		//GoTo_Translate.setAttribute('type';'text/javascript');
		//GoTo_Translate.setAttribute('src';'http://translator.live.com/TranslatePageLink.aspx?pl=de');
		if(SitemapFrame==true&&NewsFlashFrame==true){
			var FileDateTime=My_Footer.appendChild(document.createElement('div'));
			FileDateTime.setAttribute('id','DateTime');
			//FileDateTime.setAttribute('align','left');
			var My_Date=document.lastModified;
			FileDateTime.innerHTML='>>> Letzte Aktualisierung am '+My_Date.substr(3,2)+'.'+My_Date.substr(0,2)+'.'+My_Date.substr(6,4)+'   © Steffen Hanske';
		}
	}
}
function Einblenden(Einblenden){
	if(document.getElementById(Einblenden).style.display=="none"){
		document.getElementById(Einblenden).style.display="";
		document.getElementById("Img"+Einblenden).src="img/minus.ico";
		document.getElementById("Img"+Einblenden).alt="Close";
	}else{
		document.getElementById(Einblenden).style.display="none";
		document.getElementById("Img"+Einblenden).src="img/plus.ico";
		document.getElementById("Img"+Einblenden).alt="Open";
		}
}
function Ausblenden (Ausblenden){
	if(document.getElementById(Ausblenden).style.display!="none"){
		document.getElementById(Ausblenden).style.display="none";
		document.getElementById("Img"+Ausblenden).src="img/plus.ico";
		document.getElementById("Img"+Ausblenden).alt="Open";
		}
}
function Fensterweite(){
	if(window.innerWidth){
		x=window.innerWidth;
	}else if(document.body.offsetWidth){
		x=document.body.offsetWidth;
	}else{
		x=400;
	}
}
function Fensterhoehe(){
	if(window.innerHeight){
		y=window.innerHeight;
	}else if(document.body.offsetHeight){
		y=document.body.offsetHeight;
	}else{
		y=300;
	}
}
function SitemapColor(){
	if(StartStop==0){
		StartStop=1;
	}else{
		StartStop=0;
	}
	SetColor()
}
function SetColor(){
	if(ReStart!="N"){
		ReStartColor=(Math.floor(Math.random()*6))+1;
	}
	ReStart="N";
	BC1=ConvertToByte(color1);
	BC2=ConvertToByte(color2);
	BC3=ConvertToByte(color3);
	if(ReStartColor==1){
		AktColor=BC1+BC2+BC3;
	}else if(ReStartColor==2){
		AktColor=BC1+BC3+BC2;
	}else if(ReStartColor==3){
		AktColor=BC2+BC1+BC3;
	}else if(ReStartColor==4){
		AktColor=BC2+BC3+BC1;
	}else if(ReStartColor==5){
		AktColor=BC3+BC1+BC2;
	}else if(ReStartColor==6){
		AktColor=BC3+BC2+BC1;
	}else{
		document.getElementById("Variable1").innerHTML="Fehler: "+ReStartColor;
	}
	if(document.title=="HTML Farbwechsel mit Java"){
		document.getElementById("Farbwechsel").style.backgroundColor="#"+AktColor;
		}
	document.getElementById('Inhaltsverzeichnis').style.backgroundColor="#"+AktColor;
	document.getElementById('NewsTicker').style.backgroundColor="#"+AktColor;
	if(color1+color2+color3>332){
		document.getElementById('Inhaltsverzeichnis').style.color="#000000";
		document.getElementById('NewsTicker').style.color="#000000";
	}else{
		document.getElementById('Inhaltsverzeichnis').style.color="#FFFFFF";
		document.getElementById('NewsTicker').style.color="#FFFFFF";
	}
	if(StartStop==1){
		setTimeout("SetColor()",5);
		if(x!=window.innerWidth||y!=window.innerHeight){
			GroesseGeaendert();
		}
	}
	if(Directory=="UP"){
		if(BC1=="FF"&&BC2=="FF"&&BC3=="FF"){
			ReStart="Y";
			Directory="DOWN";
		}else if(color1<255){
			color1++;
		}else if(color2<255){
			color2++;
		}else if(color3<255){
			color3++;
		}
	}else{
		if(BC1=="00"&&BC2=="00"&&BC3=="00"){
			ReStart="Y";
			Directory="UP";
		}else if(color1>0){
			color1--;
		}else if(color2>0){
			color2--;
		}else if(color3>0){
			color3--;
		}
	}
}
function ConvertToByte(Zahl){
	var ByteWert;
	var CTB0=ByteWertUmsetzen(Math.floor(Zahl/16));
	var CTB1=ByteWertUmsetzen(Zahl%16);
	ByteWert=CTB0+CTB1;
	return ByteWert;
}
function ByteWertUmsetzen(Zahl){
	var ByteUmgesetzt;
	switch (Zahl){
		case 0:ByteUmgesetzt="0";break;
		case 1:ByteUmgesetzt="1";break;
		case 2:ByteUmgesetzt="2";break;
		case 3:ByteUmgesetzt="3";break;
		case 4:ByteUmgesetzt="4";break;
		case 5:ByteUmgesetzt="5";break;
		case 6:ByteUmgesetzt="6";break;
		case 7:ByteUmgesetzt="7";break;
		case 8:ByteUmgesetzt="8";break;
		case 9:ByteUmgesetzt="9";break;
		case 10:ByteUmgesetzt="A";break;
		case 11:ByteUmgesetzt="B";break;
		case 12:ByteUmgesetzt="C";break;
		case 13:ByteUmgesetzt="D";break;
		case 14:ByteUmgesetzt="E";break;
		case 15:ByteUmgesetzt="F";break;
	}
	return ByteUmgesetzt;
}