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_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

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 P7_getWD(tDim){ //v2.5 by PVII
 var sh=0,sw=0,rt=0;if(window.innerWidth){sh=window.innerHeight;sw=window.innerWidth;
 }else if(document.body){sh=document.body.clientHeight;sw=document.body.clientWidth;
 if(document.body.offsetHeight==sh&&document.documentElement&&document.documentElement.clientHeight){
  sh=document.documentElement.clientHeight;}
 if(document.body.offsetWidth==sw&&document.documentElement&&document.documentElement.clientWidth) {
 sw=document.documentElement.clientWidth;}}rt=(tDim=="width")?sw:sh;return rt;
}

function P7_getLDims(el) { //v2.5 by PVII
 var x,ll=0,tl=0,hh=0,ww=0,wx,g,gg;
 if((g=MM_findObj(el))!=null){gg=(document.layers)?g:g.style;ll=parseInt(gg.left);
 tt=parseInt(gg.top);if(isNaN(ll)){if(g.currentStyle){ll=parseInt(g.currentStyle.left);
 }else if(document.defaultView&&document.defaultView.getComputedStyle){
 ll=parseInt(document.defaultView.getComputedStyle(g,"").getPropertyValue("left"));
 }if(isNaN(ll)){ll=0;}}if(isNaN(tt)){if(g.currentStyle){tt=parseInt(g.currentStyle.top);
 }else if(document.defaultView&&document.defaultView.getComputedStyle){
 tt=parseInt(document.defaultView.getComputedStyle(g,"").getPropertyValue("top"));}if(isNaN(ll)){tt=0;}}
 if(document.all||document.getElementById){ww=parseInt(g.offsetWidth);hh=parseInt(g.offsetHeight);
 if(!ww){ww=parseInt(g.style.pixelWidth);if(!ww){ww=parseInt(g.style.width);}}if(!hh){
 hh=parseInt(g.style.pixelHeight);}if(g.hasChildNodes&&g.childNodes){for(x=0;x<g.childNodes.length;x++){
 wx=parseInt(g.childNodes[x].offsetWidth);if(wx>ww){ww=wx;}}}}else if(document.layers){
 ww=parseInt(g.clip.width);hh=parseInt(g.clip.height);}}var aR=[ll,tt,hh,ww];return aR;
}

function P7_alignRR() { //v2.5 by PVII
 var i;if(!document.p7alignRR) {return;}if(document.layers){
 if(innerWidth!=document.p7RRiw || innerHeight!=document.p7RRih){location.reload();}
 }else{document.p7RR=1;for(i=0;i<p7aRR.length;i++){eval(p7aRR[i]);}document.p7RR=0;}
}

function P7_alignWD2() { //v2.5 by PVII
 var g,gg,lp=0,tp=0,aL,lh,lw,ww,wh,pa='px',args=P7_alignWD2.arguments;if(document.layers||window.opera){pa='';}
 for(var i=0;i<args.length;i+=4){if((g=MM_findObj(args[i]))!=null){gg=(document.layers)?g:g.style;
 mm=parseInt(args[i+1]);mr=parseInt(args[i+2]);ml=parseInt(args[i+3]);ww=parseInt(P7_getWD('width'));
 wh=parseInt(P7_getWD('height'));aL=P7_getLDims(args[i]);lh=aL[2];lw=aL[3];tp=aL[1];lp=aL[0];
 if(mm==1){lp=mr;}if(mm==2){lp=parseInt((ww-lw-mr)/2);if(lp<0){lp=0;}}if(mm==3){lp=ww-lw-mr;if(lp<ml){lp=ml;}}
 if(mm==4){tp=parseInt((wh-lh-mr)/2);if(tp<0){tp=0;}}if(mm==5){tp=parseInt((wh-lh)/2);lp=parseInt((ww-lw)/2);
 if((lp-mr)<=0){lp=mr;}if((tp-ml)<=0){tp=ml;}}if(mm==6){tp=wh-lh-mr;}gg.top=tp+pa;gg.left=lp+pa;
 if(!document.p7alignRR){p7aRR=new Array();document.p7alignRR=true;document.p7RR=0;
 if(document.layers){document.p7RRiw=innerWidth;document.p7RRih=innerHeight;}onresize=P7_alignRR;}
 if(document.p7RR==0){p7aRR[p7aRR.length]="P7_alignWD2('"+args[i]+"',"+mm+","+mr+","+ml+")";}}}
}

function P7_swapClass(){ //v1.4 by PVII
 var i,x,tB,j=0,tA=new Array(),arg=P7_swapClass.arguments;
 if(document.getElementsByTagName){for(i=4;i<arg.length;i++){tB=document.getElementsByTagName(arg[i]);
  for(x=0;x<tB.length;x++){tA[j]=tB[x];j++;}}for(i=0;i<tA.length;i++){
  if(tA[i].className){if(tA[i].id==arg[1]){if(arg[0]==1){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}else{tA[i].className=arg[2];}
  }else if(arg[0]==1 && arg[1]=='none'){if(tA[i].className==arg[2] || tA[i].className==arg[3]){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
  }else if(tA[i].className==arg[2]){tA[i].className=arg[3];}}}}
}

function P7_Scrub(obj) { //v1.0 by PVII
 if(obj.blur){obj.blur();}
}

function openSite(Rubrik) {
	var menu = "";
	if (Rubrik == 'Home') {
		P7_swapClass(1,'Rubrik01','nosubSel','nosub','li');	
		return;
	} else if (Rubrik == 'Impressum') {
		P7_swapClass(1,'Rubrik07','nosubSel','nosub','li');			
	}
	
	if (Rubrik == 'Das Unternehmen') { menu = '02'; }
	if (Rubrik == 'Unsere Leistungen') { menu = '03'; }
	if (Rubrik == 'Referenzen') { menu = '04'; }
	if (Rubrik == 'Aktuell') { menu = '05'; }
    if (Rubrik == 'Kontakt') { menu = '06'; }
	
	P7_swapClass(1,'Rubrik' + menu,'open','closed','li');	
	return;
}

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;
}

//MenuMagic II scripts by PVII
//www.projectseven.com
//Copyright(c) 2002, All Rights Reserved
//
function P7_setMM2(){ //v2.0 by PVII
 //set the image over and down name convention
 document.p7TabOver="_over";
 document.p7TabDown="_down";
 var dt=false;if(document.getElementsByTagName){dt=true;}if(document.P7TabBar){return;}
 var i,k=-1,g,x,gg,tl,ts,ti,tm,tt,tsn,tu,el,args=P7_setMM2.arguments;
 P7TabProp=new Array();for(i=0;i<args.length;i++){P7TabProp[i]=args[i];}
 P7TabIM=new Array();P7TabSB=new Array();if(dt){tm=document.getElementsByTagName("IMG");
 }else{tm=document.images;}tm=document.images;tt=new Array();tt=tt.concat(tm);
 if(document.layers){for(i=0;i<document.layers.length;i++){ti=document.layers[i].document.images;
 if(ti){tt=tt.concat(ti);}for(x=0;x<document.layers[i].document.layers.length;x++){
 ti=document.layers[i].document.layers[x].document.images;if(ti){tt=tt.concat(ti);}}}tm=tt;}
 for(i=0;i<tm.length;i++){tl=tm[i].name; if(dt&&!tl){tl=tm[i].id;}
 if(tl.indexOf("p7TBim")==0){ts=tl.replace("p7TBim","");
 tsn="p7TBsub"+ts;k++;P7TabIM[k]=tl;if((g=MM_findObj(tsn))!=null){P7TabSB[k]=tsn;
 gg=(document.layers)?g:g.style;gg.visibility="hidden";}else{P7TabSB[k]='N';}}}
 document.P7_TBswapd=new Array();document.P7_TBswapo=new Array();for(i=0;i<P7TabIM.length;i++){
 g=MM_findObj(P7TabIM[i]);gg=g.src;g.p7TBim=g.src;tu=gg.lastIndexOf(".");
 g.p7TBimo=gg.substring(0,tu)+document.p7TabOver+gg.substring(tu,gg.length);
 g.p7TBimd=gg.substring(0,tu)+document.p7TabDown+gg.substring(tu,gg.length);
 if(P7TabProp[2]>1){document.P7_TBswapo[i]=new Image();document.P7_TBswapo[i].src=g.p7TBimo;}
 if(P7TabProp[2]>0){if(P7TabProp[2]==3){g.p7TBimd=g.p7TBimo;}document.P7_TBswapd[i]=new Image();
 document.P7_TBswapd[i].src=g.p7TBimd;}}if((g=MM_findObj('P7TabH'))!=null){gg=(document.layers)?g:g.style;
 gg.visibility="hidden";}if(dt&&P7TabProp[3]!='none'&&!window.opera){
 g=document.getElementsByTagName("A");for(i=0;i<g.length;i++){if(g[i].hasChildNodes()){el=g[i].firstChild;
 while (el){if(el.nodeType==3){gg=el.nodeValue;if(P7TabProp[3]==gg.replace("\n","")){
 g[i].className=P7TabProp[4];break;}}el=el.firstChild;}}}}document.P7TabBar=true;
}

function P7_trigMM2(bu){ //v2.0 by PVII
 if(!document.P7TabBar){return;}var i,g,d,dB=-1,tF=false,sF=false;
 for(i=0;i<P7TabSB.length;i++){sF=false;if((g=MM_findObj(P7TabSB[i]))!=null){g=MM_findObj(P7TabSB[i]);
 gg=(document.layers)?g:g.style;sF=true;}d=MM_findObj(P7TabIM[i]);if(P7TabIM[i]==P7TabProp[0]){
 dB=i;}if(P7TabIM[i]==bu){tF=true;if(sF){gg.visibility="visible";}if(P7TabProp[2]>0){
 if(i==dB){d.src=d.p7TBimd;}else if (P7TabProp[2]>1){d.src=d.p7TBimo;}}if((g=MM_findObj('P7TabH'))!=null){
 gg=(document.layers)?g:g.style;gg.visibility="visible";}}else{if(sF){gg.visibility="hidden";}
 if(P7TabProp[2]>0){d.src=d.p7TBim;}}}if(!tF){if(dB>-1){d=MM_findObj(P7TabIM[dB]);
 if((g=MM_findObj(P7TabSB[dB]))!=null&&P7TabProp[1]==0){gg=(document.layers)?g:g.style;
 gg.visibility="visible";}if(P7TabProp[2]>0){d.src=d.p7TBimd;}}
 if((g=MM_findObj('P7TabH'))!=null){gg=(document.layers)?g:g.style;gg.visibility="hidden";}}
}


