//Pop-it menu- By Dynamic Drive, modified by FH OOW
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

// Browser-Variablen
var ie4=document.all;
var ns6=document.getElementById&&!document.all;
var ns4=document.layers;


// zeige pop-up menu bei onmouseover
function showmenu(e,which) {  // (event,linkset[x])

  if (!document.all && !document.getElementById && !document.layers)
    return;
  
  clearhidemenu();
  
  // popupmenu style
  menuobj=ie4 ? document.all.popmenu : ns6 ? document.getElementById("popmenu") : ns4 ? document.popmenu : "";
  menuobj.thestyle=(ie4||ns6) ? menuobj.style : menuobj; // original: bitweise (ie4|ns6);
  
  // welches Menu soll aufklappen? (which = linkset[x])
  if (ie4||ns6) {
    menuobj.innerHTML='';  // IE auf MAC's - bugfix
    menuobj.innerHTML=which;
  }
  else {
    menuobj.document.write('<layer name="gui" bgColor="#eeeeee" width="200" onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>');
    menuobj.document.close();
  }

  //  Abstand Menu links (+"px" wenn doctype = strict)
  /*eventX=ie4 ? document.getElementById(event.srcElement.id).offsetLeft : ns6 ? document.getElementById(e.target.id).offsetLeft : e.x;
  menuobj.thestyle.left=ie4 ? document.body.scrollLeft+eventX+"px" : ns6? window.pageXOffset+eventX+"px" : eventX;*/
  eventX=ie4 ? 290 : ns6 ? 290 : 290;
  menuobj.thestyle.left=ie4 ? "290px" : ns6 ? "290px" : 290;  
  // Abstand Menu oben (20px) (+"px" wenn doctype = strict)
  menuobj.thestyle.top=ie4 ? "100px" : ns6 ? "100px" : 100 ;
  menuobj.thestyle.visibility="visible";
  return false;
}

function contains_ns6(a, b) {
  //Determines if 1 element in contained in another- by Brainjar.com
  while (b.parentNode)
  if ((b = b.parentNode) == a)
    return true;
  return false;
}

function hidemenu() {
  if (window.menuobj)
  menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide";
}

function dynamichide(e) {
  if (ie4&&!menuobj.contains(e.toElement))
    hidemenu();
  else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
    hidemenu();
}

// delay until menu hides - set to 500 (original value 200) 09/2003 kla
function delayhidemenu() {
  if (ie4||ns6||ns4)
    delayhide=setTimeout("hidemenu()",500);
}

function clearhidemenu() {
  if (window.delayhide)
    clearTimeout(delayhide);
}

function highlightmenu(e,state) {
  if (document.all)
    source_el=event.srcElement;
  else if (document.getElementById)
    source_el=e.target;
  if (source_el.className=="menuitems") {
    source_el.id=(state=="on")? "mouseoverstyle" : "";
  }
  else {
    while(source_el.id!="popmenu"){
      source_el=document.getElementById? source_el.parentNode : source_el.parentElement;
      if (source_el.className=="menuitems") {
        source_el.id=(state=="on")? "mouseoverstyle" : "";
      }
    }
  }
}

if (ie4||ns6)
document.onclick=hidemenu;

// Funktion für Löschbestätigung im CMS UW
function confirmLink(theLink, message)
    {
    var is_confirmed = confirm(message);
    if (is_confirmed)
        {
        theLink.href += "&confirmed=1";
        }
    return is_confirmed;
    }


var menu='<div class="menuitems">&nbsp;<font style="background-color:#65d38e">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="index.php?id=591">Ausstellungen<\/a><\/div>';
menu += '<div class="menuitems">&nbsp;<font style="background-color:#7efcf2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="index.php?id=556">Informationen<\/a><\/div>';
menu += '<div class="menuitems">&nbsp;<font style="background-color:#E486D4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="index.php?id=562">Kunstfreunde für Wilhelmshaven<\/a><\/div>';
menu += '<div class="menuitems">&nbsp;<font style="background-color:#FE8A79">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="index.php?id=565">Presse<\/a><\/div>';
menu += '<div class="menuitems">&nbsp;<font style="background-color:#B6A5E9">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="index.php?id=570">Termine<\/a><\/div>';
menu += '<div class="menuitems">&nbsp;<font style="background-color:#81d0f4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="index.php?id=576">Museum<\/a><\/div>';
menu += '<div class="menuitems">&nbsp;<font style="background-color:#FDFFA9">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="index.php?id=581">Publikationen<\/a><\/div>';
menu += '<div class="menuitems">&nbsp;<font style="background-color:#e1375b">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="index.php?id=585">NordWestKunst<\/a><\/div>';
menu += '<div class="menuitems">&nbsp;<font style="background-color:#545051">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><a href="http://www.kunsthalle-wilhelmshaven.de/">HAUPTSEITE<\/a><\/div>';
