var stayFolded=false
//var exImg=new Image(); exImg.src='dsmh.gif'
//var unImg=new Image(); unImg.src='usm.gif'
var dom = (document.getElementById) ? 1:0;
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;
var browser=((n || ie) && parseInt(navigator.appVersion)>=4)

function makeMenu(obj,nest){
	if(!dom){
	        nest=(!nest) ? '':'document.'+nest+'.'
        	this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style')
	        this.ref=(n) ? eval(nest+'document.'+obj+'.document'):eval('document');
	        this.height=n?this.ref.height:eval(obj+'.offsetHeight')
        	this.x=(n)? this.css.left:this.css.pixelLeft;this.y=(n)? this.css.top:this.css.pixelTop;
	}
	else{
		div=document.getElementById(obj);
		this.ref=document.getElementById(obj);
        	this.css=div.style;
	        this.height=div.offsetHeight;
        	this.x=div.offsetLeft;


		this.y=div.offsetTop;
	}
	        this.hideIt=b_hideIt;
	        this.showIt=b_showIt;
		this.vis=b_vis;
		this.moveIt=b_moveIt;


        return this;
}



function b_showIt(){this.css.visibility="visible"}
function b_hideIt(){this.css.visibility="hidden"}
function b_vis(){if(this.css.visibility=="hidden" || this.css.visibility=="hide") return true;}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}





function menu(num){
        if(dom || browser){
                if(!stayFolded){
                        for(i=0;i<oSub.length;i++){
                                if(i!=num){
                                        oSub[i].hideIt()
//                                        oTop[i].ref["imgA"+i].src=unImg.src
                                }
                        }
                        for(i=1;i<oTop.length;i++){
                                oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height)
                        }
                }
                if(oSub[num].vis()){
                        oSub[num].showIt()
//                        oTop[num].ref["imgA"+num].src=exImg.src
                }else{
                        oSub[num].hideIt()
//                        oTop[num].ref["imgA"+num].src=unImg.src
                }
                for(i=1;i<oTop.length;i++){
                        if(!oSub[i-1].vis()) oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height+oSub[i-1].height)
                        else oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height)
                }
        }
}

