function LoadGallery(Pfad,Bild,taal){
	openBrWindow('Gallery.asp?taal=' + taal + '&amp;G=' + Pfad + '&amp;Bild=' + Bild,Pfad,'status=no,scrollbars=no,resizable=no,width=1024,height=800')
}
function getWindowHeight() 
{
     var wh = (typeof(window.innerHeight)=='number')?window.innerHeight:(document.documentElement && document.documentElement.clientHeight)?document.documentElement.clientHeight:(document.body && document.body.clientHeight)?document.body.clientHeight:0;
     var ww = (typeof(window.innerWidth)=='number')?window.innerWidth:(document.documentElement && document.documentElement.clientWidth)?document.documentElement.clientWidth:(document.body && document.body.clientWidth)?document.body.clientWidth:0;
     return {h:wh, w:ww};
}


function setMain() 
{
	
	if (document.getElementById) 
	{
		var windowHeight = getWindowHeight();
		if (windowHeight.h > 0) 
		{
		var DivInhalt = document.getElementById('inhalt');

			if (document.getElementById('endTeaser') ){
				if ((DivInhalt.offsetHeight+270)<windowHeight.h )
				{
					//document.getElementById('endTeaser').style.top = ((windowHeight.h) - 265) + 'px';
					
				}
			}
		}
	}
	if (document.getElementById('endTeaser'))
	{
	document.getElementById('endTeaser').style.visibility = 'visible';
	}
}
window.onload = onresize = function() {

setMain();
}
function NaviSelector(NaviAn){
	var eleU;
	var mainH;
	for (var i = 0; i<15; i++) {
		eleU = 'meNav'+i;
		mainH = 'Hmenu' + i;
		if (document.getElementById('meNav'+i)){
			var cNavMenu = document.getElementById(eleU);
			var cNavMainMenu = document.getElementById(mainH);
			if (i != NaviAn){
				cNavMenu.style.display = 'none';
			}else{
				cNavMenu.style.position = 'absolute';
				//cNavMenu.style.top = '160px';
				
				if (navigator.userAgent.indexOf("MSIE") > -1)
				{
					cNavMenu.style.top = '160px';
				}
				else
				{
					cNavMenu.style.top = '160px';
				}				
				cNavMenu.style.zIndex = '9999';
				cNavMenu.style.whiteSpace ='nowrap';
				//if ((cNavMainMenu.offsetLeft +13+168)>550){
				//	cNavMenu.style.left = cNavMainMenu.offsetLeft + cNavMainMenu.offsetWidth -163  + 'px';
				//}else{
					cNavMenu.style.left = cNavMainMenu.offsetLeft +8 + 'px';
				//}
				cNavMenu.style.display= '';
				
			}
		}
	}
	NaviSubSelector(-1);
}
function NaviSubSelector(NaviAn){
	
	var eleU;
	var mainH;
	for (var i = 0; i<100; i++) {
		eleU = 'HSubmenu'+i;
		mainH = 'SubA' + i;
		if (document.getElementById('SubA'+i) && document.getElementById(eleU)){
			var cNavMenu = document.getElementById(eleU);
			var cNavMainMenu = document.getElementById(mainH);
			if (i != NaviAn){
				cNavMenu.style.display = 'none';
			}else{
				cNavMenu.style.position = 'absolute';
				cNavMenu.style.top = '15px';
				cNavMenu.style.zIndex = '9999';
				cNavMenu.style.whiteSpace ='nowrap';
				//cNavMenu.style.left = '0px';
				//if ((cNavMainMenu.offsetLeft +13+168)>550){
				//	cNavMenu.style.left = cNavMainMenu.offsetLeft + cNavMainMenu.offsetWidth -163  + 'px';
				//}else{
					cNavMenu.style.left = cNavMainMenu.offsetLeft+ 'px';
				//}
				//cNavMainMenu.innerHTML = cNavMainMenu.offsetLeft + '- ' + cNavMainMenu.innerHTML;
				
				cNavMenu.style.display= '';
				
			}
		}
	}
}

//

//preloading images

var Pictures = new Array(
	"art/bgtop2.gif",
	"art/bgtop1.gif"
	
);


function loadpics(){
	preImages = new Array();
	for (i = 0; i < Pictures.length; i++){
		preImages[i] = new Image();
		preImages[i].src = Pictures[i];
	}
}
loadpics();

var maxW,maxH,fromX,fromY,toX,toY,adjX,adjY,zBox,zStep=0,zLink,zNew;



function zoomBox(evt,zlink,maxw,maxh,tox,toy) {

	if (arguments.length > 2) zNew=1;

	scrollH=(window.pageYOffset!=null)?window.pageYOffset:document.body.scrollTop;

	maxW=maxw?maxw:window.innerWidth?innerWidth:document.body.clientWidth;

	maxH=maxh?maxh:window.innerHeight?innerHeight:document.body.clientHeight;

	toX=tox?tox:0;

	toY=(toy?toy:0)+scrollH;

	fromX=evt.pageX?evt.pageX:evt.clientX;

	fromY=(evt.pageY?evt.pageY:evt.clientY)+(document.all?scrollH:0);

	adjX=toX+evt.screenX-fromX;

	adjY=toY+evt.screenY-fromY;

	if (document.createElement && document.body.appendChild && !zBox) {

		zBox=document.createElement("div");

		zBox.style.position="absolute";

		document.body.appendChild(zBox);

	} else if (document.all && !zBox) {

		document.all.outerHTML+="<div id=zBoxDiv style=position:absolute></div>";

		zBox=document.all.zBoxDiv;

	} else if (document.layers && !zBox) {

		zBox=new Layer(maxW);

		zBox.style=zBox;

	}

	zLink=zlink;

	doZoom();

}



function doZoom() {

zStep+=1;

zPct=(10-zStep)/10

	if (document.layers) {

		zBox.moveTo(toX+zPct*(fromX-toX),toY+zPct*(fromY-toY));

		zBox.document.open();

		zBox.document.write("<table width="+maxW*(1-zPct)+" height="+maxH*(1-zPct)+" border=2 cellspacing=0><tr><td></td></tr></table>");

		zBox.document.close();

		} else {

		zBox.style.border="2px solid #999999";

		zBox.style.left=toX+zPct*(fromX-toX);

		zBox.style.top=toY+zPct*(fromY-toY);

		zBox.style.width=maxW*(1-zPct);

		zBox.style.height=maxH*(1-zPct);

	}

	zBox.style.visibility="visible";

	if (zStep < 10) setTimeout("doZoom("+fromX+","+fromY+","+toX+","+toY+")",30);

	else {

		zBox.style.visibility="hidden";

		zStep=0;

		if (zLink && !zNew) location.href=zLink.href;

		else if (zLink && zNew) {

			var w=window.open(zLink.href,"","width="+maxW+",height="+maxH+",left="+adjX+",top="+adjY+"");

			zNew=null;

		}

	}

}

			function checkAll(theForm,boxname) {
			    for (i=0,n=theForm.elements.length;i<n;i++)
				if (theForm.elements[i].name.indexOf(boxname) !=-1)
				{
				    if (theForm.elements[i].checked){
					theForm.elements[i].checked = false;
					}
				    else{
					theForm.elements[i].checked = true;
				    }
				}
			}


			
			
				function clearstatus()  {
					self.status =' ';
					return true;
				}
				clearstatus();

				function CheckForm(actione,was) {
						document.eingabe.action = actione;
						var agree=confirm('Möchten Sie  ' + was + ' wirklich löschen?');

						if (agree){
							parent.location.href=actione;
							return true ;
							}
						else{
							//return true ;
						}
				}


				function CheckFormSubmit(actione,was) {
						document.eingabe.action = actione;
						var agree=confirm('Möchten Sie  ' + was + '  wirklich löschen?');

						if (agree){
							document.eingabe.action = actione;
							document.eingabe.submit();

							//parent.content.location.href=actione;
							//return true ;
							}
						else{
							//return true ;
						}
				}
			
			
			
			
			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();
			}
			MM_reloadPage(true);

			function MM_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 MM_showHideLayers() { //v6.0
			  var i,p,v,obj,args=MM_showHideLayers.arguments;
			  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
			    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
			    obj.visibility=v; }
			}


			function MM_showHideLayersX(name) {
			parent.TopContent.document.all['' + name].style.visibility = "hide";
			}




			var ok=0;if ((parseInt(navigator.appVersion) > 3) || ((parseInt(navigator.appVersion) == 3) && (navigator.appName=="Netscape"))){ok=1;}
			function change(name, newpic){
				if (ok==1){
					this.document[name].src=newpic;
					return true;
				}
				}
				
		
				
				
				
				
				
				
			var restoreArray = new Array;
			var restoreCount = 0;
			var restoreTimer = 0;
			function  restoreImages  (DelaySeconds)
			 {
			 if  (restoreTimer > 0)
			     {
			     clearTimeout (restoreTimer);
			     restoreTimer = 0;
			     }
			 if  ((restoreArray == null) || (restoreCount < 1))  return;
			 if  (DelaySeconds > 0)
			     {
			     restoreTimer = window.setTimeout ('restoreImages ();', DelaySeconds * 1000);
			     return;
			     }
			 while (restoreCount > 0)
			     {
			     imageObject = restoreArray [--restoreCount];
			     fileName = restoreArray [--restoreCount];
			     if  ((imageObject != null) && (fileName != null) && (fileName != ''))  imageObject.src = fileName;
			     }
			 }

			function  replaceImage  (ImageName, FileName)
			 {
			 imageObject = eval ('document.' + ImageName);
			 if  ((imageObject == null) || (FileName == null) || (FileName == ''))  return;
			 if  (restoreArray != null)
			     {
			     restoreArray [restoreCount++] = imageObject.src;
			     restoreArray [restoreCount++] = imageObject;
			     }
			 imageObject.src = FileName;
			 }

				
		
			function CheckFormSubmitNachricht(actione,was) {
					document.eingabe.action = actione;
					var agree=confirm(was);

					if (agree){

						document.eingabe.action = actione;
						document.eingabe.submit();			
					
						//parent.content.location.href=actione;
						//return true ;
						}
					else{
						//return true ;
					}
			}				
			
			function CheckClick(actione,was) {
					document.eingabe.action = actione;
					var agree=confirm(was);

					if (agree){

						parent.location.href=actione;
						return true ;
						}
					else{
						//return true ;
					}
			}			
			
			function clickCategory(CatidStr)
			{
			  var txtObj = document.all("t_" + CatidStr);
			  var imgObj = document.all("i_" + CatidStr);

			  if (txtObj.style.display == 'none')
			  {
				txtObj.style.display = '';
				
			  }
			  else
			  {
				txtObj.style.display = 'none';
				
			  }
			}
			
			
			
			function sendForm() {
				document.eingabe.submit();
			}
			function sendFormTaget(wohin,tar) {
				document.eingabe.action = wohin;
				document.eingabe.target = '_self';
				document.eingabe.submit();
			}		
			function sendFormDahin(wohin){
				document.eingabe.action = wohin;
				document.eingabe.submit();
			}
			
			function SendFormInklusiveSelectingDahin(wohin){
				for(i = 0; i < document.eingabe.rid2.options.length; i++) {
					document.eingabe.allewerten.value = document.eingabe.allewerten.value + ',' + document.eingabe.rid2.options[i].value
					}
				document.eingabe.action = wohin;
				document.eingabe.submit();
			}			
			
			function move(fbox, tbox) {
				var arrFbox = new Array();
				var arrTbox = new Array();
				var arrLookup = new Array();
				var i;
				
				for (i = 0; i < tbox.options.length; i++) {
					arrLookup[tbox.options[i].text] = tbox.options[i].value;
					arrTbox[i] = tbox.options[i].text;
				}

				var fLength = 0;
				var tLength = arrTbox.length;

				for(i = 0; i < fbox.options.length; i++) {
					arrLookup[fbox.options[i].text] = fbox.options[i].value;
					if (fbox.options[i].selected && fbox.options[i].value != "") {
						arrTbox[tLength] = fbox.options[i].text;
						tLength++;
						}
					else {
						arrFbox[fLength] = fbox.options[i].text;
						fLength++;
					}
				}

				arrFbox.sort();
				arrTbox.sort();
				fbox.length = 0;
				tbox.length = 0;

				var c;

				for(c = 0; c < arrFbox.length; c++) {
					var no = new Option();
					no.value = arrLookup[arrFbox[c]];
					no.text = arrFbox[c];
					fbox[c] = no;
				}
				for(c = 0; c < arrTbox.length; c++) {
					var no = new Option();
					no.value = arrLookup[arrTbox[c]];
					no.text = arrTbox[c];
					tbox[c] = no;
				}
			}


			function SendFormInklusiveSelecting(){
				for(i = 0; i < document.eingabe.rid2.options.length; i++) {
					document.eingabe.allewerten.value = document.eingabe.allewerten.value + ',' + document.eingabe.rid2.options[i].value
					}
				document.eingabe.submit();
			}

			function SendFormInklusiveSelectingPakete(){
				for(i = 0; i < document.eingabe.rid2.options.length; i++) {
					document.eingabe.allewertenModul.value = document.eingabe.allewertenModul.value + ',' + document.eingabe.rid2.options[i].value
					}
				for(i = 0; i < document.eingabe.rid4.options.length; i++) {
					document.eingabe.allewertenKunde.value = document.eingabe.allewertenKunde.value + ',' + document.eingabe.rid4.options[i].value
					}					
				document.eingabe.submit();
			}

			function loadseit(){
				var fill = document.eingabe.m_id.options[document.eingabe.m_id.selectedIndex].value;
				var innachricht = document.forms[0].i_text.value;

				if (fill != '0') {
					document.forms[0].i_text.value = innachricht + fill;
					document.forms[0].i_text.focus();
					}
				}
				
			function loadModul(wohin){
				var fill = document.eingabe.m_id.options[document.eingabe.m_id.selectedIndex].value;
				

				if (fill != '0') {
					document.eingabe.action = wohin + '?ModulleAdd=' + fill;
					document.eingabe.submit();
					}
				}				
			function newWindow(file,window,inf) {
			    msgWindow=open(file,window,inf);
			    if (msgWindow.opener == null) msgWindow.opener = self;
			}

			function openBrWindow(theURL,winName,features) { //v2.0
			  //window.open(theURL,winName,features);
			    msgWindow=open(theURL,winName,features);
			    if (msgWindow.opener == null) msgWindow.opener = self;			  
			}
			
			function OpenWindowSendTag(theURL,winName,features,tags){
			  theURL = theURL + "?modulinfon=" + tags;
			  window.open(theURL,winName,features);
			}
			

			function remoteSuche(url,tags){


				if (opener && !opener.closed)
					opener.location.href = '../../menu/menulinks/menulinks.asp?ZuUrl=' + url + '&menu=' + tags ;
				else {
					alert ('Das hauptfenster ist zu bitte gehen Sie zu: http://www.lbhh.de/');
				}
			}



			function Eingabe1(InputStr,laenge,Counterobject) {
				var TempCount
				TempCount = Counterobject + '';
					StrLen = InputStr.value.length
					if (StrLen == 1 && InputStr.value.substring(0,1) == " ") {
					InputStr.value = ""
					StrLen= 0
				}
					else {
					CharsLeft = laenge - StrLen
				}
			  document.eingabe.elements[TempCount].value = CharsLeft
			}

			function OnKeyDownInTextArea( item, maxlen ) {
					if ( item.value.length > maxlen - 1 ) {
							if ( event.keyCode != 8 && event.keyCode <= 32 || event.keyCode > 46 ) {
									event.returnValue = false;
							}
					}
			}				

