var menu1left=0
var menu2left=160
var menu3left=320
var menu4left=480

var menutop=-130
var pace=15
var vorzeimenu1=-1
var vorzeimenu2=-1
var vorzeimenu3=-1
var vorzeimenu4=-1

var step
var direction
var pause=25

var thismenu
var vorzeichen=1

var menuismoving="no"
function inite() {
	if (document.layers) {
        document.menu1.left=menu1left
        document.menu2.left=menu2left
        document.menu3.left=menu3left
	document.menu4.left=menu4left
		
        document.menu1.top=menutop
        document.menu2.top=menutop
        document.menu3.top=menutop
	document.menu4.top=menutop
		
	}	
	if (document.all) {
        document.all.menu1.style.posLeft=menu1left
        document.all.menu2.style.posLeft=menu2left
        document.all.menu3.style.posLeft=menu3left
	document.all.menu4.style.posLeft=menu4left
		
        document.all.menu1.style.posTop=menutop
        document.all.menu2.style.posTop=menutop
        document.all.menu3.style.posTop=menutop
	document.all.menu4.style.posTop=menutop
		
	}
}

function getmenuname(clickedmenu) {
    if (menuismoving=="no") {
	    if (document.layers) {
            thismenu=eval("document."+clickedmenu)
	    }	
	    if (document.all) {
            thismenu=eval("document.all."+clickedmenu+".style")
	    }
        step=pace
        checkdirection()
	    movemenu()
    }
}
function checkdirection() {
	if (document.layers) {    
        if (thismenu==document.menu1){vorzeimenu1=vorzeimenu1*-1;vorzeichen=vorzeimenu1}
        if (thismenu==document.menu2){vorzeimenu2=vorzeimenu2*-1;vorzeichen=vorzeimenu2}
        if (thismenu==document.menu3){vorzeimenu3=vorzeimenu3*-1;vorzeichen=vorzeimenu3}
	if (thismenu==document.menu4){vorzeimenu4=vorzeimenu4*-1;vorzeichen=vorzeimenu4}   
	}	
	if (document.all) {
        if (thismenu==document.all.menu1.style){vorzeimenu1=vorzeimenu1*-1;vorzeichen=vorzeimenu1}
        if (thismenu==document.all.menu2.style){vorzeimenu2=vorzeimenu2*-1;vorzeichen=vorzeimenu2}
        if (thismenu==document.all.menu3.style){vorzeimenu3=vorzeimenu3*-1;vorzeichen=vorzeimenu3}
	if (thismenu==document.all.menu4.style){vorzeimenu4=vorzeimenu4*-1;vorzeichen=vorzeimenu4}
	}
    menuismoving="yes"
}

function movemenu() {
	if (document.layers) {
        if (step>=0) {
            thismenu.top+=step*vorzeichen
            step--
            var movetimer=setTimeout("movemenu()",pause)  
	    }
        else {
            menuismoving="no"
            clearTimeout(movetimer)
        }
	}	   
	if (document.all) {
        if (step>=0) {
            thismenu.posTop+=step*vorzeichen
            step--
            var movetimer=setTimeout("movemenu()",pause)  
	    }
        else {
            menuismoving="no"
            clearTimeout(movetimer)
        }
    }
}
