function Add(what)
{
  document.write(what);
}

function AddLink(active,brackets,markpage,linkpage,linktext,theclass)
{
  startTag = "";
  endTag = "";
  thetip = " ";
  if (active == 0)
  {
    ;
  }
  else if (linkpage == markpage)
  {
    theclass = theclass + " high";
    thetip = " title='Diese Seite wird gerade angezeigt.' ";
  }
  else
  {
    startTag = "<a target='fma' href='" + linkpage + ".html'>";
    endTag = "<\/a>";
  }
  document.write("<p" + thetip + "class='" + theclass + "'>");
  if (brackets==1)
  {
    document.write("[");
  }
  document.write(startTag + linktext + endTag);
  if (brackets==1)
  {
    document.write("]");
  }
  document.write("<\/p>");
}


function gibFarbe(code)
{
  if (code=="kap0") return "#bbbb99";
  if (code=="kap1") return "#bb9999";
  if (code=="kap2") return "#cccc77";
  if (code=="kap3") return "#99bb99";
  if (code=="kap4") return "#9999bb";
  if (code=="kap5") return "#bb99bb";
}

function machbunt(randfarbe)
{
  parent.fle.document.body.style.backgroundColor=randfarbe;
  parent.fur.document.body.style.backgroundColor=randfarbe;
  parent.fli.document.body.style.backgroundColor=randfarbe;
  parent.fun.document.body.style.backgroundColor=randfarbe;
  parent.fre.document.body.style.backgroundColor=randfarbe;
  parent.fob.document.body.style.backgroundColor=randfarbe;
  parent.ful.document.body.style.backgroundColor=randfarbe;
}

//function Embed(fli0,fre0,fob0,fun0,ful0,mitDirektlink,randfarbcode)
function Embed(fli0,fre0,fob0,fun0,ful0,mitDirektlink)
{
  if (fli0) { parent.fli.location.href=fli0; }
  if (fun0) { parent.fun.location.href=fun0; }
  if (fre0) { parent.fre.location.href=fre0; }
  if (fob0) { parent.fob.location.href=fob0; }
  if (ful0) { parent.ful.location.href=ful0; }

  parent.document.title=this.document.title;
  //
  var direkt_URL = this.document.URL;
  direkt_URL = direkt_URL.split("#")[0];
  if ( (ful0.lastIndexOf("?") > 0) && (mitDirektlink==1) )
  {
    document.write(" &bull; Direkter Link zu dieser Seite: <i><a target='_new' href='"+direkt_URL+"'>"+direkt_URL+"</a></i>");
  }
  //basename = ful0.split("?")[2];
  //window.alert(direkt_URL);
  //window.alert(basename);
  //window.location.replace(direkt_URL);
  document.write("<br>Letzte &Auml;nderung dieser Seite: <i>"+document.lastModified+"</i>");

/*
  aufruf="machbunt(\""+gibFarbe(randfarbcode)+"\")";
  //window.alert(aufruf);
  window.setTimeout(aufruf, 150);
*/
}


function Navi(art,mkl,nlt,nla,nra,nrt) // art (1=LR,0=OU), mit Klammern? (0/1), nachlinks-Text, nachlinks-Adresse, nachrechts-Adr., nachrechts-Text
{
  document.write("<div class='navi'>");
  if (nlt.length > 0)
  {
    if (art==1) document.write("<img src='i/4.png' onMouseover='this.src=\"i/0.png\"' onMouseout='this.src=\"i/4.png\"'/>&nbsp;");
    if (art==0) document.write("<img src='i/2.png' onMouseover='this.src=\"i/0.png\"' onMouseout='this.src=\"i/2.png\"'/>&nbsp;");
    if (mkl == 1) document.write("[");
    document.write("<a href='"+nla+".html'>"+nlt+"</a>");
    if (mkl == 1) document.write("]");
  }
  if (nrt.length*nlt.length > 0)
  {
    document.write("&nbsp;&nbsp;");
    if (mkl == 0) document.write("/&nbsp;&nbsp;");
  }
  if (nrt.length > 0)
  {
    if (mkl == 1) document.write("[");
    document.write("<a href='"+nra+".html'>"+nrt+"</a>");
    if (mkl == 1) document.write("]");
    if (art==1) document.write("&nbsp;<img src='i/6.png' onMouseover='this.src=\"i/0.png\"' onMouseout='this.src=\"i/6.png\"'/>");
    if (art==0) document.write("&nbsp;<img src='i/8.png' onMouseover='this.src=\"i/0.png\"' onMouseout='this.src=\"i/8.png\"'/>");
  }
  document.write("</div>");

}


function Correct_4title(txt)
{
  var res = txt;
  res = res.replace(/_/,"&");
  res = res.replace(/_/,"&");
  return res;
}

function CorrectHTML4title(txt)
{
  var res = txt;
  res = res.replace(/&nbsp;/," ");
  res = res.replace(/&nbsp;/," "); // has to be twice
  res = res.replace(/&auml;/,"Š");
  res = res.replace(/&ouml;/,"š");
  res = res.replace(/&uuml;/,"Ÿ");
  res = res.replace(/&aring;/,"Œ");
  return res;
}

function togsi(picname,w_little,h_little,w_big,h_big) // toggle size of picture
{
  if(document.images[picname].width == w_little)
  {
    document.images[picname].width=w_big;
    document.images[picname].height=h_big;
  }
  else
  {
    document.images[picname].width=w_little;
    document.images[picname].height=h_little;
  }
}

function lexikonverschiebung()
{
  //window.alert("jstools.js:lexikonverschiebung()");
  //...
}

/*
function ReadCookie()
{
  var val = "";
  if (document.cookie)
  {
    var valstart = document.cookie.indexOf("=") + 1;
    var valend = document.cookie.indexOf(";");
    if (valend == -1)
    {
      valend = document.cookie.length;
    }
    val = document.cookie.substring(valstart,valend);
  }
  return val;
}

function WriteCookie(theValue)
{
  document.cookie = "kekswert=" + theValue + "; expires=" + new Date(new Date().getTime()+3.2E10).toGMTString() + ";";
}
*/
