			function AbGehts(a)
			{
				document.hallo.btyp.value = a;
  				document.hallo.submit();
 			}
			function ruecksichtbar(startknoten)
			{
				ruckchild = startknoten.firstChild;
		 		while(ruckchild != null)
				{
					ruckchild.style.visibility = "visible";
		 			ruckchild = ruckchild.nextSibling;
		 		}	
			}
		 	function rueckaus(startknoten)
		 	{
		 		// obere und untere positionierungspfeile ausblenden
				var fchild = startknoten.firstChild;
				while(fchild != null)
				{
					if(fchild.nodeName == "TABLE")
					{
						var knotenoben = fchild.getAttribute("id");
		 				xido = knotenoben.slice(knotenoben.lastIndexOf("_")+1,knotenoben.length);
		 				//document.getElementById("r_x_"+xido).firstChild.style.visibility = "hide";
		 				document.getElementById("r_x_"+xido).firstChild.style.visibility = "hidden";
		 				fchild = null;
		 			}
		 			else
		 			{
 						fchild = fchild.nextSibling;
 					}
 				}
 				var lchild = startknoten.lastChild;
 				while(lchild != null)
 				{
 					if(lchild.nodeName == "TABLE")
					{
						var knotenunten = lchild.getAttribute("id");
		 				xidu = knotenunten.slice(knotenoben.lastIndexOf("_")+1,knotenunten.length);
						//document.getElementById("r_x_"+xidu).lastChild.style.visibility = "hide";
 						document.getElementById("r_x_"+xidu).lastChild.style.visibility = "hidden";
		 				lchild = null;
		 			}
 					else
 					{
 						lchild = lchild.previousSibling;
 					}
 				}
		 	}
		 	function AbGehts1(b)
		 	{
		 		// knoten löschen
		 		var knoten = document.getElementById("x_"+b);
				var knotenid = knoten.getAttribute("id");
				document.getElementById("x_haupt").removeChild(document.getElementById("x_"+b));
				rueckaus(document.getElementById("x_haupt"));				
 			}
 			function AbGehts2()
			{
				document.hallo.btyp.value = "";
  				document.hallo.submit();
 			}
 			function nachuntenoben(b,wohin)
			{
				var knoten = document.getElementById("x_"+b);
				var knotenid1 = knoten.getAttribute("id");				
				if(wohin=="unten")
				{
					var nchild = knoten.nextSibling;
					while (nchild != null)
					{
						if(nchild.nodeName == "TABLE")
						{
							var knotenoben = nchild;
							var knotenobenid = nchild.getAttribute("id");
		 					xido = knotenobenid.slice(knotenobenid.lastIndexOf("_")+1,knotenobenid.length);
							var ifrCont =  document.getElementById("text1_"+xido+"_0");
							
							if (typeof tinyMCE !== 'undefined') tinyMCE.execCommand('mceRemoveControl', false, "text1_"+xido+"_0");
							document.getElementById("x_haupt").insertBefore(knotenoben, knoten); 	
							if (typeof tinyMCE !== 'undefined') tinyMCE.execCommand('mceAddControl', false, "text1_"+xido+"_0");
													
		 					// positionierung alles sichtbar
		 					ruecksichtbar(document.getElementById("r_x_"+xido));
		 					ruecksichtbar(document.getElementById("r_x_"+b));

							nchild = null;							
		 				}
		 				else
		 				{
 							nchild = nchild.nextSibling;
 						}
 					} 					
				}
				else
				{
					//document.getElementById("x_haupt").insertBefore(knoten,knoten.previousSibling);
					var nchild = knoten.previousSibling;
					while(nchild != null)
					{
						if(nchild.nodeName == "TABLE")
						{
							var knotenoben = nchild;
							var knotenobenid = nchild.getAttribute("id");
							
							var knotenid = knoten.getAttribute("id");
							
		 					xido = knotenobenid.slice(knotenobenid.lastIndexOf("_")+1,knotenobenid.length);
							
							xidoKnoten = knotenid.slice(knotenid.lastIndexOf("_")+1,knotenid.length);
		 					//document.getElementById("x_haupt").removeChild(knoten);
							if (typeof tinyMCE !== 'undefined') tinyMCE.execCommand('mceRemoveControl', false, "text1_"+xidoKnoten+"_0");
		 					document.getElementById("x_haupt").insertBefore(knoten, knotenoben); 
							if (typeof tinyMCE !== 'undefined') tinyMCE.execCommand('mceAddControl', false, "text1_"+xidoKnoten+"_0");	
							
		 					// positionierung alles sichtbar
							ruecksichtbar(document.getElementById("r_x_"+xido));
							ruecksichtbar(document.getElementById("r_x_"+b));				
							nchild = null;
		 				}
		 				else
		 				{
 							nchild = nchild.previousSibling;
						}
					}
				}
				rueckaus(document.getElementById("x_haupt"));
			}
			function switchlayer(Layer_Name)
			{
 				var GECKO = document.getElementById? 1:0 ;
 				var NS = document.layers? 1:0 ;
  				var IE = document.all? 1:0 ;
 				if (GECKO)
      				{
  					document.getElementById(Layer_Name).style.display=(document.getElementById(Layer_Name).style.display=='block') ? 'none' : 'block';
  				}
				else if (NS)
	   			{
       				document.layers[Layer_Name].display=(document.layers[Layer_Name].display=='block') ? 'none' : 'block';
       			}
  				else if (IE)
       			{
       				document.all[Layer_Name].style.display=(document.all[Layer_Name].style.display=='block') ? 'none' : 'block';
       			}
			}
			if (window.opera)
			{
				var browser = "OP";
 			}
 			if(document.all && browser != "OP")
 			{
 				var browser = "MS";
			}
			if(window.netscape && browser != "OP")
			{
				var browser = "NS";
				function Position(Ereignis)
				{
 					xwert = Ereignis.screenX;
 					ywert = Ereignis.screenY;
				} 
				document.onmouseover = Position;
			}			
			function getPosition(elementId)
			{   	
				element=document.getElementById(elementId);
  				var elem=element,tagname="",x=0,y=0;
				while ((typeof(elem)=="object")&&(typeof(elem.nodeName)!="undefined"))
  				{
    					y+=elem.offsetTop;
    					x+=elem.offsetLeft;
    					tagname=elem.nodeName.toUpperCase();	
					if (tagname=="BODY")elem=0;
					if (typeof(elem)=="object")
    					if (typeof(elem.parentNode)=="object")
    					elem=elem.parentNode;	
  				}  							
				position=new Object();
  				position.x=x;
  				position.y=y;
  				return position;
			}
			function ausrichtung(elementid)
			{
				 document.getElementById("c_mutti"+elementid).appendChild(document.getElementById("ausrichtung"));				
				if(browser == "NS")
				{
					document.getElementById("ausrichtung").style.visibility = "show";
					document.getElementById("ausrichtung").style.visibility = "visible";
 				}
 				else
				{											
					document.getElementById("ausrichtung").style.visibility = "visible";
				}
 				var ausrdiv = '	<div style="background-color:#ffffff;border-bottom-style:solid;border-bottom-color:#DEDEDE;border-bottom-width:1px;" class="backendtext">Ausrichtung</div>';
				ausrdiv =	ausrdiv+'<div class="ausr"><a href="javascript:ausrichtaus(0,'+String.fromCharCode(39)+elementid+String.fromCharCode(39)+');"><img src="'+cmsbilderhost+'ausrichtungspopup_01.gif" hspace="3" vspace="3" border="0"></a><a href="javascript:ausrichtaus(1,'+String.fromCharCode(39)+elementid+String.fromCharCode(39)+');"><img src="'+cmsbilderhost+'ausrichtungspopup_02.gif" hspace="3" vspace="3" border="0"></a><a href="javascript:ausrichtaus(2,'+String.fromCharCode(39)+elementid+String.fromCharCode(39)+');"><img src="'+cmsbilderhost+'ausrichtungspopup_03.gif" hspace="3" vspace="3" border="0"></a></div>';
				ausrdiv =	ausrdiv+'<div><a href="javascript:ausrichtaus(3,'+String.fromCharCode(39)+elementid+String.fromCharCode(39)+');"><img src="'+cmsbilderhost+'ausrichtungspopup_04.gif" hspace="3" vspace="3" border="0"></a><a href="javascript:ausrichtaus(4,'+String.fromCharCode(39)+elementid+String.fromCharCode(39)+');"><img src="'+cmsbilderhost+'ausrichtungspopup_05.gif" hspace="3" vspace="3" border="0"></a><a href="javascript:ausrichtaus(5,'+String.fromCharCode(39)+elementid+String.fromCharCode(39)+');"><img src="'+cmsbilderhost+'ausrichtungspopup_06.gif" hspace="3" vspace="3" border="0"></a></div>';
				ausrdiv =	ausrdiv+'<div><a href="javascript:ausrichtaus(6,'+String.fromCharCode(39)+elementid+String.fromCharCode(39)+');"><img src="'+cmsbilderhost+'ausrichtungspopup_07.gif" hspace="3" vspace="3" border="0"></a><a href="javascript:ausrichtaus(7,'+String.fromCharCode(39)+elementid+String.fromCharCode(39)+');"><img src="'+cmsbilderhost+'ausrichtungspopup_08.gif" hspace="3" vspace="3" border="0"></a><a href="javascript:ausrichtaus(8,'+String.fromCharCode(39)+elementid+String.fromCharCode(39)+');"><img src="'+cmsbilderhost+'ausrichtungspopup_09.gif" hspace="3" vspace="3" border="0"></a></div>';
 				document.getElementById("ausrichtung").innerHTML = ausrdiv;
			}

			function ausrichtaus(was,elementid) 
			{
				var ausrichtbilder = new Array();
				ausrichtbilder[0] = cmsbilderhost+'ausrichtungspopup_01.gif';
				ausrichtbilder[1] = cmsbilderhost+'ausrichtungspopup_02.gif';
				ausrichtbilder[2] = cmsbilderhost+'ausrichtungspopup_03.gif';
				ausrichtbilder[3] = cmsbilderhost+'ausrichtungspopup_04.gif';
				ausrichtbilder[4] = cmsbilderhost+'ausrichtungspopup_05.gif';
				ausrichtbilder[5] = cmsbilderhost+'ausrichtungspopup_06.gif';
				ausrichtbilder[6] = cmsbilderhost+'ausrichtungspopup_07.gif';
				ausrichtbilder[7] = cmsbilderhost+'ausrichtungspopup_08.gif';
				ausrichtbilder[8] = cmsbilderhost+'ausrichtungspopup_09.gif';
				document.getElementById("bild"+elementid).src=ausrichtbilder[was];
				document.getElementById(elementid).value=was;
				var neuid = elementid.replace(/ausricht/,"text1");
				var ausrichtstyle = new Array();
				ausrichtstyle[0] = new Array("top","left");
				ausrichtstyle[1] = new Array("top","center");
				ausrichtstyle[2] = new Array("top","right");
				ausrichtstyle[3] = new Array("middle","left");
				ausrichtstyle[4] = new Array("middle","center");
				ausrichtstyle[5] = new Array("middle","right");
				ausrichtstyle[6] = new Array("bottom","left");
				ausrichtstyle[7] = new Array("bottom","center");
				ausrichtstyle[8] = new Array("bottom","right");
				document.getElementById(neuid).style.verticalAlign = ausrichtstyle[was][0];
				document.getElementById(neuid).style.textAlign = ausrichtstyle[was][1];
				if(browser == "NS")
				{
					document.getElementById("ausrichtung").style.visibility = "hide";
 					document.getElementById("ausrichtung").style.visibility = "hidden"; 						
 				}
				else
				{
					document.getElementById("ausrichtung").style.visibility = "hidden";
 				}
 			}
 			function anzahl_tage(monat,jahr)
			{
				var t=31;
				t=(new Date(jahr,monat-1,t).getDate()==t)?t:30;
				t=(new Date(jahr,monat-1,t).getDate()==t)?t:29;
				t=(new Date(jahr,monat-1,t).getDate()==t)?t:28;
				return t;
			}
			function counter_submit(jahr,monat,tag,el_id,sub_url)



			{

				if(monat.length == 1)monat = "0"+monat;

				if(tag.length == 1)tag = "0"+tag;

				window.location.href = sub_url+'&zeit_auswahl='+jahr+monat+tag;



			}



			function counter_aus(el_id)



			{



				document.getElementById(el_id).innerHTML = altbild;



			}



			function kalender_submit(startjahr,startmonat,akttag,jahr,monat,tag,el_id,sub_url)



			{



				if(typeof altbild == "undefined")



				{



					altbild = document.getElementById(el_id).innerHTML;



				}	



				whitehfarbe="#ffffff";



				tempfarbe = "#ffffff";



				hfarbe="";



				if(monat == 0) monat = 12;



				if(monat == 13) monat = 1;



				var t = anzahl_tage(monat,jahr);



				var datum = new Date(jahr,(monat-1),tag);



				var wtag = datum.getDay();



				var erster = new Date(jahr,(monat-1),1);



				var monate = new Array("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");



				var djahr = jahr;



				var njahr = jahr;



				var runtage = 0;



				if(monat == 1) djahr = jahr-1;



				if(monat == 12) njahr = jahr+1;



				var ewtag = erster.getDay();



				var rows = Math.ceil((t+(ewtag-1))/7);



				var kalausgabe = '<div style="clear:both;background-color:#ffffff;border-style:solid;border-width:1px;border-color:#CCCCCC;width:142px;height:15px;font-family:arial;font-size:12px;">';



				var kalausgabe = kalausgabe+'<div style="float:left;width:20px;height:15px;" align="center"><a href="javascript:kalender_submit('+startjahr+','+startmonat+','+akttag+','+djahr+','+(monat-1)+','+tag+','+String.fromCharCode(39)+el_id+String.fromCharCode(39)+','+String.fromCharCode(39)+sub_url+String.fromCharCode(39)+');"; style="font-size:12px;font-family:arial; color:#000000; text-decoration:none;"><<</a></div>';



				var kalausgabe = kalausgabe+'<div style="float:left;width:100px;height:15px;" align="center">'+monate[monat-1]+'&nbsp;'+jahr+'</div>';



				if(monat == startmonat && startjahr == jahr)



				{



					var kalausgabe = kalausgabe+'<div style="float:left;width:20px;height:15px;" align="center">&nbsp;</div>';



				}



				else



				{				



					var kalausgabe = kalausgabe+'<div style="float:left;width:20px;height:15px;" align="center"><a href="javascript:kalender_submit('+startjahr+','+startmonat+','+akttag+','+njahr+','+(monat+1)+','+tag+','+String.fromCharCode(39)+el_id+String.fromCharCode(39)+','+String.fromCharCode(39)+sub_url+String.fromCharCode(39)+');" style="font-size:12px;font-family:arial; color:#000000; text-decoration:none;">>></a></div></div>';



				}



				var kalausgabe = kalausgabe+'<div style="clear:both;border-left-style:solid;border-left-width:1px;border-left-color:#CCCCCC;border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:#CCCCCC;border-right-style:solid;border-right-width:1px;border-right-color:#CCCCCC;background-color:#efefef;width:142px;height:15px;" align="center">';



				var kalausgabe = kalausgabe+'<div style="float:left;width:20px;height:15px;font-family:arial;font-size:12px;">So</div>';



				var kalausgabe = kalausgabe+'<div style="float:left;width:20px;height:15px;font-family:arial;font-size:12px;">Mo</div>';



				var kalausgabe = kalausgabe+'<div style="float:left;width:20px;height:15px;font-family:arial;font-size:12px;">Di</div>';



				var kalausgabe = kalausgabe+'<div style="float:left;width:20px;height:15px;font-family:arial;font-size:12px;">Mi</div>';



				var kalausgabe = kalausgabe+'<div style="float:left;width:20px;height:15px;font-family:arial;font-size:12px;">Do</div>';



				var kalausgabe = kalausgabe+'<div style="float:left;width:20px;height:15px;font-family:arial;font-size:12px;">Fr</div>';



				var kalausgabe = kalausgabe+'<div style="float:left;width:20px;height:15px;font-family:arial;font-size:12px;">Sa</div></div>';



				



				for(j=0;j<rows;j++)



				{



					var kalausgabe = kalausgabe+'<div style="clear:both;background-color:#ffffff;border-left-style:solid;border-left-width:1px;border-left-color:#CCCCCC;border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:#EEEEEE;border-right-style:solid;border-right-width:1px;border-right-color:#CCCCCC;width:142px;height:15px;" align="center">';



					for(i=0;i<=6;i++)



					{



						bold = new Array("","","background-color:"+whitehfarbe+";");



						bold[3] = whitehfarbe;



						if(runtage == akttag && monat == startmonat && startjahr == jahr)



						{



							bold = new Array("<b>","</b>","background-color:#DDDDDD;");



						}



						switch(true)



						{



							case(ewtag==i && runtage == 0):



								var runtage=1;



								runtagez = runtage;



								monatz = monat;



								runtagez = String(runtagez);



								monatz = String(monatz);



								if(runtagez.length == 1)runtagez = "0"+runtagez;



								if(monatz.length == 1)monatz = "0"+monatz;



								var kalausgabe = kalausgabe+'<div style="float:left;'+bold[2]+'width:20px;height:15px;font-family:arial;font-size:12px;cursor:hand;" onMouseover="javascript:tempfarbe=this.style.backgroundColor;this.style.backgroundColor=hfarbe;" onMouseout="javascript:this.style.backgroundColor=tempfarbe;"  onClick="javascript:counter_submit('+String.fromCharCode(39)+jahr+String.fromCharCode(39)+','+String.fromCharCode(39)+monat+String.fromCharCode(39)+','+String.fromCharCode(39)+runtage+String.fromCharCode(39)+','+String.fromCharCode(39)+el_id+String.fromCharCode(39)+','+String.fromCharCode(39)+sub_url+String.fromCharCode(39)+');">&nbsp;'+bold[0]+runtage+bold[1]+'&nbsp;</div>';



								runtage++;



								break;



							case(runtage !=0 && runtage<=t):



								runtagez = runtage;



								monatz = monat;



								runtagez = String(runtagez);



								monatz = String(monatz);



								if(runtagez.length == 1)runtagez = "0"+runtagez;



								if(monatz.length == 1)monatz = "0"+monatz;



								var kalausgabe = kalausgabe+'<div style="float:left;'+bold[2]+'width:20px;height:15px;font-family:arial;font-size:12px;cursor:hand;" onMouseover="javascript:tempfarbe=this.style.backgroundColor;this.style.backgroundColor=hfarbe;" onMouseout="javascript:this.style.backgroundColor=tempfarbe;" onClick="javascript:counter_submit('+String.fromCharCode(39)+jahr+String.fromCharCode(39)+','+String.fromCharCode(39)+monat+String.fromCharCode(39)+','+String.fromCharCode(39)+runtage+String.fromCharCode(39)+','+String.fromCharCode(39)+el_id+String.fromCharCode(39)+','+String.fromCharCode(39)+sub_url+String.fromCharCode(39)+');">&nbsp;'+bold[0]+runtage+bold[1]+'&nbsp;</div>';



								runtage++;



								break;	



							default:	var kalausgabe = kalausgabe+'<div style="float:left;'+bold[2]+'width:20px;height:15px;font-family:arial;font-size:12px;">&nbsp;</div>';



						}



					}



					var kalausgabe = kalausgabe+'</div>';



				}



				var kalausgabe = kalausgabe+'<div style="clear:both;background-color:#efefef;border-style:solid;border-width:1px;border-color:#CCCCCC;width:142px;height:15px;font-family:arial;font-size:12px;">';



				var kalausgabe = kalausgabe+'<div style="float:left;border-right-style:solid;border-right-width:1px;border-right-color:#CCCCCC;background-color:#efefef;width:110px;height:15px;font-family:arial;font-size:12px;cursor:hand;" align="center">&nbsp;</div>';



				var kalausgabe = kalausgabe+'<div style="float:left;background-color:#ffffff;width:30px;height:15px;font-family:arial;font-size:12px;cursor:hand;" align="center" onMouseover="javascript:this.style.backgroundColor='+String.fromCharCode(39)+'#FFC4C4'+String.fromCharCode(39)+';" onMouseout="javascript:this.style.backgroundColor='+String.fromCharCode(39)+'#ffffff'+String.fromCharCode(39)+';" onClick="javascript:counter_aus('+String.fromCharCode(39)+el_id+String.fromCharCode(39)+');">&nbsp;X&nbsp;</div></div>';



				document.getElementById(el_id).innerHTML = kalausgabe;



			}
