document.addEvent('domready', function() {
 var backgroundTime = 100000;
 var airplaneTime = 30000;

 // Scroll them clouds
 var backgroundScroll = function() {
  var backgroundPosition = $(document.body).getStyle('background-position');
  backgroundPosition = ((backgroundPosition) ? backgroundPosition : '0px 0px').split(' ');

  var backgroundFx = new Fx.Morph($(document.body), {
   fps: 100,
   duration: backgroundTime,
   transition: Fx.Transitions.linear
  }).start({
   'background-position': [backgroundPosition[0] + ' ' + backgroundPosition[1], (backgroundPosition[0].toInt() + 1000) + 'px 0px']
  });
 };
 document.addEvent('domready', backgroundScroll);
 backgroundScroll.periodical(backgroundTime);

 // Fly that airplane

 var airplaneStart = $('airplane').getStyle('right');
 var airplaneFly = function() {
  new Fx.Morph($('airplane'), {
   fps: 100,
   duration: airplaneTime,
   transition: Fx.Transitions.linear
  }).start({
   'right': [(airplaneStart) + 'px', $(document.body).getSize().x + 'px']
  });
 };
 document.addEvent('domready', airplaneFly);
 airplaneFly.periodical(airplaneTime);
 
 $('airplane').addEvent('hover', function() {
  airplaneFly.pauseFx(1000, 'morph');
 });
 
 // Fix PNG's for IE6
 $('homelink').superSleight();
 $('hills').superSleight();
 $('hill-right').superSleight();
 $('hill-left').superSleight();
 $('airplane').superSleight();
 
 // Animation Toggle - We realize that some computers may have problems with
 // the animations present on the site. The option to toggle the animations
 // is granted to the user.

 
 Cufon.replace(['#nav-main li a'], {fontFamily: 'Corbel'});

});
