var imgs = new Array();
var imgso = new Array();
var loaded = 0;
function preloadMenu()
{
  var menuCnt = 17;
  for (var i = 1; i < menuCnt+1; i++) {
    imgs[i] = new Image(); imgs[i].src = 'images/design/menu/menu' + i + '.gif';
    imgso[i] = new Image(); imgso[i].src = 'images/design/menu/menu' + i + 'o.gif';
  }
  loaded = 1;
}

function changeImg(n, s)
{
  if (loaded != 0) (!s) ? $('menu'+n).src = imgs[n].src : $('menu'+n).src = imgso[n].src;
}

function callBackTimer(n)
{
  if (document.images && loaded) {
    (Prototype.Browser.IE) ? $(n).filters.alpha.opacity = 0 : $(n).style.MozOpacity=0;
  }
}

function hideImg(n)
{
  if (document.images && loaded) {
    var effect = new Spry.Effect.Fade($(n).id, {from: 100, to: 0, duration: 300, toggle: true, transition: Spry.linearTransition, fps: 60});
    effect.start();
    setTimeout('callBackTimer('+$(n).id+')', 500);
  }
}

function showImg(n)
{
  if (document.images && loaded) {
    var effect = new Spry.Effect.Fade($(n).id, {from: 0, to: 100, duration: 300, toggle: true, transition: Spry.linearTransition, fps: 60});
    effect.start();
  }
}