// Cycles backgound image - uses script.aculo.us 
  whichbgid = 1;
  whichbg = 0;
  
  indexbgs = ['uploads/images/layout/bg4.jpg',
              'uploads/images/layout/bg3.jpg',
              'uploads/images/layout/bg2.jpg'];
  
  function changeBG()
    {
      var bgelem = "bodybg";
      
      if(whichbgid == 1)
        {
          fadebgelem = bgelem + '1';
          appearbgelem = bgelem + '2';
          whichbgid = 2;
        }
      else
        {
          fadebgelem = bgelem + '2';
          appearbgelem = bgelem + '1';
          whichbgid = 1;
        }
        
      //set innerhtml of appearbg
      $(appearbgelem).innerHTML = '<img src="'+ indexbgs[whichbg] +'" />';
      whichbg++;
      if(whichbg == indexbgs.length)
        whichbg = 0;
      
      var effects = [];
      effects.push(
  			new Effect.Fade(fadebgelem, {sync: true})
  		);
  		effects.push(
  			new Effect.Appear(appearbgelem, {sync: true})
  		);
      
      new Effect.Parallel(effects, {
        duration: 5.0
      });
    }


    Event.observe(window, 'load', function() {
      //initiate bg
      changeBG();
      window.setInterval(changeBG,6000);
    });

