/******************
CM_ADD-IN - foldoutmenu (last updated: 11/14/02)

Test foldoutmenu behaviour.

Only for level 0

*****************/
makeCM.prototype.onshow+="if(l==1) this.foldout(pm,pm.subx,pm.suby,maxw,maxh,pm.lev)"
makeCM.prototype.foldout=function(pm,x,y,w,h,l){
	//First only toplevel
	c = this
	curr = 0
	pm.mout=""
	for(var i=0;i<c.l[l].m.length;i++){
		//move back in place, just in case
		m = this.m[c.l[l].m[i]]
		if(m.b.orgy){
			if(m.b.y!=m.b.orgy) m.b.moveIt(m.b.x,m.b.orgy)
		}
		//find current
		if(curr){ //move'em
			m.b.orgy = m.b.y
			m.b.orgsuby = m.suby
			m.b.moveIt(m.b.x,m.b.y+h)
			m.mover="pm.b.moveIt(pm.b.x,pm.b.orgy)"
		}
		if(c.l[l].m[i] == pm.name) curr = 1
	}
}
makeCM.prototype.onhide+="this.foldin()"
makeCM.prototype.foldin=function(){
	//First only toplevel
	c = this
	curr = 0
	l=0
	for(var i=0;i<c.l[l].m.length;i++){
		m = this.m[c.l[l].m[i]]
		if(m.b.orgy) m.b.moveIt(m.b.x,m.b.orgy)
	}
}

function placeElements(){
	pos = findPos()
	i = 0;
	while (oCMenu.m["top"+i]) {
  		oCMenu.m["top"+i].b.moveX(pos[0]-1);
  		oCMenu.hidesub();
  		/*ii = 0;
  		while (oCMenu.m["top"+i]["sub"+i+""+ii]) {
  			oCMenu.m["top"+i]["sub"+i+""+ii].b.moveX(pos[0]);
  			ii++;
  		}*/
  		i++;
	}
}
// Seite eine halbe Sekunde nach Änderung der Fenstergröße neu laden
oCMenu.onafterresize="placeElements();setTimeout('window.location.reload()', 500)"

// öffnet das aktuelle Menü beim Laden der Seite
if (activeMenu >= 0) oCMenu.showsub("top"+activeMenu);

