var GlossarWindow = null;
var SpeakerWindow = null;
var text_visible = false;
var glossar_visible = false;
var actual_location = "startpage";


function FensterZu(){
    if (GlossarWindow != null) GlossarWindow.close();
    if (SpeakerWindow != null) SpeakerWindow.close();
}

function stop_loading () {
stop();
}

function set_location(location) {

actual_location = location;

  if (location != "") {
       actual_location = "txt/" + location + ".html";
    } else {
       actual_location = "txt/empty.html";
    }

    showText();

}

function openText() {
      if (text_visible == false) {
      SpeakerWindow = window.open(actual_location,"Textzusammenfassung","resizable=1,toolbar=no,scrollbars=yes,width=480,height=240,status=no");
      SpeakerWindow.focus();
      text_visible = true; 
      } else {
        if (SpeakerWindow.closed == true) {
           SpeakerWindow = window.open(actual_location,"Textzusammenfassung","resizable=1,toolbar=no,scrollbars=yes,width=480,height=240,status=no");
         SpeakerWindow.focus(); 
        } else {
         SpeakerWindow.focus();                           }
}
}

function showText() {
    if (text_visible == false) {
      }  else {
        if (SpeakerWindow.closed == true) {
          //alert("Das Fenster ist zu");

         } else {
       //  alert(speakertext);
       //SpeakerWindow.focus();
       //self.focus();
       SpeakerWindow.location = actual_location;
        }
    }   
}

function showGlossar(position) {
//alert ("showglossar");

    pos = "txt/glossary.htm#"+position;
 

    if (glossar_visible == false) {
        GlossarWindow = window.open(pos,"Glossary","resizable=1,toolbar=no,scrollbars=yes,width=650,height=480,status=no");
         GlossarWindow.focus(); 
       glossar_visible = true;
    } else {
           if (GlossarWindow.closed == true) {
        GlossarWindow = window.open(pos,"Glossary","resizable=1,toolbar=no,scrollbars=yes,width=650,height=480,status=no");
         GlossarWindow.focus(); 
           } else {
           GlossarWindow.location = pos;
           }
    }

    
}
