﻿var rotatorID;

function changeSelection(sender, args, directIndex) {
  var targetIndex = 0;
  var rotator = $find(rotatorID);
  var itemCount = 0;

  if (rotator != null) {
    itemCount = rotator.get_items().length;
  }
  
  if (directIndex != null) {
    targetIndex = directIndex;
    if (rotator != null) {
      rotator.stop();
      rotator.remove_itemShowing(changeSelection);
      rotator.set_currentItemIndex(directIndex);
      rotator.add_itemShowing(changeSelection);
    }
  }
  if (args != null && args.get_item()) {
    targetIndex = args.get_item().get_index() + 1;
  }
  if (targetIndex == itemCount) targetIndex = 0;
  for (i = 0; i < itemCount; i++) {
    if (i == targetIndex) {
      document.getElementById("divLOB" + i).className = "LOBItemSel";
    }
    else {
      document.getElementById("divLOB" + i).className = "LOBItem";
    }
  }
}
function restartRotator() {
  //var rotator = $find('<%= RadRotator1.ClientID %>');
  //rotator.start();
}

