function datum(){
var heute = new Date();
var day=heute.getDate();
var month=heute.getMonth();
var year=heute.getFullYear();
if(day<10){day='0'+day}
if(month<10){month='0'+month;}
return(day+'.'+month+'.'+year);
}

function link(strURL,target){
	if(target > ' '){
		openwindow(strURL);
	}else{
		window.location.href=strURL;
	}
}

function openwindow(url,width,height){
  if(typeof(width)=='undefined'){var width=650;}
  if(typeof(height)=='undefined'){var height=700;}
  WThema = window.open(url,'AuswahlThema','width='+width+',height='+height+',scrollbars,resizable,dependent=yes,left=100,top=0');
}

// lets swap the control images
function swapControlImagesSrc(obj2Change,newImgSrc)
{
  if (obj2Change) {  obj2Change.src = newImgSrc; }
}

function Formularabsenden(formular){
	formular.submit();
}

function openwindow(url,width,height){
  if(typeof(width)=='undefined'){var width=650;}
  if(typeof(height)=='undefined'){var height=700;}
  WThema = window.open(url,'AuswahlThema','width='+width+',height='+height+',scrollbars,resizable,dependent=yes,left=100,top=0');

}

function MouseOverTopMenu(Item) 
{
		var MenuItem = document.getElementById(Item);
		MenuItem.style.cursor= "hand"
		MenuItem.style.backgroundColor= "#5797D6"
		//MenuItem = document.getElementById('a.'+Item);
		//MenuItem.style.color= "#0066CC";
}

function MouseOutTopMenu(Item) 
{
		var MenuItem = document.getElementById(Item);
		MenuItem.style.backgroundColor= "#0066CC"
		//MenuItem = document.getElementById('a.'+Item);
		//MenuItem.style.color= "#ffffff";
}

function MouseOverMenu(Item) 
{
		var MenuItem = document.getElementById(Item);
		MenuItem.style.cursor= "hand"
		MenuItem.style.backgroundColor= "#C9D0AF"
}function MouseOutMenu(Item) 
{
		var MenuItem = document.getElementById(Item);
		MenuItem.style.backgroundColor= "#ddeca9"
}

function ShowPrintContent(){
	try{
	i4mElement=document.getElementById('root');
	if(i4mElement!=null){i4mElement.style.display="none";}
	if(i4mElement!=null){document.write('<table width=627 border=0 cellspacing=0 cellpadding=0><tr><td align=left><img src=/pfaffenhofen/system/images/head_print.jpg></td></tr>');}
	i4mElement=document.getElementById('content');
	if(i4mElement!=null && i4mElement.style.display!='none'){document.write('<tr><td>'+i4mElement.innerHTML+'</td></tr></table>');}
	}catch(e){}
	window.print();
}

function searchcheck(f){ 
	var suchstring;
	if(f.search.value==''){
		alert('Sie müssen einen Suchbegriff eingeben');
		return(false);  
	}else{
		suchstring='@Contents '+ f.search.value.replace(/\s/ig,' AND ');
		suchstring = suchstring.toLowerCase();
		suchstring = suchstring.replace("ü","ue");
		suchstring = suchstring.replace("ö","oe");
		suchstring = suchstring.replace("ä","ae");
		suchstring = suchstring.replace("ß","ss");		
		f.searchstring.value=suchstring;
		return(true);
	}
}

function ShowPrettyPrintContent(css, banner)
{
	try
	{
		var rootElement=document.getElementById("root");	
		var headlineElement = document.getElementById("headline");
		var contentElement=document.getElementById("content");
		if(rootElement!=null)
		{
			rootElement.style.display="none";
			document.write("<link rel='stylesheet' type='text/css' href='" + css + "'/>");
			document.write("<table style='width:627px; margin:10px' id='print'><tr><td align='left'><img src='" + banner + "'></td></tr>");
		}
		
	
		if(contentElement!=null && headlineElement !=null && contentElement.style.display!='none')
		{
			var heute = new Date();
			document.write("<tr><td><h3>" + innerTextValue(headlineElement) + "</h3></td></tr>\n");			
			document.write("<tr><td>" + innerHtmlValue(contentElement) + "</td></tr>\n");
			document.write("<tr><td style='font-size:small; font-style:italic; border-top:1px solid #eee'> Ausdruck vom: " + datum() + " (" + window.location.hostname + window.location.pathname + ")</td></tr></table>\n");
		}
	}catch(e){}
	window.print();
}

function innerTextValue(element)
{
	if(document.all)
	{
    	return element.innerText;
	} 
	else
	{
		return element.textContent;
	}
}

function innerHtmlValue(element)
{
    	return element.innerHTML;
}