isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;
ie_hack=false;
hasOpened=new Array();
ddxoff=-100;
ddyoff=10;
mscLeft=0;
mscTop=0;
nowX=350;
nowY=300;

function getElem(str){ 
	 return isIE ? document.all[str] : document.getElementById(str);
}

function decbug(str){
	var ggg=getElem("decbug");
	if("undefined"==typeof(ggg))return;
	ggg.innerHTML=ggg.innerHTML +"**" +str;
}
function decbug_clear(){
	var ggg=getElem("decbug");
	if("undefined"==typeof(ggg))return;
	ggg.innerHTML="DECBUG CLEARED<br />";
}
function ddInit(e){
	
	topDog=isIE ? "BODY" : "HTML";
	offsetx=parseInt(isIE ? event.clientX : e.clientX) + ddxoff;
	offsety=parseInt(isIE ? event.clientY : e.clientY) + ddyoff;
	
	
	if("undefined"!=typeof(document.body.scrollLeft)){
		mscLeft=parseInt(document.body.scrollLeft);
		mscTop=parseInt(document.body.scrollTop);

		offsetx+=mscLeft;
		offsety+=mscTop;

//decbug(' OK ('+offsety +'/'+ document.body.scrollTop+')');
}else{
//decbug(' ERR ');
}



	aktElem=isIE ? event.srcElement : e.target;

//	decbug("#Start Tag Name:#"+aktElem.tagName+"#");
	
	if( aktElem.tagName == "BODY" ||  aktElem.tagName ==  "HTML")return;
	while ( aktElem.id.substring(0,3)!="pop" && aktElem.tagName!=topDog){
		aktElem=isIE ? aktElem.parentElement : aktElem.parentNode;
	}  
	whichDog=aktElem;
//decbug("!"+aktElem.tagName+"!"+aktElem.id+"!");

	aktElem=isIE ? event.srcElement : e.target;  
	var mytest="title"+whichDog.id;

//decbug("!SUCHE"+mytest+"!");
if(mytest=="title")return;
	while ( aktElem.id != mytest && aktElem.tagName!=topDog  ){
		aktElem=isIE ? aktElem.parentElement : aktElem.parentNode;
	}
//decbug("§"+aktElem.tagName+"§"+aktElem.id+"§");

	if ( aktElem.id==mytest	&&  whichDog.id.substring(0,3)=="pop"){
	    nowX=parseInt(whichDog.style.left);
		nowY=parseInt(whichDog.style.top);
		whichDog.style.left= nowX+'px';
		whichDog.style.top= nowY+'px';
		ddElementID=aktElem.id;
		ddEnabled=true;
		document.onmousemove=dd;

//		decbug("##"+mytest+"##"+whichDog.id+"##");
	}
	
	//alert("#"+mytest+"# #"+whichDog.id+"#");
}
function dd(e){
 if (!ddEnabled) return;
	var x=parseInt(isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx) ;  
	var y=parseInt(isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety) ;  

	if("undefined"!=typeof(document.body.scrollLeft)){
		mscLeft=parseInt(document.body.scrollLeft);
		mscTop=parseInt(document.body.scrollTop);
	}
x+=mscLeft;
y+=mscTop;

x+=ddxoff;
y+=ddyoff;



	x+="px";
	y+="px";
	whichDog.style.left=x;
	whichDog.style.top=y;
	if(isIE)iehackon(whichDog);
	return false;  
}
function hideMe(str){
	whichDog=isIE ? document.all[str] : document.getElementById(str);
	if (isIE||isNN) {
		whichDog.style.visibility="hidden";
		whichDog.style.display="none";
	}
	else if (isN4) {
		document[str].visibility="hide";
		document[str].display="none";
	}
	if(isIE)iehackoff();
	hasOpened[str]="hidden";
        
}
function hideAllExceptMe(str){
	for(var i in hasOpened){
		if(i==str)continue;
		if(hasOpened[i]=="ok"){hideMe(i);}
	}
}
function showMe(str){
  if(document.getElementById('zaehler')){
	  document.getElementById('zaehler').src="../images/statistik_popup_Renovierung.gif"+"?op="+str;
  }
  hideAllExceptMe(str);
  whichDog=isIE ? document.all[str] : document.getElementById(str);
  if (isIE||isNN) {
	  whichDog.style.visibility="visible";	  
	  whichDog.style.display="block";
  }
  else if (isN4){
	  document[str].visibility="show";
	  document[str].display="block";
  }

	if("undefined" == typeof(hasOpened[str]) ){
		hasOpened[str]="ok";
		whichDog.style.zIndex = '100';
		whichDog.style.position = "absolute";
		
		var pageX = 580;
		var pageY = (document.all)?document.body.offsetHeight:window.innerHeight;
		var pageY = 800;
		
		var myObj = document.getElementById(str);
		var objW = myObj.offsetWidth;
		var objH = myObj.offsetHeight;
		nowX = (pageX/2)-(objW/2);
		nowY = (pageY/2)-(objH/2);
		
		if ( nowY < 0 ) {
			nowY = 0;
		}
				
		whichDog.style.left = nowX+'px';
		whichDog.style.top = nowY+'px';
	}
	

	
	
	
	hasOpened[str]="ok";
   if(isIE)iehackon(whichDog);

}
function iehackon(whichDog){
	ie_hack=getElem("IEHACK");
	if ("undefined" == typeof(ie_hack) ) return;
//	if ("undefined" == typeof(whichDog) ) return;
	ie_hack.style.visibility='hidden';
	ie_hack.style.display='none';
	
	var testwidth=100;
	if("undefined" != typeof(whichDog.clientWidth) && !isNaN(parseInt(whichDog.clientWidth))){testwidth = whichDog.clientWidth;}
	if("undefined" != typeof(whichDog.style.width) && !isNaN(parseInt(whichDog.style.width))){testwidth = whichDog.style.width;}
	testwidth=parseInt(testwidth);
	if(isNaN(testwidth))return;
	

	var testheight=100;
	if("undefined" != typeof(whichDog.clientHeight) && !isNaN(parseInt(whichDog.clientHeight))){testheight = whichDog.clientHeight;}
	if("undefined" != typeof(whichDog.style.height) && !isNaN(parseInt(whichDog.style.height))){testheight = whichDog.style.height;}
	testheight=parseInt(testheight);
	if(isNaN(testheight))return;
	

//decbug(""+whichDog.style.left + " "+whichDog.style.top + " "+testwidth + " "+testheight + " "+typeof(whichDog));

testwidth+=2;
testheight+=2;

	ie_hack.style.left=parseInt(whichDog.style.left)+"px";
	ie_hack.style.top=parseInt(whichDog.style.top)+"px";
	
	ie_hack.style.width=parseInt(testwidth)+"px";
	ie_hack.style.height=parseInt(testheight)+"px";
	ie_hack.style.visibility='visible';

}
function iehackoff(){
	ie_hack=getElem("IEHACK");
	if ("undefined" == typeof(ie_hack) ) return;
	ie_hack.style.visibility='hidden';
	ie_hack.style.display='none';
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");


function druckMe(str){
	var mdr=getElem(str);

	var out=window.open('','DRUCK','width=640,menubar=yes,resizable=yes,scrollbars=yes');
	//alert(mdr.innerHTML);
	//alert(out.innerHTML);
	

out.document.write('<html>'+"\n");
out.document.write('<head>'+"\n");
out.document.write('<title> Wellhoefer / Druck </title>'+"\n");
out.document.write('  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />'+"\n");
out.document.write('  <link rel="stylesheet" type="text/css" href="../css/basic.css" />'+"\n");
out.document.write('  </head>'+"\n");
out.document.write('<body>'+"\n");
out.document.write('<div id="print">'+"\n");
//out.document.write('<div class="tools"><p><a href="javascript:window.print();void(0);">Drucken</a>&nbsp;|&nbsp;<a href="javascript:close()">Schlie&szlig;en</a></p></div>'+"\n");
out.document.write('<div class="tools"><p><a href="#" onclick="window.print();return false">Drucken</a>&nbsp;|&nbsp;<a href="javascript:close()">Schlie&szlig;en</a></p></div>'+"\n");
out.document.write('<hr />'+"\n");
//out.document.write('  <div id="service">slot_service</div>'+"\n");
out.document.write('  <div id="content">'+"\n");
  
out.document.write(mdr.innerHTML);

out.document.write('  </div>'+"\n");
out.document.write('<hr />'+"\n");
out.document.write('<div class="footer"><p>&copy; 2005-2010 Wellhoefer. Alle Rechte vorbehalten</p></div>'+"\n");
out.document.write('</div>'+"\n");
out.document.write('</body>'+"\n");
out.document.write('</html>'+"\n");
out.document.close();

}


//vorschau.js Vorschau Bild
function vorschau_show(id){
	// 17.01.2006  window.clearTimeout(vtime);
	if("undefined" != typeof(vtime)){
		window.clearTimeout(vtime);
	}
	var mm=document.getElementById('vorschauimg');
	mm.src="../mod/bilder/bilder.php?id="+id;
}
function vorschau_init(){
	vtime=window.setTimeout("vorschau_init_ok()",160);
}

function vorschau_init_ok(){
	var mm=document.getElementById('vorschauimg');
	mm.src="../mod/bilder/bilder.php?id="+akt_vorschau_id;
}

<!--//--><![CDATA[//><!--
  sfHover = function() {
	if(document.getElementById("levelone")){
    var sfEls = document.getElementById("levelone").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
      sfEls[i].onmouseover=function() {
        this.className+=" sfhover";
      }
      sfEls[i].onmouseout=function() {
        this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
      }
    }
	}
  }
  if (window.attachEvent) window.attachEvent("onload", sfHover);

  sfHover = function() {
	if(document.getElementById("leveltwo")){
    var sfEls = document.getElementById("leveltwo").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
      sfEls[i].onmouseover=function() {
        this.className+=" sfhover";
      }
      sfEls[i].onmouseout=function() {
        this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
      }
    }
	}
  }
  if (window.attachEvent) window.attachEvent("onload", sfHover);

	function overLevelOne(){
		if(document.getElementById("lo_sel_ul")) document.getElementById("lo_sel_ul").className="off";
	}
	function outLevelOne(){
		if(document.getElementById("lo_sel_ul")) document.getElementById("lo_sel_ul").className="on";
	}

	function overLevelTwo(){
		if(document.getElementById("lt_sel_ul")) document.getElementById("lt_sel_ul").className="off";
	}
	function outLevelTwo(){
		if(document.getElementById("lt_sel_ul")) document.getElementById("lt_sel_ul").className="on";
	}


  //--><!]]>