function switchDisplay(id){//toggle element display, sag
doc=document.getElementById(id);
 if(doc.style.display == 'none')
  doc.style.display = 'block';
 else
  doc.style.display = 'none';
}

function switchDisplayTR(id){
doc=document.getElementById(id);
 if(doc.style.display == 'none')
  doc.style.display = '';
 else
  doc.style.display = 'none';
}


function switchDisplayAP(id){
        doc=document.getElementsByTagName('TR');
        for (i=0; i<doc.length; i++){
                if(doc[i].style.display == 'none')
                        doc[i].style.display = '';
                else{
                        if(doc[i].getAttribute('valign') == 'middle')
                                doc[i].style.display = 'none';
                }
        }
}



function switchDisplayFaq(id){
doc=document.getElementById(id);
 if(doc.style.display == 'none')
  doc.style.display = 'block';
 else
  doc.style.display = 'none';
}

function closeBullauge() {//closes bullseye layer on homepage
document.getElementById('bullauge_flash').style.display = 'none';
}

/***********************
*
*  media guide START
*
************************/
// der array aus hauptpunkten
var hauptpunkte = new Array();
      
/******************
* option - Objekt
******************/

function relOption(newName,newLink){
  this.name = newName;
  this.link = newLink;
}

/******************
* related - Objekt
******************/

function related(newName,newLink,theOptions){
  this.entryCount = theOptions.length;
  this.name = newName;
  this.link = newLink;
  this.options = theOptions;
}

/******************
* Hauptpunkt - Objekt
******************/

function func_addRelated(name,link,options){
  this.related[this.entryCount] = new related(name,link,options);
  this.entryCount++;
}

function Hauptpunkt(newName,newLink){
  this.entryCount = 0;
  this.name = newName;
  this.link = newLink;
  this.related = new Array();
  this.addRelated = func_addRelated;
}

/*****************
* Funktion zum Befüllen der dropdowns
*****************/
function fillSelect(selName){
  // benötigte variablen
  var selHauptpunkt = document.getElementById('hp');
  var selElem = document.getElementById(selName);

  // füllen des hauptpunkte-dropdowns
  if (selName == 'hp'){
    for (i=0; i<hauptpunkte.length; i++){
      selHauptpunkt.options[i+1] = new Option(hauptpunkte[i].name,hauptpunkte[i].name);
    }
  }

  // wir sollen eines der beiden unter-dropdowns füllen
  if (selName != 'hp'){
	for( selElem.options.length-1; i >= 1; i--)
	{
		selElem.remove(i);
	}
    // befüllen des "bezüglich"-dropdowns
    if (selName == 'related'){
      // aktivieren des dropdowns
      document.mguide.related.disabled = false;
      
      document.mguide.relOptions.disabled = true;
      document.mguide.relOptions.selectedIndex = 0;
   
		


      
      // befüllen mit optionen
      for (i=1; i < hauptpunkte[(document.mguide.hp.selectedIndex - 1)].entryCount+1; i++){
        selElem.options[i] = new Option(hauptpunkte[(document.mguide.hp.selectedIndex - 1)].related[i-1].name,hauptpunkte[(document.mguide.hp.selectedIndex - 1)].related[i-1].name);
      }
    }

    // befüllen des "und dort"-dropdowns
    else if (selName == 'relOptions'){
      // aktivieren des dropdowns
      document.mguide.relOptions.disabled = false;
      document.mguide.relOptions.options.length = 0;

      // befüllen mit optionen
      for (i=1; i < hauptpunkte[(document.mguide.hp.selectedIndex - 1)].related[(document.mguide.related.selectedIndex - 1)].entryCount+1; i++){
        selElem.options[i] = new Option(hauptpunkte[(document.mguide.hp.selectedIndex - 1)].related[(document.mguide.related.selectedIndex - 1)].options[i-1].name,hauptpunkte[(document.mguide.hp.selectedIndex - 1)].related[(document.mguide.related.selectedIndex - 1)].options[i-1].name);
      }
    }
  }
}

/*****************
* Funktion zum Weiterleiten entsprechend der getroffenen Auswahl
*****************/
function getMeThere(){
  if (document.mguide.relOptions.selectedIndex > 0 && document.mguide.related.selectedIndex > 0 && document.mguide.hp.selectedIndex > 0){
    document.location = hauptpunkte[(document.mguide.hp.selectedIndex - 1)].related[(document.mguide.related.selectedIndex - 1)].options[document.mguide.relOptions.selectedIndex-1].link;
  } else if (document.mguide.relOptions.selectedIndex < 1 && document.mguide.related.selectedIndex > 0 && document.mguide.hp.selectedIndex > 0){
    document.location = hauptpunkte[(document.mguide.hp.selectedIndex - 1)].related[(document.mguide.related.selectedIndex - 1)].link;
  } else if (document.mguide.relOptions.selectedIndex < 1 && document.mguide.related.selectedIndex < 1 && document.mguide.hp.selectedIndex > 0) {
	document.location = hauptpunkte[(document.mguide.hp.selectedIndex - 1)].link;
  } else {
    alert ('Sie müssen mindestens einen Bereich auswählen!');
  }
}

/***********************
*
*  media guide ENDE
*
************************/


/************************
FSCommand für IE Bullauge
*************************/
<!--
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function bullseye_DoFSCommand(command, args) {
	var fahneObj = isInternetExplorer ? document.all.bullseye : document.bullseye;
	//
	closeBullauge();
	//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub bullseye_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call bullseye_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
//-->


var currentwk = 'wk_1';

function toggleMarktdaten(id,img) {
        var data = document.getElementById(id);
        var data2 = currentwk == ''?  document.getElementById(currentwk): null;
        if(currentwk == id) {
                data.style.display = 'none';
                img.src = '/images/navi/icon_plus2.gif';
                currentwk = '';
                currentimg = '';
        }
        else{
                data.style.display = 'block';
                img.src = '/images/navi/icon_minus2.gif';

                if(currentwk != ''){
                        data2 = document.getElementById(currentwk);
                        data2.style.display = 'none';
                        }
                if(currentimg != ''){
                        currentimg.src = '/images/navi/icon_plus2.gif';
                        }
                currentwk = id;
                currentimg = img;

        }


}


