var w          = false;
var timer      = false;
var menu_bgs   = new Array("f", "a", "b", "c", "d", "e");
var current_bg = false;

window.onload = function() {
  timer = window.setInterval("toggle_menu_bg()", 13000);
}

function edit(page) {
  if (!w || w.closed) {
    w = window.open('/edit.php?page=' + page, 'popup', 'width=571,height=680');
  } else {
    w.focus();
  }
}

function toggle_menu_bg() {
  new_bg = menu_bgs.without(current_bg)[(1 + Math.round(Math.random() * (menu_bgs.without(current_bg).length-1))) - 1];
  if (current_bg) { new Effect.Fade('bg_' + current_bg); }
  new Effect.Appear('bg_' + new_bg);
  current_bg = new_bg;
  document.cookie = "last_bg=" + current_bg;
}

function mp3(file) {
}
