/*dynamisches SubMenu*/

  var m1=new Object();
	m1.name='menu';
	m1.frame = window.top;
	m1.last = null;
	m1.timeout=1000;
	m1.timer =null;

function exM(parentID,hassub){
	var el = m1.frame.document.getElementById(parentID);
  clearTimeout(m1.timer);
  if(m1.last)
    m1.last.style.visibility="hidden";
  if(hassub){
  	var sub=el.id;
	  var frame = m1.frame.document.getElementById(el.id+"frame")
	  if(!frame){
	  //Knoten erzeugen
	    var topadd=0;
	    var leftadd=0;
	    if (navigator.appName.indexOf("Explorer") > -1) {
				topadd=101;
	    	leftadd=5;
			}
	    var parent=el.parentNode;
	    var top=parent.offsetTop + topadd;// + el.offsetHeight;
	    var left=parent.offsetLeft + 130 + leftadd;
	    //top = parent.offsetTop;
	    var width=50;
	    var height;
	    //Frame für Submenu
	    frame = m1.frame.document.createElement("DIV");
	    frame.style.left=left;
	    frame.style.top=top;

	    frame.style.position="absolute";
	    //frame.style.background="#ECEDF4";
	    //frame.style.border="1px solid white";
	    //frame.style.opacity=0.85;
	    frame.id=el.id+"frame";
	    //Submenu-Einträge
	    var obj = eval(sub);
	    height=0;
	    for (var n = 0; n < obj.length; n++){
	    //for each(var f in obj){
	    	var f=obj[n];
	      var div = m1.frame.document.createElement("div");
	      div.style.padding="5px 13px 5px 10px";
	      div.style.color="white";
	      div.style.background="url(./images/bg-service-level2.gif)";
	      div.onmouseover=function(){ clearTimeout(m1.timer);};
	      div.onmouseout=function(){ clearTimeout(m1.timer); m1.timer=setTimeout("hideM()",m1.timeout); };
	      div.style.cursor="pointer";
	      var a=m1.frame.document.createElement("A");
	      a.href=f[1];
	      a.appendChild(m1.frame.document.createTextNode(value=f[0]));
	      a.style.fontSize="80%";
	      a.style.fontFamily="Tahoma, sans-serif";
				a.style.color="#fff";
	      div.appendChild(a);
	      height += 25;
	      frame.appendChild(div);
	    }
	    m1.frame.document.body.appendChild(frame);
	  }else{
	    frame.style.visibility="visible";
	  }
	  m1.last=frame;
  }
}

function coM(){
  //nicht sofort ausblenden, sondern Timer setzen, der das macht...
  clearTimeout(m1.timer);
  m1.timer=setTimeout("hideM()",m1.timeout);
}

function hideM(){
  if(m1.last)
    m1.last.style.visibility="hidden";
}
