init = function(){
  initRolloverImgs();
  page(1);
}

initRolloverImgs = function(){
  var img, loader, lowSrc, highSrc;
  var imgs = $A(document.images);
  var re = /(.*)\.(.*)\?ro/;
  
  imgs.each(function(img){
    if (re.exec(img.src)){
      img.lowSrc  = img.src;
      img.highSrc = RegExp.$1+'-a.'+RegExp.$2;
      loader      = new Image(); 
      loader.src  = img.highSrc;
      
      img.onmouseover = function(e){ this.src = this.highSrc; };
      img.onmouseout  = function(e){ this.src = this.lowSrc; };
    }
  });    
}

switchOn = function(stack, nr){
  var el = 'switch_'+stack+'_'+nr;
  Element.show(el);
  if (switchOn.active && (switchOn.active != el)) Element.hide(switchOn.active);
  switchOn.active = el;
}

page = function(nr){
  var pager = $('pager_'+nr);
  pager.blur()
  $('page_img').src="img/"+nr+".jpg";
  pager.addClassName('active');
  if (page.active) page.active.removeClassName('active');
  page.active = pager;
}
