
var tickspeed=5000; // 2000=2 seconds) 
var selectedDiv=0;
var totalDivs=0;


function contractall(){ 
	var inc=0 
	while (document.getElementById("dropmsg"+inc)){ 
		document.getElementById("dropmsg"+inc).style.display="none" 
		inc++ 
	}
}

function expandone(){ 
	var selectedDivObj=document.getElementById("dropmsg"+selectedDiv) 
	contractall() 
	selectedDivObj.style.display="block" 
	selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0 
	setTimeout("expandone()",tickspeed) 
}

function startscroller(){ 
	while (document.getElementById("dropmsg"+totalDivs)!=null) 
	totalDivs++ 
	expandone()
}

function MM_popupMsg(msg) { //v1.0
	alert(msg);
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}


function MM_openBrWindow(theURL,winName,features) { 
	window.open(theURL,winName,features);
}

function MM_popupMsg(msg) { //v1.0
	alert(msg);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function FindObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function ChangeProp(objName,x,theProp,theValue) { //v6.0
  var obj = FindObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
  	var zustand = eval("obj."+theProp);
	if ((zustand == "") || (zustand == "block")) {
		eval("obj."+theProp+"='none'");
	} else if (zustand == "none") {
		eval("obj."+theProp+"='block'");
	}
  }
}

function foto_verkleinern() {
  var i;
  var dok = "";
  var hoehe;
  if (document.URL.length > 60){
       for(i=0;i<60;++i){
          dok=dok+document.URL.charAt(i);
       }
       if (dok == "http://www.troisdorf.de/sites/presse/presse_ansicht_plus.asp"){
           if ( document.pressefoto.width > 420 ) {
		            document.pressefoto.width = 420;
					hoehe = 420 * document.pressefoto.height / document.pressefoto.width;
					document.pressefoto.height = hoehe;
					//alert("Das ist "+document.pressefoto.width+hoehe);
		   }
       }
  }
}

function link(url)
{
	window.location.href=url;
}

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 + " OR @key-words " + 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 ShowPrintContent(){
	try{
	i4mElement=document.getElementById('root');
	if(i4mElement!=null){i4mElement.style.display="none";}
	if(i4mElement!=null){document.write('<table width=760 border=0 cellspacing=0 cellpadding=0><tr><td align=left><img src=/troisdorf/system/images/head_print.gif></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();
}

