// JavaScript Document

//The arrays for the cycling cover blocks
adImages1 = new Array ("images/bobsblock.gif",         "images/shumbablock.gif",     "images/cpurchasing.gif",               "images/pelbot2block.gif",             "images/njprivblock.gif",       "images/btv.gif",                 "images/fortressblock.gif")
adURL1 = new Array ("botsid.com/bobs",                 "botsid.com/shumba",          "botsid.com/central",                   "botsid.com/pelbot2",                  "botsid.com/njpriv",            "botsid.com/btv",                 "botsid.com/fortress")
adImages2 = new Array ("images/bobirwa3.gif",          "images/xerotechblock.gif",   "images/vanguardrenblock.gif",          "images/babishblock.gif",              "images/cresta.jpg",            "images/ttcblock.gif",            "images/abronblock.gif")
adURL2 = new Array ("botsid.com",                      "botsid.com/xerotech",        "botsid.com/vanguard",                  "botsid.com/babish",                   "botsid.com/crestalodge",       "botsid.com/ttc",                 "botsid.com/abron")
adImages3 = new Array ("images/botsrailblock.gif",     "images/modumoblock.gif",     "images/botec.gif",                     "images/lobatsetileblock.gif",         "images/tafsblock.gif",         "images/tsholeblock.gif",         "images/safetysblock.gif")
adURL3 = new Array ("botsid.com/botsrail",             "botsid.com/modumo",          "botsid.com/botec",                     "botsid.com/lobatsetile",              "botsid.com/tafs",              "botsid.com/tshole",              "botsid.com/safetys")
adImages4 = new Array ("images/gaboronesunblock.gif",  "images/tawanablock.gif",     "images/mewblock.gif",                  "images/creativemindsblock.gif",       "images/ripblock.gif",          "images/malomeblock.gif",         "images/gwestblock.gif")
adURL4 = new Array ("botsid.com/gaboronesun",          "botsid.com/tawanasec",       "botsid.com/mew",                       "botsid.com/creativeminds",            "botsid.com/rip",               "botsid.com/malome",              "botsid.com/gwest")
adImages5 = new Array ("images/cpwblock.gif",          "images/stjosephblock.gif",   "images/tonyblock.gif",                 "images/bchmblock.gif",                "images/botec.gif",             "images/marothodiblock.gif",      "images/codanetblock.gif")
adURL5 = new Array ("botsid.com/cpw",                  "botsid.com/stjoseph",        "botsid.com/tony",                      "botsid.com/bchm",                     "botsid.com/botec",             "botsid.com/marothodi",           "botsid.com/codanet")
adImages6 = new Array ("images/trojanblock.gif",       "images/mokolodi.gif",        "images/sang3.gif",                     "images/drts.gif",                     "images/botswanameat.gif",      "images/sbmblock.gif",            "images/botecblock.gif")
adURL6 = new Array ("botsid.com/trojan",               "botsid.com/mokolodi",        "botsid.com/sang",                      "botsid.com/deprts",                   "botsid.com/botswanameat",      "botsid.com/sbm",                 "botsid.com/botec")
adImages7 = new Array ("images/meksblock.gif",         "images/directblock.gif",     "images/rollerdoorblock.gif",           "images/nftrc.gif",                    "images/usaid1.gif",            "images/arctezblock.gif",         "images/morupuleblock.gif")
adURL7 = new Array ("botsid.com/meks",                 "botsid.com/direct",          "botsid.com/rollerdoor",                "botsid.com/nftrc",                    "botsid.com/usaid",             "botsid.com/arctez",              "sadctradeindex.com/morupule")
adImages8 = new Array ("images/mowanablock.gif",       "images/milkblock.gif",       "images/thusanyo3.gif",                 "images/ghanzibrigblock.gif",          "images/okavango2.gif")
adURL8 = new Array ("botsid.com/mowana",               "botsid.com/milkwood",        "botsid.com/thusanyo",                  "botsid.com/ghanzibrig",               "botsid.com/okavango")

 thisAd1 = 0
 thisAd2 = 0
 thisAd3 = 0
 thisAd4 = 0
 thisAd5 = 0
 thisAd6 = 0
 thisAd7 = 0
 thisAd8 = 0

 imgCt1  = adImages1.length
 imgCt2  = adImages2.length
 imgCt3  = adImages3.length
 imgCt4  = adImages4.length
 imgCt5  = adImages5.length
 imgCt6  = adImages6.length
 imgCt7  = adImages7.length
 imgCt8  = adImages8.length
 
 //Functions to cycle through image arrays
 function rotate1() {
   if(document.images) {
     thisAd1++
     if(thisAd1 == imgCt1) {
       thisAd1 = 0
     }
     document.adBlock1.src = adImages1[thisAd1]
     setTimeout("rotate1()", 5 * 1000)
   }
 }

  function rotate2() {
   if(document.images) {
     thisAd2++
     if(thisAd2 == imgCt2) {
       thisAd2 = 0
     }
     document.adBlock2.src = adImages2[thisAd2]
     setTimeout("rotate2()", 5 * 1000)
   }
 }


  function rotate3() {
   if(document.images) {
     thisAd3++
     if(thisAd3 == imgCt3) {
       thisAd3 = 0
     }
     document.adBlock3.src = adImages3[thisAd3]
     setTimeout("rotate3()", 5 * 1000)
   }
 }

 function rotate4() {
  if(document.images) {
    thisAd4++
    if(thisAd4 == imgCt4) {
      thisAd4 = 0
    }
    document.adBlock4.src = adImages4[thisAd4]
    setTimeout("rotate4()", 5 * 1000)
   }
 }

  function rotate5() {
   if(document.images) {
     thisAd5++
     if(thisAd5 == imgCt5) {
       thisAd5 = 0
     }
     document.adBlock5.src = adImages5[thisAd5]
     setTimeout("rotate5()", 5 * 1000)
   }
 }

 function rotate6() {
   if(document.images) {
     thisAd6++
     if(thisAd6 == imgCt6) {
       thisAd6 = 0
     }
     document.adBlock6.src = adImages6[thisAd6]
     setTimeout("rotate6()", 5 * 1000)
   }
 }

 function rotate7() {
   if(document.images) {
     thisAd7++
     if(thisAd7 == imgCt7) {
       thisAd7 = 0
     }
     document.adBlock7.src = adImages7[thisAd7]
     setTimeout("rotate7()", 5 * 1000)
   }
 }

 function rotate8() {
   if(document.images) {
     thisAd8++
     if(thisAd8 == imgCt8) {
       thisAd8 = 0
     }
     document.adBlock8.src = adImages8[thisAd8]
     setTimeout("rotate8()", 5 * 1000)
   }
 }
 
 //functions for the cycling banner links

 function newLocation1() {
    document.location.href = "http://www."+ adURL1[thisAd1]
  }

 function newLocation2() {
    document.location.href = "http://www."+ adURL2[thisAd2]
  }

 function newLocation3() {
    document.location.href = "http://www."+ adURL3[thisAd3]
  }

 function newLocation4() {
    document.location.href = "http://www."+ adURL4[thisAd4]
  }
 
 function newLocation5() {
    document.location.href = "http://www."+ adURL5[thisAd5]
  }

 function newLocation6() {
    document.location.href = "http://www."+ adURL6[thisAd6]
  }

 function newLocation7() {
    document.location.href = "http://www."+ adURL7[thisAd7]
  }

 function newLocation8() {
    document.location.href = "http://www."+ adURL8[thisAd8]
  }
  
//Function to open link window
function navi(newLoc) {
   newPage = newLoc.options[newLoc.selectedIndex].value

   if(newPage != ""){
      window.location.href = newPage
   }
 }