function setDcWebNavHi(id, parentId){

	// reset Highlighting
        var ul = document.getElementById("subnaviUl");
        var anzahl = ul.childNodes.length;
        
        for (i=0; i<anzahl; i++){
          ul.childNodes[i].className = "";
        } 
	
        // set Element Hi
        if(document.getElementById(parentId)){

          var parentNavElement = document.getElementById(parentId);
          parentNavElement.className = "subNavHi";

          var subUls = parentNavElement.getElementsByTagName("ul")
          for (var i = 0; i < subUls.length; i++) {
            subUls[i].className = "level2";
          }
         
          document.getElementById(id).className = "subNavLevel2Hi";

        }
        else{
          
	  var navElement =  document.getElementById(id);
          var subUls = navElement.getElementsByTagName("ul")
          
          navElement.className = "subNavHi";
          for (var i = 0; i < subUls.length; i++) {
            subUls[i].className = "level2";
          }
           
        }
}


function resizeDcWebIframe(){
	d=40;

	iframe=document.getElementsByName('dcweb')[0];

        if(document.all)
          iframe.height = window.frames['dcweb'].document.getElementsByTagName('body')[0].scrollHeight+d;
        else
          iframe.height = window.frames['dcweb'].document.getElementsByTagName('body')[0].offsetHeight+d;


        setDivHeight();
        //if(document.getElementById("contentContainer").offsetHeight < iframe.height)

        //alert(document.getElementById("contentContainer").offsetHeight);
} 

function setDivHeight() {
        //alert("setDivHeight");
	var contentHoehe = document.getElementById("contentContainer").offsetHeight;
        var leftHoehe = document.getElementById("leftContainer").offsetHeight;
	
        //if(hoehe) contentHoehe = hoehe;
          

	if (document.getElementById("newsbox") != null) {
		var newsBoxHoehe = document.getElementById("newsbox").offsetHeight;
	} else {
		var newsBoxHoehe = null;
	}
	
	if (document.getElementById("subnavi") != null) {
		var subnaviHoehe = document.getElementById("subnavi").offsetHeight;
	} else {
		var subnaviHoehe = null;
	}
	
	var infoBox = document.getElementById("infobox");
        var orgInfoBoxHoehe = infoBox.offsetHeight;
	var infoBoxHoehe = contentHoehe - 100 - 180 + 26;
	
	if (newsBoxHoehe != null) {
		infoBoxHoehe -= newsBoxHoehe;
	} else if (subnaviHoehe != null) {
		infoBoxHoehe -= subnaviHoehe;
	}
	

	// Der Infobox die richtige Höhe zuweisen
        if (infoBoxHoehe > orgInfoBoxHoehe)
	   infoBox.style.height = infoBoxHoehe + "px";

        // Contentbox die richtige Höhe zuweisen
        if ((leftHoehe - 43) > contentHoehe)
		document.getElementById("contentContainer").style.height = (leftHoehe-43) + "px";
}



function showVisual(which, path) {

	document.images[which].src=path;
}


function showText(which, text) {

        if (text.length > 0) {
	   document.getElementById(which).innerHTML = text + "<br />";
	} else {
           document.getElementById(which).innerHTML = "<br />";
	}
}



function showDownload(which, text, nr) {

        if (nr == null) {
          nr = 1;
        }	

	if (text.length > 0) {
	   document.getElementById(which).innerHTML = "<img src='/system/galleries/pics/norddeutsche_vermoegen/icon_pdf.gif' alt='' />&nbsp;<a href='"+text+"' target='_blank'>Download zum Bild "+nr+"</a><br />";
	} else {
	   document.getElementById(which).innerHTML = "&nbsp;";
	}
}

function showPrint(){

	alert(window.document.getElementById("contentContainer").innerHTML);
	var print = window.document.getElementById("contentContainer").innerHTML;
	window.open(print);
}



function showSitemap(subnav, img) {

        // Submenuepunkte anzeigen
        if (document.getElementById(subnav).style.display == "block" || document.getElementById(subnav).style.display == "") {
	  document.getElementById(subnav).style.display = "none";
          document.images[img].src = "/system/galleries/pics/norddeutsche/icon_plus.gif";
        } else {
          document.getElementById(subnav).style.display = "block";
          document.images[img].src = "/system/galleries/pics/norddeutsche/icon_minus.gif";
        }

        setDivHeight();
}



function closeSitemap(anzahl) {

        for(var i=0; i<anzahl; i++) {

           var subnav = document.getElementById('subnav_'+i);
           var img = document.images['img_'+i];

           if (subnav != null) {
             subnav.style.display = "none";
             img.src = "/system/galleries/pics/norddeutsche/icon_plus.gif";
	   }
        }
}



function openSitemap(anzahl) {

        for(var i=0; i<anzahl; i++) {

           var subnav = document.getElementById('subnav_'+i);
           var img = document.images['img_'+i];

           if (subnav != null) {
             subnav.style.display = "block";
             img.src = "/system/galleries/pics/norddeutsche/icon_minus.gif";
	   }
        }
}



function openPopup(site, width, height)
{
  x = screen.availWidth/2-width/2;
  y = screen.availHeight/2-height/2;
  window.open(site,'Detailansicht','width='+width+',height='+height+',top='+y+',left='+x+',scrollbars=yes');
}




function openVideo(site)
{
  x = screen.availWidth/2-100;
  y = screen.availHeight/2-100;
  window.open(site, 'Film', 'width=402,height=402,top='+y+',left='+x+',scrollbars=no');
}



function Go (select) {
  var wert = select.options[select.options.selectedIndex].value;
  if (wert == "leer") {
    select.form.reset();
    return;
  } else {
      document.location.href = wert;
      select.form.reset();
  }
}


function GoNewWin (select) {
  var wert = select.options[select.options.selectedIndex].value;
  var werte = wert.split("|");
  
  var href = werte[0];
  var newWin = werte[1];

  if (wert == "leer") {
    select.form.reset();
    return;
  } else {
      if(newWin=="true"){
         window.open(href,"newWindow","width=1024,height=768,left=0,top=0,location=yes,menubar=yes,resizable=yes,scrollbars=yes,toolbar=yes");
      }else{
         document.location.href = href;
      }
      select.form.reset();
  }
}

function FlashMovie(src, movie, width, height, version, quality, menu, bgcolor, flashvars)
{
        document.write('<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version='+version+',0,0,0">');
        document.write('<param name="movie" value="'+src+'">');
        document.write('<param name="quality" value="'+quality+'">');
        document.write('<param name="menu" value="'+menu+'">');
        document.write('<param name="bgcolor" value="'+bgcolor+'">');
        document.write('<embed src="'+src+'" quality="'+quality+'" scale="exactfit" menu="'+menu+'"');
           document.write('bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" swLiveConnect="false"');
           document.write('type="application/x-shockwave-flash"');
           document.write('pluginspage="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">');
        document.write('</embed>');
        document.write('</object>');
}

function change_anfahrt() {
	var anfahrt = document.getElementById('anfahrt').getElementsByTagName('img')[0];
	var link_1 = document.getElementById('anfahrt').getElementsByTagName('a')[0];
	var link_2 = document.getElementById('anfahrt').getElementsByTagName('a')[1];

	if(anfahrt.src.indexOf('detail') != '-1') {
		anfahrt.src = anfahrt.src.replace('detail', 'uebersicht');
		link_1.getElementsByTagName('img')[0].src = link_1.getElementsByTagName('img')[0].src.replace('minus', 'plus');
		link_2.innerHTML = 'Detailansicht';

	} else {
		anfahrt.src = anfahrt.src.replace('uebersicht', 'detail');
		link_1.getElementsByTagName('img')[0].src = link_1.getElementsByTagName('img')[0].src.replace('plus', 'minus');
		link_2.innerHTML = '&Uuml;bersicht';
	}
}

function change_anfahrtEn() {
	var anfahrt = document.getElementById('anfahrt').getElementsByTagName('img')[0];
	var link_1 = document.getElementById('anfahrt').getElementsByTagName('a')[0];
	var link_2 = document.getElementById('anfahrt').getElementsByTagName('a')[1];

	if(anfahrt.src.indexOf('detail') != '-1') {
		anfahrt.src = anfahrt.src.replace('detail', 'uebersicht');
		link_1.getElementsByTagName('img')[0].src = link_1.getElementsByTagName('img')[0].src.replace('minus', 'plus');
		link_2.innerHTML = 'Detail';

	} else {
		anfahrt.src = anfahrt.src.replace('uebersicht', 'detail');
		link_1.getElementsByTagName('img')[0].src = link_1.getElementsByTagName('img')[0].src.replace('plus', 'minus');
		link_2.innerHTML = 'Overview';
	}
}