var Page = {

  init : function(){  
    Accessible.check();
    Thumbs.init();
  }
}  


var Thumbs = {

  init : function(){
  
    var thumbs = $$('#thumbs ul li a');
    for(var i = 0; i < thumbs.length; i++){
    
      if(thumbs[i].className == "current") {
        thumbs[i].set('opacity', '1');        
        continue;
      }
    
      thumbs[i].set('opacity', '0.4');  
      
      thumbs[i].addEvent('mouseover', function(){
        this.fade('in');
      });
      thumbs[i].addEvent('mouseout', function(){
        this.fade('out');
        this.fade('0.4');
      });
    }  
  }
}

var Accessible = {
  
  // Make sure the page is useable at low resolutions
  check : function(){
    var ws = window.getSize();
    var box = $('box');
    var horizon = $('horizon');
    
    if(ws.x < 932 || ws.y < 568) {
      horizon.setStyle('position', 'static');
      box.setStyle('position', 'static');
      box.setStyle('margin-left', 0);

    } else {
      horizon.setStyle('position', 'absolute');
      box.setStyle('position', 'absolute');
      box.setStyle('margin-left', '-466px');
  

    }    
  }  
}


window.addEvent('domready', Page.init);
window.addEvent('resize', Accessible.check);
