var arrayObj
var jsArray
var jsArrayLink
var imgCt
var imgIdx
var a
function getVBArray()
{
   arrayObj = makeArrayVB()
   jsArray = VBArray(arrayObj).toArray()
   arrayObj = makeArrayLinks()
   jsArrayLink = VBArray(arrayObj).toArray()
   imgCt = jsArray.length
}
function StartTimer()
{
   getVBArray()
   imgIdx = forma.idx.value
   time = Forma.hours.value % 3600
   Countdown()
}
function Countdown()
{
   if (time == 0)
   {
      time = Forma.hours.value % 3600
      imgIdx++
      if (imgIdx == imgCt)
      {
         imgIdx = 1
      }
      Forma.idx.value = imgIdx
      a = getIndex()
   }
   time--
   Forma.imagen.src = jsArray[Forma.idx.value]
   Forma.display.value = FormatDisplay(time)
   setTimeout("Countdown()",1000)
}
function FormatDisplay(number)
{
 return (number < 10) ? '0' + number : number
}
function newLocation() {
   document.location.href = jsArrayLink[Forma.idx.value]
}
