function scroll(targ){

   var n = 0;
	 var y = 0;
	var yd = 0;
		 
  if (self.innerHeight)
    {
			y  = self.innerHeight;
			yd = self.pageYOffset;
    }
  else if (document.documentElement && document.documentElement.clientHeight)
    {
			y  = document.documentElement.clientHeight;
			yd = document.documentElement.scrollTop;
    }
 else if (document.body)
    {
			y  = document.body.clientHeight;
			yd = document.body.scrollTop;
    }

if (y > yd) return;

while ( (n * 5) < targ ) 
		{
		 n = n + 1;
  	 setTimeout("scrollBy(0, 5)", 1);
	 }
}

function clHoch()
{
    var y;
		y = 0;
    
    if (self.innerHeight) // all except Explorer
    {
			y  = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
    {
			y  = document.documentElement.clientHeight;
    }
    else if (document.body) // other Explorers
    {
			y  = document.body.clientHeight;
    }

    return y;
}

function searchForText(toFind) {

	if( !toFind ) return;

    toFind =  unescape(toFind);

    frameToSearch = this;
	if( frameToSearch.focus ) { frameToSearch.focus(); }
	
	if( window.find ) {
		if( document.layers ) {
			var ifFound = frameToSearch.find( toFind, false, false );     
		} else {
			var ifFound = frameToSearch.find( toFind, false, false, true, false, true, false );     
		}

	} else if( frameToSearch.document.body && frameToSearch.document.body.createTextRange ) {
		if( frameToSearch.document.selection && frameToSearch.document.selection.type != 'None' ) {
			var theRange = frameToSearch.document.selection.createRange();
			theRange.collapse( false );
		} 
			else {
			var theRange = frameToSearch.document.body.createTextRange(); 
		}
		var ifFound = theRange.findText( toFind );
		if( ifFound ) { theRange.select(); }
    
	} else {
		alert ( 'Bitte benutzen Sie die Suchfunktion Ihres Browsers.' );
	}
	if( !ifFound ) { alert ( 'Suchtext nicht gefunden: ' + toFind ); }
	else scroll(clHoch()-100);
	//else {scrollBy(0,clHoch()-100);}
}

function gQV(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  }
}

var myI;

function wo(string) {

		obj = parent.oben.document.getElementById("anzeige");
		obj.innerHTML = string;

    if (string.length > 2) {
			string = "&nbsp;-&nbsp;" + string;
			}
		else return;
		
		obj.innerHTML = string;
		obj.style.left=300;
		obj.style.color="#000000";
		myI = setInterval("moveObj(obj)",5);

return false;
}

	
function moveObj(obj) {
	 var x = obj.style.left;
	 var ix = x.substring(0,3) - 2;
	 var cx = (ix - 260) * 1.2;
	 if (ix < 261) clearInterval(myI);
	 obj.style.left = ix +"px";
}

function parseHTMLInputs() {
		var button = /button|reset|submit/i;
		var inputs = document.getElementsByTagName('input');
		var l = inputs.length-1;
		
		for(var input,type,i=l; i>=0; i--) {
			input = inputs.item(i);
			if(input && button.test(input.type)) {
				type = button.exec(input.type)[0];
				replaceHTMLInput(input, type);
			}
		}
}

function replaceHTMLInput(input, type) {
var ai;
		var form = input.form;
		var link = document.createElement('a');
		var span = document.createElement('span');
		span.appendChild(document.createTextNode(input.value));
		link.appendChild(span);
		link.setAttribute('href', '#');
		input.parentNode.replaceChild(link, input);

		switch(type) {
			case 'submit':
				link.onclick = function() {
     		if(!form.onsubmit || form.onsubmit()) form.submit();
				}
			break;
		}
}

function st() {
	 	suchtext=document.getElementById('suche').value;
	 	document.getElementById('suche').value='';
		searchForText(suchtext);
}

