// Set the starting position of the categories of your menu
var menu1top=-127
var menuleft=0

// This number configures the length and the speed of the menu-movement. 
// Play around with it until you are satisfied.
var pace=15

// Don't change the variables below.
var step
var direction
var pause=25

var thismenu
var vorzeichen=1
var vorzeimenu1=-1

var menuismoving="no"


function inite() {
	if (document.layers) {
        document.menu1.left=menuleft
        document.menu1.top=menu1top
	}	
	if (document.all) {
        document.all.menu1.style.posLeft=menuleft
        document.all.menu1.style.posTop=menu1top
	}
}

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 (document.all) {
        if (thismenu==document.all.menu1.style){vorzeimenu1=vorzeimenu1*-1;vorzeichen=vorzeimenu1}
	}
    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)
        }
    }
}
