//this file has the declaration and definition of all common JavaScript
// functions called by our pages. This file should be called by all
//the pages using the <script src="/cgi-bin/ads/adlist.js"> </script> tag
//in the header portion of the document

  //location of ad-bars (all ad-bars must be in this directory)
addir = "/template/adbars/"


   //define no. of ads (for ad-bar generation)
max = 10

  //arrays defined for ad-bar generation
image = new Array(10)
url = new Array(10)
title = new Array(10)

//now, description,  name of each image and its corrresponding HTML link

/*title[0] = ""
image[0] = ""
url[0] = ""
*/


title[1] = "SME Link Nepal"
image[1] = "smelink-bar.gif"
url[1] = "http://www.smelink.com.np/"

title[2] = "Hotel Shanker"
image[2] = "shanker-bar.gif"
url[2] = "http://www.shanker.com.np/"

title[3] = "Innoxa Pashmina Nepal"
image[3] = "innoxa-bar.gif"
url[3] = "http://www.innoxa.com.np/"

title[4] = "Netfornepal"
image[4] = "netfornepal-bar.gif"
url[4] = "http://www.netfornepal.com/"

title[5] = "Celtic Trekking Adventure"
image[5] = "celtic-bar.gif"
url[5] = "http://www.celtictrekking.com/"

title[6] = "Nepal Development Gateway"
image[6] = "gateway-bar.gif"
url[6] = "http://www.nepalgateway.org/"

title[7] = "Kathmandu Mart"
image[7] = "kmart-bar.gif"
url[7] = "http://www.kathmandumart.com/"

title[8] = "Nepa Rudraksha"
image[8] = "rudraksha-bar.gif"
url[8] = "http://www.nepalirudraksha.com/"

title[9] = "Marco Polo Travels"
image[9] = "marcopolo-bar.gif"
url[9] = "http://www.marcopolo.com.np/"

title[10] = "Nepal PRSP"
image[10] = "prsp-bar.gif"
url[10] = "http://www.nepalprsp.org/"

 //this function returns a random ad-bar with its correponding link
    function returnadbar() {
    //first get random no. between 1 and max
  n = Math.round((max*Math.random()) + 0.5)
    //then write the image and link to the HTML file
  document.write("<a href =" + url[n] + " ><img src = " + addir + image[n] + " WIDTH=240 HEIGHT=33 BORDER=0 ></a>")
  }


   //this function returns a list of all the ads
    function getallads() {
   document.write("<p> <H3>This is the list of ad-bars you will see in our pages.</H3> <p> ")
   document.write("<UL>")
       for (var i = 1; i <= max; i++) {
       document.write("<LI> <a href =" + url[i] + "> " + title[i] + "</a> <br> ")
       }
   document.write("</UL>")
   }
