mousepos = "";
mousepos2 = "";

function encode_utf8(rohtext) {
             // dient der Normalisierung des Zeilenumbruchs
             rohtext = rohtext.replace(/\r\n/g,"\n");
             var utftext = "";
             for(var n=0; n<rohtext.length; n++)
                 {
                // ermitteln des Unicodes des  aktuellen Zeichens
                 var c=rohtext.charCodeAt(n);
                 // alle Zeichen von 0-127 => 1byte
                 if (c<128)
                     utftext += String.fromCharCode(c);
                 // alle Zeichen von 127 bis 2047 => 2byte
                 else if((c>127) && (c<2048)) {
                     utftext += String.fromCharCode((c>>6)|192);
                    utftext += String.fromCharCode((c&63)|128);}
               // alle Zeichen von 2048 bis 66536 => 3byte
                 else {
                   utftext += String.fromCharCode((c>>12)|224);
                    utftext += String.fromCharCode(((c>>6)&63)|128);
                     utftext += String.fromCharCode((c&63)|128);}
                }
            return utftext;
}

function deactivate(id)
{
  pullup(id);
}

function activate(id)
{
  mousepos = id;
}

function pullup2(id)
{
  if (mousepos == "")
  {
    document.getElementById(id).style.visibility = "hidden";
  }
}

function pullup3(id)
{
    document.getElementById(id).style.visibility = "hidden";
}

function pullup(id,id2)
{
  if (id2 == "subnav5")
  {
    setTimeout("pullup3('"+id+"')",100);
  }
  else
  {
    mousepos2 = mousepos;
    mousepos = "";
    setTimeout("pullup2('"+id+"')",300);
  }
}

function pulldown(id,id2)
{
  if (mousepos2 != "" && mousepos2 != id2)
  {
    document.getElementById(mousepos2).style.visibility = "hidden";
    mousepos2 = "";
  }
  document.getElementById(id).style.visibility = "visible";
  mousepos = id;
}

function switchDiv(id)
{
  var img = 'img_' + id;
  if(document.getElementById(id).style.display == 'none')
  {
    document.getElementById(id).style.display = 'block';
//  document.getElementById(img).src = 'img/overviewCal_up.png'; // Grafik referenzieren
  }
  else
  {
    document.getElementById(id).style.display = 'none';
//  document.getElementById(img).src = 'img/overviewCal_down.png'; // Grafik referenzieren
  }
}

function artikelScroll(id)
{
  document.getElementById(id).scrollIntoView(true);
  document.getElementById('allinclusive').scrollIntoView(true);
}

