// Neues Fenster oeffnen
function f1(a,b,h){window.open(a,'x','width='+b+',height='+h)}
function f2(a,b,h){window.open(a,'x','width='+b+',height='+h+',scrollbars,resizable')}

var XMLHTTP = null;
if (window.XMLHttpRequest) {
  XMLHTTP = new XMLHttpRequest();
} else if (window.ActiveXObject) {
  try {
    XMLHTTP = 
      new ActiveXObject("Msxml2.XMLHTTP");
  } catch (ex) {
    try {
      XMLHTTP = 
       new ActiveXObject("Microsoft.XMLHTTP");
    } catch (ex) {
    }
  }
}

function stateChanged() {
 if (XMLHTTP.readyState==4 || XMLHTTP.readyState=="complete") {
  if (XMLHTTP.responseText != "") {
   document.getElementById("txtHint").style.display='block';
   document.getElementById("txtHint").innerHTML=XMLHTTP.responseText;
  }
 }
}

function showHint(str) {
 if (str.length < 3) {
  document.getElementById("txtHint").innerHTML="<small>Suchbegriff mindestens 3 Zeichen</small>";
  return;
 }
 else {
  document.getElementById("txtHint").innerHTML="<small>Suche Vorschl&auml;ge ...</small>";
  XMLHTTP.onreadystatechange=stateChanged;
  XMLHTTP.open("GET", "../_sitemap/_gethint.php" + "?q=" + str + "&sid=" + Math.random(), true);
  XMLHTTP.send(null);
 }
}

function source_code(id, sh) {
 document.getElementById(id).style.overflow="hidden";
 if (document.getElementById(id).style.display=="none") {
  document.getElementById(id).style.display="block";
  delay_a_qt(id, sh, 0); // FF zu langsam bei der Anzeige!
//                                          document.getElementById(id).style.overflow="auto"; // Ersatz!
 }
 else {
  delay_z_qt(id, sh); // FF zu langsam bei der Anzeige!
//                                          document.getElementById(id).style.display="none"; // Ersatz!
 }
}

function delay_a_qt(id, sh, i) {
 document.getElementById("i" + id).innerHTML = '<img src="../_menue/bilder/loading3.gif">';
 document.getElementById(id).style.height= i + "px";
 ++i;
 if (i <= sh) {
  window.setTimeout("delay_a_qt('" + id + "', '" + sh + "', '" + i + "')" , 1);
 }
 else {
  document.getElementById("i" + id).innerHTML = '<img src="../_menue/bilder/pfeil_oben2.gif">';
  document.getElementById("t" + id).innerHTML = "Quelltext ausblenden";
  document.getElementById(id).style.overflow="auto";
 }
}

function delay_z_qt(id, i) {
 document.getElementById("i" + id).innerHTML = '<img src="../_menue/bilder/loading3.gif">';
 document.getElementById(id).style.height= i + "px";
 --i;
 if (i > 0) {
  window.setTimeout("delay_z_qt('" + id + "', '" + i + "')" , 1);
 }
 else {
   document.getElementById("i" + id).innerHTML = '<img src="../_menue/bilder/pfeil_unten2.gif">';
   document.getElementById("t" + id).innerHTML = "Quelltext anzeigen";
   document.getElementById(id).style.display="none";
 }
}

function unzip(id) {
 document.getElementById(id).style.display='inline'; 
}

function zip(id) {
 document.getElementById(id).style.display='none';
}

function kommentarSet() {
 if ('localStorage' in window && window['localStorage'] !== null) {
  if (document.komform.name.value != "") {
   window.localStorage.setItem("kom_name", document.komform.name.value);
  }
 }
}

function kommentarGet() {
 if ('localStorage' in window && window['localStorage'] !== null) {
  if (window.localStorage.getItem("kom_name")) {
     document.komform.name.value = window.localStorage.getItem("kom_name");
  }
 }
}
