var RAND_IMG_TIMER = 31;

function startRandImgTimer() {
  setTimeout( 'replaceRandImg()', RAND_IMG_TIMER*1000 );
}

function replaceRandImg() {
  var randImgDiv = Ext.fly('randImg');
  randImgDiv.getUpdater().update({
    url:'/core/calendar/randCal.php',
    params: {display: 1},
    scripts: false,
    callback: startRandImgTimer
  });
}

Ext.onReady(function() {
  // startRandImgTimer();

  addMove({
    DIV_ID : 'enCeMoment',
    MOVE_DURATION_SEC : 2,
    PAUSE_DURATION_SEC : 8, //2,
    EASING : 'easeBoth', //'easeNone',
    MOVE_X : -1,
    MOVE_Y : 0,
    changeMove : function() {
      /*
             if (this.MOVE_X == -1) { this.MOVE_X =  0; this.MOVE_Y =  1; }
        else if (this.MOVE_Y ==  1) { this.MOVE_X =  1; this.MOVE_Y =  0; }
        else if (this.MOVE_X ==  1) { this.MOVE_X =  0; this.MOVE_Y = -1; }
        else if (this.MOVE_Y == -1) { this.MOVE_X = -1; this.MOVE_Y =  0; }
      */
      }
    });

  addMove({
    DIV_ID : 'ALaUne',
    MOVE_DURATION_SEC : 4,
    PAUSE_DURATION_SEC : 6, //2,
    EASING : 'easeBoth', //'easeNone',
    MOVE_X : 0,
    MOVE_Y : -1,
    changeMove : function() {
      }
    });

  Ext.Updater.defaults.indicatorText = '';
});
