function zoomImage(inUrl,inW,inH){
        theTitel="BSR";
        theOptions="width="+inW+", height="+inH;
        window.open(inUrl,theTitel,theOptions);
}



function bcSubMenu(){
 this.l=-100;
 this.t=-100;
 this.r=-100;
 this.b=-100;
 this.id="0";
}

var curBcSubMenu= new bcSubMenu();

function checkMove(e){
 if(curBcSubMenu.id !="0"){
   var x=(document.all)?window.event.clientX+document.body.scrollLeft:e.pageX;

  var y=(document.all)?window.event.clientY+document.body.scrollTop:e.pageY;
  if (isInsideMenu(x,y)!=true){
   bcJsMenu(curBcSubMenu.id,false);
  }
 }
}

function isInsideMenu(x,y){
 return(x>=curBcSubMenu.l && x<=curBcSubMenu.r && y>=curBcSubMenu.t && y<=curBcSubMenu.b);
}

function isIEMac(){
	if(navigator.appVersion.indexOf("Macintosh")>-1){
		if(navigator.appName.indexOf("Explorer")>-1){
			return true;
		}
	}
}

function bcJsMenu(id,show){
	if(isIEMac()){return false;}
 	var evsrc=document.getElementById("bc_"+id);
 	var theSub=document.getElementById("bc_"+id +"_sub");
 	var hiddenSub=document.getElementById("hiddenSub_"+id);
 	if(show ){
  		if(curBcSubMenu.id !=id){bcJsMenu(curBcSubMenu.id,false);}
  			var l=getLeft(evsrc);
  			var t=getBottom(evsrc);
  
  			theSub.style.left=l;
  			theSub.style.top=t;
  
  			curBcSubMenu.l=l;
  			curBcSubMenu.t=getTop(evsrc);
  			if(getChildNodesCountByTyp(theSub,"table")<1){
   				getBcSubMenu(id,theSub);
   			}   
   			theSub.style.visibility="visible";  
    		curBcSubMenu.r=getRight(theSub);
  			curBcSubMenu.b=getBottom(theSub);
  			curBcSubMenu.id=id;
 		}else{
  			if(theSub){
   				theSub.style.visibility="hidden";
   				theSub.style.top=-1000;
   				curBcSubMenu.id="0";
  			}
 		}
 
	}
function getChildNodesCountByTyp(node,typ){
 var c=0;
 if(node.hasChildNodes()){
  var nc=node.childNodes.length;
  for(var i=0;i<nc;i++){
   if(node.childNodes[i].nodeName==typ.toUpperCase()){
    c+=1;
   }
  }
 }
 return c;
}
function getMenuItems(node,name){
 var Ar=new Array();
 if(node.hasChildNodes()){
  var nc=node.childNodes.length;
  for(var i=0;i<nc;i++){
   if(node.childNodes[i].nodeName=="DIV"){
    if(node.childNodes[i].id.indexOf(name)>-1){
     Ar[Ar.length]=node.childNodes[i];
    }
   }
  }
 }
 return Ar;
}
function getRight(l){
 var theLeft=getLeft(l);
 var theWidth=l.offsetWidth;
 return theLeft + theWidth;
}
function getBottom(l){
 var theTop=getTop(l);
 var theHeight=l.offsetHeight;
 return theTop + theHeight;
}
function getLeft(l){
  if (l.offsetParent) return (l.offsetLeft + getLeft(l.offsetParent));
  else return (l.offsetLeft);
}
function getTop(l){
  if (l.offsetParent) return (l.offsetTop + getTop(l.offsetParent));
  else return (l.offsetTop);
}

function doRolloverLm(inNr){
     if(document.getElementById){
        var obj=document.getElementById("mlItem_"+inNr);
        if(obj){
            if (obj.getAttribute("state")=="0"){
                obj.style.backgroundColor="#dee6e6";
    obj.setAttribute("state","2");
            }
        }
    }
}
function doRolloutLm(inNr){
     
    if(document.getElementById){
        var obj=document.getElementById("mlItem_"+inNr);
        if(obj){
            if (obj.getAttribute("state")=="2"){
                obj.style.backgroundColor="#edf1f0";
    obj.setAttribute("state","0");
            }
        }
    }
}

function doRolloverBcSm(inNr){
    if(event.srcElement) {
        var theId=event.srcElement.getAttribute("id");
		if(document.getElementById && theId !=""){
			if(document.getElementById(theId)){
        		var obj=document.getElementById(theId).parentNode;
        		if(obj){
            		if (obj.style.backgroundColor!="#546967"){
                		obj.style.backgroundColor="#94A4A2";
            		}
        		}
			}
     
            
    	} 
    }   
    
}
function doRolloutBcSm(inNr){
   if(event.srcElement) {
        var theId=event.srcElement.getAttribute("id");
		if(document.getElementById && theId !=""){
			if(document.getElementById(theId)){
	        	var obj=document.getElementById(theId).parentNode;
	        		if(obj){
	            		if (obj.style.backgroundColor !="#546967"){
	                		obj.style.backgroundColor="#667C7B";
	            		}
	        		}
	           }
	    } 
    }   
    
}





function doHighlights(inNr){
   if(document.getElementById){
        var obj=document.getElementById("mlItem_"+ inNr);
        if(obj){
            obj.style.backgroundColor="#ffffff";
            obj.setAttribute("state","1");
        }       
    } 
}

function doOnResize(){
    moveAgbDiv();
    if(document.getElementById){
        if(document.getElementById("karte")){
            doStandortKarte();
        }
    }

}