stepsize = 15
minwidth = 14
maxwidth = 229
active = false

spot = new Array()
spot['menu_home'] = minwidth
spot['menu_downloads'] = minwidth
spot['menu_docs'] = minwidth
spot['menu_links'] = minwidth
spot['menu_contact'] = minwidth

dir = new Array()
dir['menu_home'] = 0
dir['menu_downloads'] = 0
dir['menu_docs'] = 0
dir['menu_links'] = 0
dir['menu_contact'] = 0

function slideout(id) {
  dir[id] = stepsize
  if (!active) animate()
}

function slidein(id) {
  dir[id] = -stepsize
  if (!active) animate()
}

function animate() {
  active = false
  for (var id in spot)
    if (dir[id] != 0) {
      x = spot[id] + dir[id]
      if (x < minwidth) {
        dir[id] = 0
        x = minwidth
      } else if (x > maxwidth) {
        dir[id] = 0
        x = maxwidth
      } else {
        active = true
      }
      spot[id] = x
      document.getElementById(id).style.clip = "rect(auto," + x + "px,auto,auto)"
    }
  if (active) setTimeout("animate()",5)
}

