var HeroController = new Class({
  
  heroWidth: 1440,
  windowWidth: 0,
  
  initialize: function()
  {
  },
  
  resize: function()
  {
    this.windowWidth = $('hero-wrap').getSize().x;
    
    // make sure we have a valid number
    if(this.windowWidth == 0 || this.windowWidth === undefined)
      return;
    
    var leftPos = ((this.windowWidth - this.heroWidth) / 2);
    
    $$(" div#hero").each(function(el){
      el.setStyle('left', leftPos); 
    });
  }
  
});



var heroController = false;
window.addEvent('domready', function(){
  heroController = new HeroController();
  heroController.resize();
});

window.addEvent('resize', function(){
  if(heroController)
    heroController.resize();
});

