// JavaScript Document

//The arrays for the cycling cover blocks
adImages1 = new Array ("images/aidsblock.gif",                           "images/pmt.gif")
adURL1 = new Array("lesothointernetdirectory.com",                       "lesothointernetdirectory.com/pmt")
adImages2 = new Array("images/sheeran.gif",                              "images/mkburialblock.gif")
adURL2 = new Array("lesothointernetdirectory.com/sheeran",               "lesothointernetdirectory.com/mkburial")
adImages3 = new Array("images/snablock.gif",                             "images/nthatuoa.gif")
adURL3 = new Array("lesothointernetdirectory.com/sna",                   "lesothointernetdirectory.com/nthatuoa")
adImages4 = new Array("images/ppfreight.gif",                            "images/tlengine.gif")
adURL4 = new Array("lesothointernetdirectory.com/ppfreight",             "lesothointernetdirectory.com/tlengineering")
adImages5 = new Array("images/ecolblock.gif",                            "images/lhwpblock.gif")
adURL5 = new Array("lesothointernetdirectory.com/ecol",                  "lhwp.org.ls")
adImages6 = new Array("images/mokhotlongblock.gif",                      "images/tilblock.gif")
adURL6 = new Array("lesothointernetdirectory.com/mokhotlong",            "lesothointernetdirectory.com/til")
adImages7 = new Array("images/elizabeth.gif")
adURL7 = new Array("lesothointernetdirectory.com/elizabeth")
adImages8 = new Array("images/glfuneral.gif")
adURL8 = new Array("lesothointernetdirectory.com/glfuneral")

 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
   }
 }