  whichbgid = 1;
  whichbg = 0;
  
  indexbgs = ['/images/index/1.jpg',
              '/images/index/2.jpg',
              '/images/index/3.jpg',
              '/images/index/4.jpg',
              '/images/index/5.jpg',
              '/images/index/6.jpg',
              '/images/index/7.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: 3.0
      });
    }


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