// Data for rotating images
var RotCardSpeed = 5000
var ColHl = "#FFFFE0"
var ColBg = "#F4F4F4"
var RotBase = new Array("Catalogue","DTE-3100","DTA-107S2","DTA-115","DTA-2137","DTA-2160",
						"DTU-215","DTU-245","DTC-320","DTC-700","DTC-720","DTC-342","DTC-378")
var RotPath = new Array(".","IP","PCI","PCI","PCIe","PCIe","USB2","USB2","Apps","Apps","Apps","Apps","Apps")
var RotExt = new Array(
  "DekTec catalogue 2009",
  "TSoIP to ASI; Power-over-Ethernet enabled",
  "DVB-S2 modulator / L-band upconverter",
  "Multi-standard VHF/UHF modulator",
  "PCI Express dual-channel DVB-S2 receiver",
  "PCI Express GigE + 3xASI ports",
  "USB-2 VHF/UHF modulator",
  "ASI/SDI input+output for USB-2",
  "StreamXpert analyser software",
  "MuxXpert real-time Transport-Stream multiplexer",
  "Xpect 24/7 Transport-Stream monitoring",
  "DVB-T2 test receiver VHF/UHF",
  "DVB-T2 signal generator"
)
var RotUrl = new Array()
var RotAlt = new Array()
var RotIdx = 1
var RotImg = new Array()
var FilterSupport = window.createPopup

function NextRotCard() {
  if (!FilterSupport) {
    document.getElementById(RotBase[RotIdx]+"A").className = 'code'
    document.getElementById(RotBase[RotIdx]+"B").className = 'productName'
    document.getElementById(RotBase[RotIdx]+"C").className = 'product'
  }
  RotIdx = (RotIdx<RotBase.length-1) ? RotIdx+1 : 0
  if (FilterSupport) document.images.RotCard.filters[0].apply()
  document.images.RotCard.src = RotImg[RotIdx].src
  document.images.RotCard.title = RotAlt[RotIdx]
  if (FilterSupport) {
    document.images.RotCard.filters[0].play()
    setTimeout("ShiftProdTab()", document.images.RotCard.filters[0].duration*600)
  } else {
    document.getElementById(RotBase[RotIdx]+"A").className = 'code'
    document.getElementById(RotBase[RotIdx]+"B").className = 'productNameHL'
    document.getElementById(RotBase[RotIdx]+"C").className = 'productHL'
  }
  setTimeout("NextRotCard()", RotCardSpeed)
}
function ShiftProdTab() {
  var PrevIndex = (RotIdx==0) ? RotBase.length-1 : RotIdx-1          
  document.getElementById(RotBase[PrevIndex]+"A").className = 'code'
  document.getElementById(RotBase[PrevIndex]+"B").className = 'productName'
  document.getElementById(RotBase[PrevIndex]+"C").className = 'product'
  document.getElementById(RotBase[RotIdx]+"A").className = 'code'
  document.getElementById(RotBase[RotIdx]+"B").className = 'productNameHL'
  document.getElementById(RotBase[RotIdx]+"C").className = 'productHL'
}
function IndexOnLoad() {
  // Create string arrays
  for (i=0; i<RotBase.length; i++) {
    RotAlt[i] = RotBase[i] + " - " + RotExt[i]
    RotUrl[i] = "Products/" + RotPath[i] + "/" + RotBase[i] + "/"
  }
  document.images.RotCard.title = RotAlt[RotIdx]
  document.getElementById(RotBase[RotIdx]+"A").className = 'code'
  document.getElementById(RotBase[RotIdx]+"B").className = 'productNameHL'
  document.getElementById(RotBase[RotIdx]+"C").className = 'productHL'
  // Load images
  for (i=0; i<RotBase.length; i++) {
    RotImg[i] = new Image()
    RotImg[i].src =  "images/Rotating/" + RotBase[i] + ".png"
  }
  setTimeout("NextRotCard()", RotCardSpeed)
}
function RotCardLink()  {
  window.location.href = RotUrl[RotIdx];
}