
/* DHTML for a dropped down menu.
---------------------------------
   Autor: Stefan Dotti
   Homepage: www.dotti.at
   email: stefan@dotti.at
---------------------------------
   please email just if something won't work out.
*/

// set the range of the menu

var menuWidth=4;
var open=false;
var dropped=new Array();

for (i=1; i<=menuWidth; i++) dropped[i]=false;


// Macromedia ObjectFinder
//
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}


// Drop if not dropped, hide if dropped.
//
function dropDown() {

  if (!open) open=true; else { 

    open=false;

    for (i=1; i<=menuWidth;i++) {
	var obj2=MM_findObj(i+'dropDown',null);
        obj2.style.display='none';
        dropped[i]=false;
    }
  }

}

function showHide(id,hide,event) {

  var obj=MM_findObj(id+'dropDown',null);

  if (open) {

    for (i=1; i<=menuWidth;i++) {
	var obj2=MM_findObj(i+'dropDown',null);
        obj2.style.display='none';
        dropped[i]=false;
    }

    if (dropped[id]&&hide) {
      setTimeout("obj.style.display='none'",5000);
      dropped[id]=false; }

    if (!dropped[id]&&!hide) {
      obj.style.display='inline';
      if (document.all) {
        obj.style.top=obj.parentElement.offsetTop+21;
        obj.style.left=obj.parentElement.offsetLeft;
	}
      else {
	var obj3=MM_findObj(id+'dropDownLink',null);
	obj.style.top=obj3.offsetTop+22;
	obj.style.left=obj3.offsetLeft;
	}	
      dropped[id]=true; }
  }

}
