
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();
        }
    }

}


function insertFlash(i_minVersion, i_path, i_name, i_width, i_height,i_bgcolor, i_fb,i_link,i_usemap) {
  if (isFlash(i_minVersion) && i_path.length>1){
   if(i_link){
     i_link="?xmlpath="+escape(i_link);
  var linkarray=i_link.split("/");
  i_link=linkarray.join("%2F");
     i_path=i_path+i_link;
   }

  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
  document.write(' codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"');
  document.write(' ID="' + i_name + '" WIDTH="' + i_width + '" HEIGHT="' + i_height + '">');
  document.write(' <PARAM NAME=movie VALUE="' + i_path +'"> ');
  document.write(' <PARAM NAME=quality VALUE=high> ');
  document.write(' <PARAM NAME=menu VALUE=false> ');
  document.write(' <PARAM NAME=bgcolor VALUE=#' + i_bgcolor + '> ');
  document.write('<EMBED SRC="' + i_path +'"');
  document.write(' NAME=' + i_name + ' swLiveConnect="TRUE" WIDTH="' + i_width + '" HEIGHT="' + i_height + '"');
  document.write(' QUALITY="high" MENU="false" BGCOLOR="#' + i_bgcolor + '"');
  document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
  document.write('</EMBED>');
  document.write('</OBJECT>');
 }else {document.write('<img src="' + i_fb+'" width="'+i_width+'" height="'+i_height+'" border="0" usemap="#'+i_usemap+'"><br>');
 
 }
 
}
function isFlash(inVersion){
 FlashMode =0;
 if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
  if (navigator.plugins && navigator.plugins["Shockwave Flash"] && (versionIndex = navigator.plugins["Shockwave Flash"].description.indexOf(".")) != - 1) {
   var versionString = navigator.plugins["Shockwave Flash"].description.substring(versionIndex-1, versionIndex);
   versionIndex = parseInt( versionString );
   if ( versionIndex >= inVersion ) {
     FlashMode = 1;
   }
  }
 }
 else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
    && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
  theStr='FlashMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+inVersion+'"))) \n';
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write(theStr);
  document.write('</SCRIPT\> \n');
   
 }
 return FlashMode;
}

