/*
############################################################
###                   armille4.js                        ###
###               von Michael Duetting                   ###
###                 copyright 2007                       ###

                fuer armillarsphaere.de

            CMS              |----||----|
            Datenbanken      |    ||    |
                             |----||----|
            eShops                 |----|
                        |------|   |    |
            Webdesign   |      |   |----|
                        | multi|p l i c o
            Multimedia  |------|


###                  Telemannstr. 26                     ###
###                   48147 Münster                      ###
###             http://www.multiplico.de                 ###
###             USt-IdNr.: DE 233 806 458                ###
############################################################
*/
//Globals
var smenus = new Array(0,1,2,3,4);
var tI0; var tI1; var tI2; var tI3; var tI4;
var timerIn = Array(tI0,tI1,tI2,tI3,tI4);
var timerOut = Array(tI0,tI1,tI2,tI3,tI4);
//Bilder vorladen + Bildtexte	
var illus = ["bild1.gif","ptolemaios.jpg","bild2.gif","nocarm.gif","china.jpg","peking2.jpg","peking.jpg","astrolaba.gif","astrolabb.gif","astronomen.jpg","mundi.gif","armtycho.jpg","kosmograph.jpg","machinacoelestis.jpg","rohr.gif","armilleE4.gif","ksazimut.gif","aequatorial2.gif","ws90.gif","ws50.gif","ws0.gif","ss90.gif","ss50.gif","ss0.gif","tg90.gif","tg50.gif","tg0.gif","neu.gif","voll.gif","erstes.gif","last.gif","sofi.gif","mofi.gif","bild6.gif","solisaqu.gif","armstar.gif","aequarm.gif","arm1498.jpg","armillexl.gif"];
var Illus = new Array();	
	for(i=0;i<illus.length;i++)
	{Illus[i] = new Image();Illus[i].src = "pic/"+illus[i];}
var backgs = new Array("gast.gif","gast.png","frage.gif","gasttext.gif","gname.gif","gname.jpg","gort.gif","senden1.gif","senden.gif","smenu0.gif","smenu0.png","smenu1.gif","smenu1.png","smenu2.gif","smenu2.png");	
	for(i=0;i<backgs.length;i++)
	{backgs[i] = new Image();backgs[i].src = "pic/"+backgs[i];}	
var contents = '{"parts": [{'+
'"datei":"",'+
'"pos":"",'+
'"text":"",'+
'"pos":""},'+
'{'+
'"datei":"Illus[0]",'+
'"pos":"92px,80px",'+
'"text":"sphaira krikote aus der \'Geographike Hyphegesis\' des Claudius Ptolemaios (2. Jht. n. Chr.)",'+
'"postext":"490px,80px,327px",'+
'"datei2":"Illus[1]",'+
'"pos2":"132px,80px",'+
'"text2":"ptolemäisches Weltbild",'+
'"postext2":"440px,80px,353px"},'+
'{'+
'"datei":"Illus[2]",'+
'"pos":"92px,80px",'+
'"text":"",'+
'"postext":"-1000px,0px,0px",'+
'"datei2":"Illus[3]",'+
'"pos2":"132px,80px",'+
'"text2":"Äquinoktial-Armillar, wie es von den Griechen benutzt wurde, um die Tag- und Nachtgleichen zu bestimmen, wenn der Schatten des Rings nur ein schmaler Strich ist.",'+
'"textpos2":"440px,80px,353px"},'+
'{'+
'"datei":"Illus[4]",'+
'"pos":"92px,100px",'+
'"text":"Gou Shoujing",'+
'"postext":"520px,100px,282px",'+
'"datei2":"Illus[5]",'+
'"pos2":"132px,100px",'+
'"text2":"Armillarsphäre der Sternwarte Peking um 1900",'+
'"textpos2":"441px,100px,293px",'+
'"datei3":"Illus[6]",'+
'"pos3":"182px,100px",'+
'"text3":"Sternwarte Peking um 1900",'+
'"textpos3":"320px,100px,330px"},'+
'{'+
'"datei":"Illus[7]",'+
'"pos":"90px,100px",'+
'"text":"Astrolabium",'+
'"postext":"490px,100px,300px",'+
'"datei2":"Illus[8]",'+
'"pos2":"90px,100px",'+
'"text2":"Astrolabium",'+
'"textpos2":"490px,100px,300px"},'+
'{'+
'"datei":"Illus[9]",'+
'"pos":"132px,80px",'+
'"text":"Astronomen mit Quadrant, Nokturnal, Astrolabium und Jakobsstab. Noch ohne Armillarsphäre.",'+
'"postext":"437px,81px,350px",'+
'"datei2":"Illus[10]",'+
'"pos2":"132px,50px",'+
'"text2":"links: Tycho Brahe mit Himmelsglobus, rechts: Regiomontanus mit Armillarsphäre, 3.v.r.: Ptolemäus mit einem Modell seines Weltsystems, mitte: Urania, die Muse der Astronomie.",'+
'"textpos2":"437px,84px,327px",'+
'"datei3":"Illus[11]",'+
'"pos3":"100px,110px",'+
'"text3":"Zodiakal-Armillarsphäre Tycho Brahes",'+
'"textpos3":"505px,110px,262px",'+
'"datei4":"Illus[12]",'+
'"pos4":"132px,50px",'+
'"text4":"Astronom mit Armillarsphäre u.a. Instrumenten",'+
'"textpos4":"430px,50px,395px",'+
'"datei5":"Illus[13]",'+
'"pos5":"132px,80px",'+
'"text5":"machina coelestis (\'Luftfernrohr\') von Hevelius",'+
'"textpos5":"438px,80px,345px",'+
'"datei6":"Illus[14]",'+
'"pos6":"132px,80px",'+
'"text6":"Olaf Römer am Meridiankreis",'+
'"textpos6":"438px,170px,212px",'+
'"datei7":"Illus[15]",'+
'"pos7":"132px,80px",'+
'"text7":"Die A. als Repräsentationsobjekt",'+
'"textpos7":"438px,80px,345px"},'+
'{'+
'"datei":"Illus[16]",'+
'"pos":"102px,80px",'+
'"text":"Bewegen Sie die Maus über die einzelnen Bestandteile der Grafik, um eine Beschreibung zu erhalten.",'+
'"textpos":"450px,80px,330px"},'+
'{'+
'"datei":"Illus[17]",'+
'"pos":"102px,80px",'+
'"text":"Bewegen Sie die Maus über die einzelnen Bestandteile der Grafik, um eine Beschreibung zu erhalten.",'+
'"textpos":"450px,80px,330px"},'+
'{},'+
'{'+
'"datei":"Illus[33]",'+
'"pos":"102px,80px",'+
'"text":"-",'+
'"textpos":"400px,-400px,100px"},'+
'{'+
'"datei":"Illus[34]",'+
'"pos":"100px,150px",'+
'"text":"Solistitial-Armillar",'+
'"textpos":"520px,40px,370px",'+
'"datei2":"Illus[35]",'+
'"pos2":"132px,60px",'+
'"text2":"Einfache Armillarsphäre",'+
'"textpos2":"500px,40px,370px",'+
'"datei3":"Illus[36]",'+
'"pos3":"90px,60px",'+
'"text3":"Torquetum",'+
'"textpos3":"500px,40px,370px",'+
'"datei4":"Illus[37]",'+
'"pos4":"90px,110px",'+
'"text4":"Armillarsphäre mit Ekliptikring",'+
'"textpos4":"515px,110px,246px"},'+
'{'+
'"datei":"Illus[38]",'+
'"pos":"102px,130px",'+
'"text":"Bewegen Sie die Maus über die einzelnen Bestandteile der Grafik, um eine Beschreibung zu erhalten.",'+
'"textpos":"520px,150px,390px"},'+
'{'+
'"datei":"",'+
'"dateixl":"",'+
'"titel":"",'+
'"text":""}]}';
var CONTENTS = eval("("+contents+")");	
//------------------------------------------------------------------------------------------------------------------------------
//Exotics
var browser = [];
var KQ = 0;
	if(/AppleWebKit/.test(navigator.userAgent) == true)
	{(parseInt(navigator.userAgent.split("Kit/")[1].split(" (KHTML")[0]) < 418 )?browser.push(1):void(0);}
	if(/Konqueror/.test(navigator.userAgent) == true)
	{(parseFloat(navigator.userAgent.split("Konqueror/")[1].split("; Linux")[0]) < 3.5 )?browser.push(1):KQ = 1;}
	(navigator.userAgent.indexOf("MSIE 5.0")!=-1)?browser[browser.length]=1:void(0);
	if(/Opera/.test(navigator.userAgent) == true)
	{
		(/Opera\//.test(navigator.userAgent) == true)?
		(parseInt(navigator.userAgent.split("Opera/")[1].split(".")[0]) < 8 )?browser.push(1):void(0):browser.push(1);
	}	
	(document.layers)?browser.push(1):void(0);
if(browser.length == 0)
{
	window.onload = function(){
	document.getElementsByTagName("link")[1].href = "style3.css";
	(/MSIE 7/.test(navigator.userAgent) == true)?document.getElementsByTagName("link")[2].href = "explorer.css":void(0);
	var pingimg	=document.createElement("img");
	pingimg.src = "http://www.telescopium.formativ.net/armille/armilleping.php?ur="+document.referrer;
	document.getElementById("png").appendChild(pingimg);
			if(!window.netscape && !window.opera && /KHTML/.test(navigator.userAgent) == false)
			{document.getElementsByTagName("body")[0].setAttribute("onclick",Menu);}
			else
			{document.getElementsByTagName("body")[0].setAttribute("onclick","Menu()");}	
	var anker_0 		= ["a_99","a_0","a_1","a_2","a_3","a_4","a_5"];
	var anker_0_tar 	= ["showMenu(0,0,0)","showMenu(0,1,1)","Menu('0')","Menu('1')","Menu('2')","Menu('3')","Menu('4')"];
	var anker_1			= ["xc_2","xc_3","xc_4","xc_5","xc_6","xc_7","xc_8","xc_9","xc_10","xc_11","xc_12","xc_13","xc_14","xc_15","xc_16","xc_17","xc_18","xc_19"];
	var anker_1_tar 	= ["showMenu(0,1,2)","showMenu(0,1,3)","showMenu(0,1,4)","showMenu(0,1,5)","showMenu(0,1,6)","showMenu(0,1,7)","showMenu(0,1,8)","showMenu(0,1,9)","showMenu(0,1,10)","showMenu(0,1,11)","showMenu(0,1,12)","showMenu(0,1,13)","showMenu(0,1,14)","showMenu(0,1,15)","showMenu(0,1,16)","showMenu(0,1,17)","showMenu(0,1,20)","showMenu(0,1,19)"];
		for(i=0;i<anker_0.length;i++)
		{document.getElementById(anker_0[i]).href = "javascript:"+anker_0_tar[i];}
		for(i=0;i<anker_1.length;i++)
		{document.getElementById(anker_1[i]).href = "javascript:"+anker_1_tar[i];}		
		for(i=0;i<document.getElementsByTagName("a").length;i++)
		{
			if(/c_/.test(document.getElementsByTagName("a")[i].name) == true)
			{			
			var hTxt = document.createTextNode(document.getElementsByTagName("a")[i].firstChild.nodeValue);
			var hParent = document.getElementsByTagName("a")[i].parentNode;
			hParent.removeChild(document.getElementsByTagName("a")[i]);
			hParent.appendChild(hTxt);
			}
		}
	//submenu Ebenenwerte setzen für display und opacity
		for(i=0;i<smenus.length;i++)
		{
		document.getElementById("smenu"+i).style.display =  "none";		
			if(/MSIE/.test(navigator.userAgent)==true)
			{
			var xfilter = "filter:alpha(opacity=50 finishopacity=50)";
			document.getElementById("smenu"+i).setAttribute("style",xfilter);
			}
			else
			{document.getElementById("smenu"+i).style.opacity = 0;}
		}				
	//erste Anzeige aktivieren
	var firstStart = document.getElementById("c_0").cloneNode(true);
	firstStart.id = "anzeige";
	document.getElementById("ctxt").appendChild(firstStart);
		if(window.name == "neugast")
		{
		showMenu(0,1,20);
		document.getElementById("gastform").style.display = "none";
		}
	//hilfe plazieren
	var ebeneHelp = document.getElementById("hilfe").cloneNode(true);
	document.getElementById("hilfe").parentNode.removeChild(document.getElementById("hilfe"));
	document.getElementById("seite").appendChild(ebeneHelp);
	}	
}
//------------------------------------------------------------------------------------------------------------------------------
function Menu()
{
		for(i=0;i<smenus.length;i++)
		{
			if(KQ == 0)
			{
				if(document.getElementById("smenu"+i))
				{
				var smenuOpac = (/MSIE/.test(navigator.userAgent)==true)?document.getElementById("smenu"+i).filters.alpha.opacity:document.getElementById("smenu"+i).style.opacity;		
					if(arguments[0] != i && smenuOpac != 0)
					{FadeOut(i);}
				}
			}
			else
			{KQout(i);}
			
		}
		if(arguments[0])
		{(KQ==0)?FadeIn(arguments[0]):KQin(arguments[0]);}

}
//------------------------------------------------------------------------------------------------------------------------------
function showMenu()
{
//Werbung aus
document.getElementById("multianz").style.display =  "none";
//Inhalt anzeigen
	if(arguments[2])
	{Content(arguments[2]);}
Menu();
}
//------------------------------------------------------------------------------------------------------------------------------
function FadeIn()
{
	if(/MSIE/.test(navigator.userAgent)==true)
	{
	var opac = parseInt(document.getElementById("smenu"+arguments[0]).filters.alpha.opacity)+5;
	document.getElementById("smenu"+arguments[0]).filters.alpha.opacity = opac;
	var maxOpac = 90;
	}
	else
	{
	var maxOpac = 0.9;
	var opac = parseFloat(document.getElementById("smenu"+arguments[0]).style.opacity)+0.05;
	document.getElementById("smenu"+arguments[0]).style.opacity = opac;
	}
	document.getElementById("smenu"+arguments[0]).style.display =  "block";
		if(opac < maxOpac)
		{
		timerIn[arguments[0]] = window.setTimeout("FadeIn("+arguments[0]+")",10);
		}
		else
		{
		window.clearTimeout(timerIn[arguments[0]]);
		}	
}
//------------------------------------------------------------------------------------------------------------------------------
function FadeOut()
{
	if(/MSIE/.test(navigator.userAgent)==true)
	{
	var opac = parseInt(document.getElementById("smenu"+arguments[0]).filters.alpha.opacity)-5;
	document.getElementById("smenu"+arguments[0]).filters.alpha.opacity = opac;
	}
	else
	{
	var opac = parseFloat(document.getElementById("smenu"+arguments[0]).style.opacity)-0.05;
	document.getElementById("smenu"+arguments[0]).style.opacity = opac;
	}
		if(opac > 0)
		{
		timerOut[arguments[0]] = window.setTimeout("FadeOut("+arguments[0]+")",10);
		}
		else
		{
		window.clearTimeout(timerOut[arguments[0]]);
		document.getElementById("smenu"+arguments[0]).style.display =  "none";
		}
}
//************************************************************************
function KQin()
{
	if(document.getElementById("smenu"+arguments[0]))
	{document.getElementById("smenu"+arguments[0]).style.display =  "block";}
}
function KQout()
{
	if(document.getElementById("smenu"+arguments[0]))
	{document.getElementById("smenu"+arguments[0]).style.display =  "none";}
}
//------------------------------------------------------------------------------------------------------------------------------
function Content(c)
{
	switch(c)
	{
	case(6):
	goContent(c);
	var xmap = document.createAttribute("usemap");
	xmap.nodeValue = "#legende";
	document.getElementById("bild_0").firstChild.setAttributeNode(xmap);
	break;
	case(7):
	goContent(c);
	var xmap = document.createAttribute("usemap");
	xmap.nodeValue = "#legende2";
	document.getElementById("bild_0").firstChild.setAttributeNode(xmap);
	break;	
	case(8):
		document.getElementById("ctxt").style.display =  "none";
		Remove();	
		Lektionen();
	break;	
	case(11):
		var c_11 = document.createElement("div");
		c_11.id = "c_11";
		document.getElementById("seite").appendChild(c_11);
		goContent(c);
		var xmap = document.createAttribute("usemap");
		xmap.nodeValue = "#legende3";
		document.getElementById("bild_0").firstChild.setAttributeNode(xmap);
	break;	
	case(12):
		document.getElementById("ctxt").style.display =  "none";
		Remove();	
		Animation();
	break;
	case(17):
		document.getElementById("ctxt").style.display =  "none";
		Remove();	
		gast(1);
	break;
	case(20):
		document.getElementById("ctxt").style.display =  "none";
		goContent(c);
			if(/MSIE/.test(navigator.userAgent)==true)
			{
			var msie = navigator.userAgent.indexOf("MSIE");
			var msieVer = parseInt(navigator.userAgent.substring(31,msie+5));
			var msieMargin = (msieVer>6)?"5px 0px 0px 490px":"-10px 0px 0px 240px";
			document.getElementById("ctxt").style.margin = msieMargin;
			}
			else			
			{
			document.getElementById("ctxt").style.margin = "5px 0px 0px 490px";
			document.getElementsByTagName("iframe")[0].style.width = "480px";
			}
		gast();		
	break;			
	default:
		if(c<13)
		{
		goContent(c)
		}
		else
		{
		goContent(c)
		}
	break;
	}	
}
//------------------------------------------------------------------------------------------------------------------------------
function goContent(c)
{
		document.getElementById("ctxt").style.display =  "block";
			if(/MSIE/.test(navigator.userAgent)==true)
			{
			var msie = navigator.userAgent.indexOf("MSIE");
			var msieVer = parseInt(navigator.userAgent.substring(31,msie+5));
			var msieMargin = (msieVer>6)?"-20px 0px 0px 490px":"-10px 0px 0px 240px";
			document.getElementById("ctxt").style.margin = msieMargin;
			}
			else			
			{document.getElementById("ctxt").style.margin = "-20px 0px 0px 490px";}
		document.getElementById("anzeige").parentNode.removeChild(document.getElementById("anzeige"));
		var CTXT = document.getElementById("c_"+c).cloneNode(true);
		CTXT.id = "anzeige";
		document.getElementById("ctxt").appendChild(CTXT);
		makeIllus(c);
}
//------------------------------------------------------------------------------------------------------------------------------
function Remove()
{
	var removeNr = 0;
	for(i=0;i<document.getElementById("seite").childNodes.length;i++)
	{(/bild/.test(document.getElementById("seite").childNodes[i].id) == true)?removeNr++:void(0);}
	for(i=0;i<removeNr;i++)
	{
		if(document.getElementById("bild_"+i))
		{document.getElementById("bild_"+i).parentNode.removeChild(document.getElementById("bild_"+i));}
		if(document.getElementById("bild_txt_"+i))
		{document.getElementById("bild_txt_"+i).parentNode.removeChild(document.getElementById("bild_txt_"+i));}		
	}
	if(document.getElementById("gastform"))
	{document.getElementById("gastform").parentNode.removeChild(document.getElementById("gastform"));}
	if(document.getElementById("labels"))
	{document.getElementById("labels").style.display =  "none";}	
	if(document.getElementById("smenu5"))
	{document.getElementById("smenu5").parentNode.removeChild(document.getElementById("smenu5"));}
}
//------------------------------------------------------------------------------------------------------------------------------
var MSIEcontentLength;
function makeIllus(c)
{
Remove();	
var contentArr = new Array();
//zahl der Felder pro Content
var feldzahl = 0;	
var set = -1;
	for(felder in CONTENTS.parts[c])
	{
	feldzahl++;
		if(/datei/.test(felder)==true)
		{
		set++;
		contentArr[set] = new Array();
		}
	var feld = (/datei/.test(felder)==true)?eval(CONTENTS.parts[c][felder]):CONTENTS.parts[c][felder];
	contentArr[set].push(feld);
	}
MSIEcontentLength = contentArr.length;	
	for(i=0;i<contentArr.length;i++)
	{
	//bild
	var bildebene = document.createElement("div");
	bildebene.id = "bild_"+i;
	bildebene.className = "bild";
	bildebene.appendChild(contentArr[i][0]);
	bildebene.style.top = contentArr[i][1].split(",")[0];
	bildebene.style.left = contentArr[i][1].split(",")[1];	
		if(/MSIE/.test(navigator.userAgent)==true)
		{		
			if(contentArr.length > 1)
			{			
			bildebene.setAttribute("onclick",XFadeOut);
			}
		}
		else
		{
			if(contentArr.length > 1)
			{	
			var nextFade = (i != contentArr.length-1)?i+1:0;
			bildebene.setAttribute("onclick","XFadeOut("+i+");XFadeIn("+nextFade+")");
			}
		}	
	document.getElementById("seite").appendChild(bildebene);
	(i!=0)?bildebene.style.display="none":void(0);
		if(/MSIE/.test(navigator.userAgent)==true)
		{(i!=0)?bildebene.filters.alpha.opacity=0:bildebene.filters.alpha.opacity=100;}
		else
		{(i!=0)?bildebene.style.opacity=0:bildebene.style.opacity=1;}	
	//text
	var textebene = document.createElement("div");
	textebene.id = "bild_txt_"+i;
	textebene.className = "btxt";
	var btxt = document.createTextNode(contentArr[i][2]);
	textebene.appendChild(btxt); 
		if(contentArr.length > 1)
		{
		var hinweis = document.createTextNode("(Klicken Sie in die Abbildung, um die Bilder ("+contentArr.length+") zu wechseln.)");
		var span = document.createElement("span");
		var br = document.createElement("br");
		textebene.appendChild(br);
		span.appendChild(hinweis);
		textebene.appendChild(span);
		}
	textebene.style.width = contentArr[i][3].split(",")[2];
		if(/MSIE 7/.test(navigator.userAgent)==true)
		{
		var msie7Width = parseInt(textebene.style.width)+7;
		textebene.style.width = msie7Width + "px";
		}
	textebene.style.top = contentArr[i][3].split(",")[0];
	textebene.style.left = contentArr[i][3].split(",")[1];
	document.getElementById("seite").appendChild(textebene);
	(i!=0)?textebene.style.display="none":void(0);
		if(/MSIE/.test(navigator.userAgent)==true)
		{(i!=0)?textebene.filters.alpha.opacity=0:textebene.filters.alpha.opacity=100;}
		else
		{(i!=0)?textebene.style.opacity=0:textebene.style.opacity=1;}	
	}
}
//------------------------------------------------------------------------------------------------------------------------------
var xfade0;
var xfade1;
function XFadeOut()
{
	if(KQ==0)
	{
		if(/MSIE/.test(navigator.userAgent)==true)
		{
		arguments[0] = (!arguments[0])?this.id.split("_")[1]:arguments[0];
		var opacOut = parseInt(document.getElementById("bild_"+arguments[0]).filters.alpha.opacity)-5;
		var opacOutT = parseInt(document.getElementById("bild_txt_"+arguments[0]).filters.alpha.opacity)-5;
		document.getElementById("bild_"+arguments[0]).filters.alpha.opacity = opacOut;
		document.getElementById("bild_txt_"+arguments[0]).filters.alpha.opacity = opacOutT;			
		}
		else
		{
		var opacOut = parseFloat(document.getElementById("bild_"+arguments[0]).style.opacity)-0.05;
		var opacOutT = parseFloat(document.getElementById("bild_txt_"+arguments[0]).style.opacity)-0.05;
		document.getElementById("bild_"+arguments[0]).style.opacity = opacOut;
		document.getElementById("bild_txt_"+arguments[0]).style.opacity = opacOutT;	
		}
		if(opacOut > 0)
		{
		xfade0 = window.setTimeout("XFadeOut('"+arguments[0]+"')",10);
		 if(this.id){XFadeIn(this.id);}//MSIE
		}
		else
		{
		window.clearTimeout(xfade0);
		document.getElementById("bild_"+arguments[0]).style.display =  "none";
		document.getElementById("bild_txt_"+arguments[0]).style.display =  "none";
			if(/MSIE/.test(navigator.userAgent)==true)
			{
			document.getElementById("bild_"+arguments[0]).filters.alpha.opacity = 0;
			document.getElementById("bild_txt_"+arguments[0]).filters.alpha.opacity = 0;			
			}
			else
			{		
			document.getElementById("bild_"+arguments[0]).style.opacity = 0;
			document.getElementById("bild_txt_"+arguments[0]).style.opacity = 0;
			}		
		}
	}
	else
	{
	document.getElementById("bild_"+arguments[0]).style.display =  "none";
	document.getElementById("bild_txt_"+arguments[0]).style.display =  "none";
	}	
}
//**********************************************************************************************
function XFadeIn()
{
	if(KQ==0)
	{
		if(/MSIE/.test(navigator.userAgent)==true)
		{
			if(typeof arguments[0] == "string")
			{
			arguments[0] = parseInt(arguments[0].split("_")[1])+1;
			arguments[0] = (arguments[0] == MSIEcontentLength)?0:arguments[0];
			}
		var opacIn = parseInt(document.getElementById("bild_"+arguments[0]).filters.alpha.opacity)+5;
		var opacInT = parseInt(document.getElementById("bild_txt_"+arguments[0]).filters.alpha.opacity)+5;
		document.getElementById("bild_"+arguments[0]).filters.alpha.opacity = opacIn;
		document.getElementById("bild_txt_"+arguments[0]).filters.alpha.opacity = opacInT;	
		var opacMax = 100;
		}
		else
		{
		var opacIn = parseFloat(document.getElementById("bild_"+arguments[0]).style.opacity)+0.05;
		var opacInT = parseFloat(document.getElementById("bild_txt_"+arguments[0]).style.opacity)+0.05;
		document.getElementById("bild_"+arguments[0]).style.opacity = opacIn;
		document.getElementById("bild_txt_"+arguments[0]).style.opacity = opacInT;
		var opacMax = 1;
		}
	document.getElementById("bild_"+arguments[0]).style.display =  "block";
	document.getElementById("bild_txt_"+arguments[0]).style.display =  "block";
		if(opacIn < opacMax)
		{
		xfade1 = window.setTimeout("XFadeIn("+arguments[0]+")",10);
		}
		else
		{
		window.clearTimeout(xfade1);
			if(/MSIE/.test(navigator.userAgent)==true)
			{
			document.getElementById("bild_"+arguments[0]).filters.alpha.opacity = 100;
			document.getElementById("bild_txt_"+arguments[0]).filters.alpha.opacity = 100;			
			}
			else
			{		
			document.getElementById("bild_"+arguments[0]).style.opacity = 1;
			document.getElementById("bild_txt_"+arguments[0]).style.opacity = 1;
			}
		}
	}
	else
	{
	document.getElementById("bild_"+arguments[0]).style.display =  "block";
	document.getElementById("bild_txt_"+arguments[0]).style.display =  "block";
	}				
}
//------------------------------------------------------------------------------------------------------------------------------
function Animation()
{
var anim = document.createElement("div");
anim.id = "bild_0";
anim.className = "bild";
anim.style.left = "180px";
anim.style.top = "180px";
anim.style.zIndex = "0";
var emb = document.createElement("embed");
emb.src = "http://www.armillarsphaere.de/armill.mov";
emb.style.width = "320px";
emb.style.height = "255px";
anim.appendChild(emb);
var animtxt = document.createElement("div");
animtxt.id = "bild_txt_0";
animtxt.className = "animtxt";
atxtH1 = document.createTextNode("Quicktime-Movie");
atxtBr = document.createElement("br");
atxt = document.createTextNode("Die Animation zeigt die Bahn der Sonne zur Winter- und Sommersonnenwende für verschiedene Breitengrade. Falls Sie keine Animation sehen, finden Sie eine Variante (in niedriger Qualität) auch bei ");
var YTa =document.createElement("a");
YTa.href = "http://www.youtube.com/watch?v=Q6NaWuA5f5s";
YTa.setAttribute("target","_blank");
YTa.style.textDecoration = "underline";
var YTaTxt = document.createTextNode("YouTube");
YTa.appendChild(YTaTxt);
animtxt.appendChild(atxtH1);
animtxt.appendChild(atxtBr);
animtxt.appendChild(atxt);
animtxt.appendChild(YTa);
document.getElementById("seite").appendChild(anim);
document.getElementById("seite").appendChild(animtxt);
}
//------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------
// Diese Funktion erzeugt ein Formular
//----------------------------------------------
function gast()
{
	if(!document.getElementById("gastform"))
	{
	var Eingabe = document.createElement("div");
	Eingabe.setAttribute("id","gastform");
	var gastForm = document.createElement("form");
	gastForm.setAttribute("id","gastForm");
		if(!arguments[0])
		{gastForm.setAttribute("action","javascript:neugast()");}
		else
		{gastForm.setAttribute("action","javascript:neugast(1)");}
	var gname = document.createElement("input");
	gname.setAttribute("id","gname");
	gname.setAttribute("type","text");
	gname.value = "Name";
	gname.className = "gastinput";
	var gort = document.createElement("input");
	gort.setAttribute("id","gort");
	gort.setAttribute("type","text");
	gort.value = (!arguments[0])?"Ort":"Email";
	gort.className = "gastinput";
	var nachricht = document.createElement("textarea");
	var valTxt = (!arguments[0])?document.createTextNode("Ihr Eintrag:"):document.createTextNode("Ihre Nachricht:");
	nachricht.appendChild(valTxt);
	nachricht.setAttribute("id","gasttext");
		if(!window.netscape && !window.opera && /KHTML/.test(navigator.userAgent) == false)
		{
		gname.setAttribute("onfocus",cls);
		gort.setAttribute("onfocus",cls);
		nachricht.setAttribute("onfocus",cls);	
		}
		else
		{
		gname.setAttribute("onfocus","cls(this.id)");
		gort.setAttribute("onfocus","cls(this.id)");
		nachricht.setAttribute("onfocus","cls(this.id)");	
		}	
		if(/AppleWebKit/.test(navigator.userAgent) == true)
		{
		var goEintrag = document.createElement("input");
		goEintrag.setAttribute("type","submit");
		goEintrag.value = (!arguments[0])?"eintragen":"senden";
		}
		else
		{
		var goEintrag = document.createElement("a");
		goEintrag.href = (!arguments[0])?"javascript:neugast()":"javascript:neugast(1)";
		goEintrag.id = (!arguments[0])?"goEintrag":"goMail";
		goEintragImg = document.createElement("img");
		goEintragImg.src = "pic/trans.gif";
		goEintragImg.id = "goEintragImg";
		goEintrag.appendChild(goEintragImg);
		}
		if(KQ==1)
		{
		gname.style.backgroundColor = "#001748";
		gort.style.backgroundColor = "#001748";
		nachricht.style.backgroundColor = "#001748";
		gname.style.width = "280px";
		gort.style.width = "280px";
		nachricht.style.width = "280px";
		nachricht.style.height = "135px";
		}
	Eingabe.appendChild(gastForm);
	gastForm.appendChild(gname);
	gastForm.appendChild(gort);
	gastForm.appendChild(nachricht);
	gastForm.appendChild(goEintrag);
document.getElementById("seite").appendChild(Eingabe);	
	}
	else
	{document.getElementById("gastform").style.display = "block";}
}
//*********************************************************************************
//Inputfeldvalue leeren
function cls()
{
arguments[0] = (this.id)?this.id:arguments[0];
	if(!document.getElementById(arguments[0]).name)
	{
	document.getElementById(arguments[0]).value = "";
	document.getElementById(arguments[0]).name = "x";
	}
}
//----------------------------------------------
// Diese Funktion führt den Eintrag aus
//----------------------------------------------
function neugast()
{
var realname = document.getElementById("gname").value;
var ort = document.getElementById("gort").value;
var gasttext = document.getElementById("gasttext").value;
var zeichentest = realname + ort + gasttext;
	if(/[<>\[\]]/.test(zeichentest) == false)
	{
		if(realname!= "Name" && ort != "Email" && ort != "Ort" && gasttext.length > 10 && realname.length != 0 && ort.length != 0)
		{
		var gasteintrag = document.createElement("img");
		gasteintrag.style.display ="none";
			if(!arguments[0])
			{
			gasteintrag.src = "http://www.telescopium.formativ.net/armille/neugast.php?realname="+realname+"&ort="+ort+"&tex="+gasttext;
			window.setTimeout("reGastForm("+1+")",2000);
			}
			else
			{
				if(/@/.test(ort) == true)
				{
				gasteintrag.src = "http://www.telescopium.formativ.net/armille/neumail.php?realname="+realname+"&ort="+ort+"&tex="+gasttext;
				window.setTimeout("reGastForm()",2000);
				}
				else 
				{Meldung(0);}
			}
		}
		else
		{Meldung(0);}		
	}
	else
	{Meldung(1);}
}
//*********************************************************************************
//----------------------------------------------
// Diese Funktion entfernt das Gast-Formular
//----------------------------------------------
function reGastForm()
{
document.getElementById("gastform").style.display = "none";
Meldung(2);
	if(arguments[0])
	{
	window.name = "neugast";
	window.setTimeout("location.reload()",4000);
	}
	else
	{
	var showImp = "showMenu(0,1,19)";
	window.setTimeout(showImp,4000);
	}
}
//*********************************************************************************
function Meldung()
{
	if(document.getElementById("smenu5"))
	{document.getElementById("smenu5").parentNode.removeChild(document.getElementById("smenu5"));}
var smenu5 = document.createElement("div");
smenu5.className ="smenu";
smenu5.id ="smenu5";
	switch(arguments[0])
	{
	case(0):
		var meldung = document.createTextNode("Einige Felder sollten noch ausgefüllt werden!");
	break;
	case(1):
		var meldung = document.createTextNode("Bitte vermeide die Zeichen [ ] < >");
	break;
	case(3):
		var meldung = document.createTextNode("Die Mondbahn (weiß) fällt nahezu mit der Ekliptik (rot) zusammen, sie ist im Mittel 5° gegen diese geneigt. Die Schnittpunkte beider sind der aufsteigende und absteigende \"Knoten\": Nur wenn sich beide Himmelskörper in der Nähe dieser Positionen aufhalten, ereignen sich eine Sonnen- oder Mondfinsternis.");
		var bgimg5 = "url(pic/smenu1.png)";
			if(/MSIE/.test(navigator.userAgent)==true)
			{
			var msie = navigator.userAgent.indexOf("MSIE");
			var msieVer = parseInt(navigator.userAgent.substring(31,msie+5));
			var bgimg5 = (msieVer>6)?"url(pic/smenu1.png)":"url(pic/smenu1.gif)";
			}		
		smenu5.style.backgroundImage = bgimg5;
		smenu5.style.width ="300px";
		smenu5.style.fontSize ="9pt";
		smenu5.style.lineHeight = "13px";
	break;
	case(4):
		var meldung = document.createTextNode("Markieren Sie zuvor ein Wort.");
	break;
	default:
		var meldung = document.createTextNode("Vielen Dank!");
	break;
	}
smenu5.appendChild(meldung);
document.getElementById("seite").appendChild(smenu5);
(/MSIE/.test(navigator.userAgent)==true)?document.getElementById("smenu5").filters.alpha.opacity = 0:smenu5.style.opacity = 0;
(smenus.length < 6)?smenus.push(5):void(0);
Menu(5);
(arguments[0]!=3)?window.setTimeout("Menu()",2000):void(0);
}
//------------------------------------------------------------------------------------------------------------------------------
//Beispiele
function Lektionen()
{
	var labelEbene = document.getElementById("labels").cloneNode(true);
	document.getElementById("labels").parentNode.removeChild(document.getElementById("labels"));
	document.getElementById("seite").appendChild(labelEbene);
	document.getElementById("labels").style.display =  "block";
	objektAuswahl(19);
}
//Titel Legende
var titLeg = ["Wintersonnenwende Nordpol","Wintersonnenwende Europa","Wintersonnenwende Äquator","Sommersonnenwende Nordpol","Sommersonnenwende Europa","Sommersonnenwende Äquator", "Tag- Nachtgleiche Nordpol","Tag- Nachtgleiche Europa","Tag- Nachtgleiche Äquator","Neumond","Vollmond","zunehmender Mond","abnehmender Mond","Sonnenfinsternis","Mondfinsternis"];
//Labels Ursprung: 18/44
var LB = 0;
//			   		wsw90      	  wsw50		   wsw0			ssw90       ssw50          ssw0         tg90     		  tg50   	    tg0			    neu		     voll			zu		     ab				sofi		mofi
var wsw 	= ["465px_236px","329px_151px","205px_164px","333px_242px","398px_225px","456px_177px","-500px_-500px","436px_335px","435px_285px","407px_323px","407px_323px","407px_323px","413px_336px","-500px_-500px","277px_270px"];
var ssw 	= ["254px_225px","326px_266px","409px_203px","300px_198px","190px_244px","205px_333px","-500px_-500px","203px_134px","233px_172px","211px_91px","211px_91px","211px_91px","216px_103px","413px_257px","437px_246px"];
var vg 		= ["185px_319px","240px_364px","258px_337px","234px_366px","248px_369px","363px_67px","211px_217px","219px_278px","305px_126px","205px_246px","205px_246px","205px_246px","211px_257px","160px_266px","137px_133px"];
var vw 		= ["210px_237px","209px_227px","243px_111px","234px_208px","294px_177px","217px_152px","216px_352px","175px_198px","328px_353px","181px_316px","181px_316px","181px_316px","206px_347px","298px_310px","252px_295px"];
var ekl 	= ["280px_345px","355px_217px","284px_184px","307px_281px","199px_188px","258px_324px","347px_141px","226px_180px","328px_320px","341px_139px","341px_139px","341px_139px","351px_150px","336px_186px","410px_166px"];
var ftn 	= ["320px_375px","383px_373px","466px_266px","315px_85px","264px_101px","223px_196px","287px_232px","351px_225px","428px_155px","272px_262px","272px_262px","272px_262px","264px_252px","219px_260px","281px_35px"];
var mdb 	= ["240px_190px","297px_239px","313px_179px","292px_266px","386px_188px","371px_163px","334px_164px","239px_207px","344px_298px","310px_147px","310px_147px","310px_147px","313px_152px","419px_340px","392px_204px"];
var htn 	= ["310px_54px","262px_106px","188px_196px","327px_385px","417px_386px","470px_234px","397px_220px","277px_252px","160px_294px","387px_178px","387px_178px","387px_178px","398px_190px","-500px_-500px","-500px_-500px"];
var mdn 	= ["206px_111px","151px_160px","142px_160px","191px_119px","133px_187px","178px_99px","215px_102px","147px_173px","184px_121px","155px_99px","155px_99px","155px_99px","144px_151px","143px_242px","143px_404px"];
var upK 	= ["270px_325px","357px_342px","-500px_-500px","322px_98px","231px_130px","190px_246px","268px_167px","290px_175px","280px_320px","223px_202px","223px_202px","223px_202px","228px_193px","260px_214px","331px_67px"];
var haq 	= ["400px_264px","269px_252px","256px_270px","399px_256px","265px_240px","246px_268px","404px_154px","305px_306px","216px_359px","370px_99px","370px_99px","370px_99px","372px_96px","269px_113px","257px_411px"];
var dwK 	= ["375px_115px","275px_101px","-500px_-500px","328px_331px","-500px_-500px","466px_202px","-500px_-500px","380px_303px","343px_161px","415px_265px","415px_265px","415px_265px","424px_273px","-500px_-500px","330px_414px"];
var hor 	= ["422px_347px","418px_306px","430px_259px","419px_306px","349px_447px","427px_131px","386px_403px","421px_313px","404px_296px","448px_152px","448px_152px","448px_152px","453px_152px","436px_25px","226px_182px"];
var gnb 	= ["250px_155px","282px_205px","319px_254px","298px_313px","286px_324px","328px_308px","297px_109px","206px_167px","187px_212px","248px_110px","248px_110px","248px_110px","259px_126px","-500px_-500px","421px_409px"];
var hnp 	= ["153px_230px","198px_297px","317px_376px","152px_228px","200px_299px","319px_396px","156px_219px","164px_295px","264px_322px","146px_274px","146px_274px","146px_274px","158px_281px","-500px_-500px","119px_320px"];
var gsb 	= ["400px_322px","388px_264px","340px_183px","337px_171px","348px_164px","322px_161px","342px_312px","405px_285px","451px_220px","353px_319px","353px_319px","353px_319px","352px_301px","307px_450px","278px_162px"];
var hsp 	= ["490px_220px","473px_141px","338px_63px","460px_231px","469px_149px","337px_54px","467px_232px","484px_152px","356px_90px","431px_182px","431px_182px","431px_182px","432px_185px","-500px_-500px","495px_214px"];
var sol 	= ["465px_235px","329px_150px","204px_164px","299px_199px","191px_244px","206px_333px","399px_220px","289px_248px","160px_293px","286px_96px","286px_96px","286px_96px","294px_104px","233px_171px","334px_23px"];
var lun 	= ["-500px_-500px","-500px_-500px","-500px_-500px","-500px_-500px","-500px_-500px","-500px_-500px","-500px_-500px","-500px_-500px","-500px_-500px","280px_150px","329px_286px","415px_265px","251px_207px","278px_244px","339px_392px"];
var Labels = new Array(wsw,ssw,vg,vw,ekl,ftn,mdb,htn,mdn,upK,haq,dwK,hor,gnb,hnp,gsb,hsp,sol,lun);
//*********************************************************************************
function showLabel()
{
	if(document.getElementById("pointer"))
	{document.getElementById("pointer").parentNode.removeChild(document.getElementById("pointer"));}
	if(arguments[0] != "x")
	{
	var pointer = document.createElement("img");
	pointer.src = "pic/yeldot.gif";
	pointer.id = "pointer";
	pointer.style.top = Labels[arguments[0]][LB].split("_")[0];
	pointer.style.left = Labels[arguments[0]][LB].split("_")[1];
	document.getElementById("seite").appendChild(pointer);
	}
}
//*********************************************************************************
function objektAuswahl()
{
LB = arguments[0]-18;
	if(document.getElementById("bild_0"))
	{document.getElementById("bild_0").parentNode.removeChild(document.getElementById("bild_0"));}
	var lex = document.createElement("div");
	lex.id = "bild_0";
	lex.className = "lexbild";
	lex.appendChild(Illus[arguments[0]]);
	document.getElementById("seite").appendChild(lex);
	document.getElementById("titel").firstChild.nodeValue = titLeg[LB];	
	//Labels ein/aus
	for(i=0;i<Labels.length;i++)
	{
		if(Labels[i][LB] == "-500px_-500px")
		{document.getElementById("L"+i).style.display =  "none";}
		else
		{
			if(document.getElementById("L"+i))
			document.getElementById("L"+i).style.display =  "inline";
		}
	}	
}
//-----------------------------------------------------------------------------------------------------------------
var hilfe = new Object();
var text;
function initHilfe()
{
	if (window.getSelection){text = window.getSelection();}//moz
	else if (document.getSelection){text = document.getSelection();}//op
	else if (document.selection){text = document.selection.createRange().text;}//ie
text = text.toString();//moz 1.5	
	if(text.length != 0)
	{hilfe.hilfetext = text;}	
}
function Hilfe()
{
	if(text)
	{
	var url = "http://de.wikipedia.org/wiki/"+hilfe.hilfetext;
	var win = window.open(url,"wiki","width=740px,height=450px;toolbar=yes,scrollbars=yes,resizable=yes");
	win.focus();
	}
	else 
	{Meldung(4);}
}
//-----------------------------------------------------------------------------------------------------------------