var RocketColumns = {
	initialize: function() {
	  $$('.numbered-guide-wrapper').each(function(col) {
	    var colWidth = (Prototype.Browser.IE) ? '380px' : '365px';
	    col.makeClipping().setStyle({width:colWidth, height:'658px'});	      
	  });
    $('windows_1_content','windows_2_content').invoke('setStyle', {top:'2000px', position:'relative'});
    this.currentSection = 'macosx';
	},
  showSection: function(event, section) {
    if(section == this.currentSection) return;
    this.hideCurrentSection();
    this.flyIn(section+'_1_content', 0.2);
    this.flyIn(section+'_2_content', 0.5);
    this.changeHeadline(section);
    this.setActiveTab(section);
    this.currentSection = section;
  },
  flyOut: function(element) {
    element = $(element);
    var delay = arguments[1] || 0;
    element.setStyle({position:'relative'}).morph('top:-1000px', {
      duration:1.5, 
      delay:delay
    });
  },
  flyIn: function(element) {
    $(element).setStyle({top:'658px'});
    var delay = arguments[1] || 0;
    $(element).morph('top:0px', {
      duration:1.3, 
      delay:delay
    });
  },
  hideCurrentSection: function() {
    this.flyOut(this.currentSection+'_1_content', 0.2);
    this.flyOut(this.currentSection+'_2_content');
  },
  changeHeadline: function(section) {
    $$('.tools-download-box').invoke('hide');
    if (section == 'windows') 
      $('download_pc').show();
    else
      $('download_mac').show();
    
  },
  setActiveTab: function(section) {
    $$('ul#choose_os li a').invoke('removeClassName', 'active');
    $('tab_'+section).addClassName('active');
  }
}

Event.observe(window, 'load', function(event) { 
  RocketColumns.initialize();
  if(navigator.platform.indexOf('Mac') == -1)
    RocketColumns.showSection(null, 'windows');
});