// JavaScript Document

//The arrays for the cycling cover blocks
adImages1 = new Array ("images/catholicblock.gif",           "images/honda3.gif",                    "images/kafubublock.gif",            "images/seebro1.jpg",                 "images/gawblock.gif",            "images/maersk-block.gif")
adURL1 = new Array("zaminternet.com/catholic",               "zaminternet.com/honda",                "zaminternet.com",                   "zaminternet.com/seebro",             "zaminternet.com/gaw",             "zaminternet.com/maersk")
adImages2 = new Array("images/copperbeltblock.gif",          "images/isl2.jpg",                      "images/lunsemfwa2.gif",             "images/setrecblock.gif",             "images/benaublock.gif",          "images/steelbase-block.gif")
adURL2 = new Array("zaminternet.com/copperbelt",             "ecis.org/lusaka",                      "zaminternet.com/lunsemfwa",         "zaminternet.com/sectrec",            "zaminternet.com/benaubanner.gif",   "zaminternet.com/steelbase")
adImages3 = new Array("images/norgroup.gif",                 "images/mac2.gif",                      "images/abhayblock.gif",             "images/trampoblock.gif",             "images/japenblock.gif")
adURL3 = new Array("zaminternet.com/norgroup",               "zaminternet.com",                      "zaminternet.com/abhay",             "zaminternet.com/trampo",             "zaminternet.com/japen")
adImages4 = new Array("images/cisongoblock.gif",             "images/lusakawaterblock.gif",          "images/benmakblock.gif",            "images/zesco1.gif",                  "images/mvsblock.gif")
adURL4 = new Array("zaminternet.com/cisongo",                "zaminternet.com/lusakawater",          "zaminternet.com/benmak",            "zesco.co.zm",                        "zaminternet.com/mvs")
adImages5 = new Array("images/drilltechblock.gif",           "images/usembassyblock.gif",            "images/chrismarblock.gif",          "images/lusaka.gif",                  "images/keblock.gif")
adURL5 = new Array("zaminternet.com/drilltech",              "zaminternet.com",                      "chrismar.co.zm",                    "lcc.gov.zm",                         "zaminternet.com/ke")
adImages6 = new Array("images/coppernetblock.gif",           "images/tiacblock.gif",                 "images/gamma1.gif",                 "images/eczamblock.gif",              "images/gibblock.gif")
adURL6 = new Array("zaminternet.com/coppernet",              "zaminternet.com/tiac",                 "zaminternet.com/gamma",             "zaminternet.com/exam",               "zaminternet.com/gib")
adImages7 = new Array("images/nchblock.gif",                 "images/zamairblock.gif",               "images/gtm.jpg",                    "images/cfb2.gif",                    "images/sccblock.gif")
adURL7 = new Array("zaminternet.com/nch",                    "zaminternet.com",                      "zaminternet.com",                   "zaminternet.com/cfb",                "zaminternet.com/scc")
adImages8 = new Array("images/zabblock.gif",                 "images/norconsultblock.gif",           "images/fida2.gif",                  "images/accblock.gif",                "images/zapeblock.gif")
adURL8 = new Array("zaminternet.com/zab",                    "norconsult.co.zm",                     "zaminternet.com/fida",              "zaminternet.com/acc",                "zaminternet.com/zape")

 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.adBanner1.src = adImages1[thisAd1]
     setTimeout("rotate1()", 5 * 1000)
   }
 }

  function rotate2() {
   if(document.images) {
     thisAd2++
     if(thisAd2 == imgCt2) {
       thisAd2 = 0
     }
     document.adBanner2.src = adImages2[thisAd2]
     setTimeout("rotate2()", 5 * 1000)
   }
 }


  function rotate3() {
   if(document.images) {
     thisAd3++
     if(thisAd3 == imgCt3) {
       thisAd3 = 0
     }
     document.adBanner3.src = adImages3[thisAd3]
     setTimeout("rotate3()", 5 * 1000)
   }
 }

  function rotate4() {
   if(document.images) {
     thisAd4++
     if(thisAd4 == imgCt4) {
       thisAd4 = 0
     }
     document.adBanner4.src = adImages4[thisAd4]
     setTimeout("rotate4()", 5 * 1000)
   }
 }

  function rotate5() {
   if(document.images) {
     thisAd5++
     if(thisAd5 == imgCt5) {
       thisAd5 = 0
     }
     document.adBanner5.src = adImages5[thisAd5]
     setTimeout("rotate5()", 5 * 1000)
   }
 }

 function rotate6() {
   if(document.images) {
     thisAd6++
     if(thisAd6 == imgCt6) {
       thisAd6 = 0
     }
     document.adBanner6.src = adImages6[thisAd6]
     setTimeout("rotate6()", 5 * 1000)
   }
 }

 function rotate7() {
   if(document.images) {
     thisAd7++
     if(thisAd7 == imgCt7) {
       thisAd7 = 0
     }
     document.adBanner7.src = adImages7[thisAd7]
     setTimeout("rotate7()", 5 * 1000)
   }
 }

 function rotate8() {
   if(document.images) {
     thisAd8++
     if(thisAd8 == imgCt8) {
       thisAd8 = 0
     }
     document.adBanner8.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
   }
 }