function getRandom(max) {return (Math.floor(Math.random()*max))+1;}

//  Determine depth
     if (DepthOfPage == 0) { depth = ""; }
else if (DepthOfPage == 1) { depth = "../"; }
else if (DepthOfPage == 2) { depth = "../../"; }
else if (DepthOfPage == 3) { depth = "../../../"; }
else if (DepthOfPage == 4) { depth = "../../../../"; }
else if (DepthOfPage == 5) { depth = "../../../../../"; }
else if (DepthOfPage == 6) { depth = "../../../../../../"; }

BannerLine = new Array();
BannerLine[1]  = "<!-- animation factory --><a href=\"http://www.qksrv.net/click-517001-14637\" target=\"_top\"><img src=\"" + depth + "tack/adpics/animationfactory_468x60_1.gif\" width=\"468\" height=\"60\" alt=\"1000's of Animations and Web Graphics\" border=\"0\"></a>";
BannerLine[2]  = "<!-- animation factory --><a href=\"http://www.qksrv.net/click-517001-14617\" target=\"_top\"><img src=\"" + depth + "tack/adpics/animationfactory_468x60_2.gif\" width=\"468\" height=\"60\" alt=\"Free Animations\" border=\"0\"></a>";
BannerLine[3]  = "<!-- animation factory --><a href=\"http://www.qksrv.net/click-517001-14637\" target=\"_top\"><img src=\"" + depth + "tack/adpics/animationfactory_468x60_3.gif\" width=\"468\" height=\"60\" alt=\"1000's of Animations and Web Graphics\" border=\"0\"></a>";
BannerLine[4]  = "<!-- animation factory --><a href=\"http://www.qksrv.net/click-517001-14637\" target=\"_top\"><img src=\"" + depth + "tack/adpics/animationfactory_468x60_3.gif\" width=\"468\" height=\"60\" alt=\"1000's of Animations and Web Graphics\" border=\"0\"></a>";
BannerLine[5]  = "<!-- marketingtips.com --><a href=\"http://www.marketingtips.com/t.cgi/46811/\" target=\"_blank\"><img src=\"" + depth + "tack/adpics/marketingtips_468x60_1.gif\" border=\"0\" width=\"468\" height=\"60\" ALT=\"Increase online sales!\"></a>";
BannerLine[6]  = "<!-- marketingtips.com --><a href=\"http://www.marketingtips.com/t.cgi/46811/\" target=\"_blank\"><img src=\"" + depth + "tack/adpics/marketingtips_468x60_2.gif\" border=\"0\" width=\"468\" height=\"60\" ALT=\"Increase online sales!\"></a>";
BannerLine[7]  = "<!-- marketingtips.com --><a href=\"http://www.marketingtips.com/t.cgi/46811/\" target=\"_blank\"><img src=\"" + depth + "tack/adpics/marketingtips_468x60_3.gif\" border=\"0\" width=\"468\" height=\"60\" ALT=\"Increase online sales!\"></a>";
BannerLine[8]  = "<!-- marketingtips.com --><a href=\"http://www.marketingtips.com/t.cgi/46811/\" target=\"_blank\"><img src=\"" + depth + "tack/adpics/marketingtips_468x60_4.gif\" border=\"0\" width=\"468\" height=\"60\" ALT=\"Increase online sales!\"></a>";
BannerLine[9]  = "<!-- nomonthlyfees.com --><A HREF=\"http://service.bfast.com/bfast/click?bfmid=12768212&siteid=22315569&bfpage=home\" TARGET=\"_top\"><IMG SRC=\"" + depth + "tack/adpics/nomonthlyfees_468x60_1.gif\" border=\"0\" WIDTH=\"468\" HEIGHT=\"60\" ALT=\"www.NoMonthlyFees.com\"></A>";
BannerLine[10]  = "<!-- nomonthlyfees.com --><A HREF=\"http://service.bfast.com/bfast/click?bfmid=12768212&siteid=22315569&bfpage=home\" TARGET=\"_top\"><IMG SRC=\"" + depth + "tack/adpics/nomonthlyfees_468x60_2.gif\" border=\"0\" WIDTH=\"468\" HEIGHT=\"60\" ALT=\"www.NoMonthlyFees.com\"></A>";
BannerLine[11]  = "<!-- nomonthlyfees.com --><A HREF=\"http://service.bfast.com/bfast/click?bfmid=12768212&siteid=22315569&bfpage=home\" TARGET=\"_top\"><IMG SRC=\"" + depth + "tack/adpics/nomonthlyfees_468x60_3.gif\" border=\"0\" WIDTH=\"468\" HEIGHT=\"60\" ALT=\"www.NoMonthlyFees.com\"></A>";
BannerLine[12]  = "<!-- nomonthlyfees.com --><A HREF=\"http://service.bfast.com/bfast/click?bfmid=12768212&siteid=22315569&bfpage=home\" TARGET=\"_top\"><IMG SRC=\"" + depth + "tack/adpics/nomonthlyfees_468x60_3.gif\" border=\"0\" WIDTH=\"468\" HEIGHT=\"60\" ALT=\"www.NoMonthlyFees.com\"></A>";
BannerLine[13]  = "<!-- gifart --><a href=\"http://www.gifart.com/cgi-bin/affiliate/clickthru.cgi/jbarta\"><img src=\"" + depth + "tack/adpics/gifart_468x60_1.gif\" border=\"0\" WIDTH=\"468\" HEIGHT=\"60\"  ALT=\"Click here for Clipart!\"></a>";
BannerLine[14]  = "<!-- gifart --><a href=\"http://www.gifart.com/cgi-bin/affiliate/clickthru.cgi/jbarta\"><img src=\"" + depth + "tack/adpics/gifart_468x60_2.gif\" border=\"0\" WIDTH=\"468\" HEIGHT=\"60\"  ALT=\"Click here for Clipart!\"></a>";
BannerLine[15]  = "<!-- gifart --><a href=\"http://www.gifart.com/cgi-bin/affiliate/clickthru.cgi/jbarta\"><img src=\"" + depth + "tack/adpics/gifart_468x60_3.gif\" border=\"0\" WIDTH=\"468\" HEIGHT=\"60\"  ALT=\"Click here for Clipart!\"></a>";
BannerLine[16]  = "<!-- affordablehost --><a href=\"http://www.affordablehost.com/pagetutor.html\" target=\"_top\"><img src=\"" + depth + "tack/adpics/affordablehost_468x60_1.gif\" width=\"468\" height=\"60\" alt=\"\" border=\"0\"></a>";
BannerLine[17]  = "<!-- affordablehost --><a href=\"http://www.affordablehost.com/pagetutor.html\" target=\"_top\"><img src=\"" + depth + "tack/adpics/affordablehost_468x60_2.gif\" width=\"468\" height=\"60\" alt=\"\" border=\"0\"></a>";
BannerLine[18]  = "<!-- affordablehost --><a href=\"http://www.affordablehost.com/pagetutor.html\" target=\"_top\"><img src=\"" + depth + "tack/adpics/affordablehost_468x60_1.gif\" width=\"468\" height=\"60\" alt=\"\" border=\"0\"></a>";
BannerLine[19]  = "<!-- affordablehost --><a href=\"http://www.affordablehost.com/pagetutor.html\" target=\"_top\"><img src=\"" + depth + "tack/adpics/affordablehost_468x60_2.gif\" width=\"468\" height=\"60\" alt=\"\" border=\"0\"></a>";
BannerLine[20]  = "<!-- notetab --><a href=\"https://www.regnow.com/softsell/visitor.cgi?affiliate=4585&action=site&vendor=1609\" target=\"_top\"><img src=\"" + depth + "tack/adpics/notetab_468x60_1.gif\" width=\"468\" height=\"60\" alt=\"\" border=\"0\"></a>";
BannerLine[21]  = "<!-- notetab --><a href=\"https://www.regnow.com/softsell/visitor.cgi?affiliate=4585&action=site&vendor=1609\" target=\"_top\"><img src=\"" + depth + "tack/adpics/notetab_468x60_1.gif\" width=\"468\" height=\"60\" alt=\"\" border=\"0\"></a>";
BannerLine[22]  = "<!-- notetab --><a href=\"https://www.regnow.com/softsell/visitor.cgi?affiliate=4585&action=site&vendor=1609\" target=\"_top\"><img src=\"" + depth + "tack/adpics/notetab_468x60_1.gif\" width=\"468\" height=\"60\" alt=\"\" border=\"0\"></a>";
BannerLine[23]  = "<!-- notetab --><a href=\"https://www.regnow.com/softsell/visitor.cgi?affiliate=4585&action=site&vendor=1609\" target=\"_top\"><img src=\"" + depth + "tack/adpics/notetab_468x60_1.gif\" width=\"468\" height=\"60\" alt=\"\" border=\"0\"></a>";


GifartLine = new Array();
GifartLine[1]  = "<!-- gifart --><a href=\"http://www.gifart.com/cgi-bin/affiliate/clickthru.cgi/jbarta\"><img src=\"" + depth + "tack/adpics/gifart1.gif\" border=\"0\" WIDTH=\"120\" HEIGHT=\"240\" ALT=\"Click here for Clipart!\"></a>";
GifartLine[2]  = "<!-- gifart --><a href=\"http://www.gifart.com/cgi-bin/affiliate/clickthru.cgi/jbarta\"><img src=\"" + depth + "tack/adpics/gifart2.gif\" border=\"0\" WIDTH=\"120\" HEIGHT=\"240\" ALT=\"Click here for Clipart!\"></a>";
GifartLine[3]  = "<!-- gifart --><a href=\"http://www.gifart.com/cgi-bin/affiliate/clickthru.cgi/jbarta\"><img src=\"" + depth + "tack/adpics/gifart3.gif\" border=\"0\" WIDTH=\"120\" HEIGHT=\"240\" ALT=\"Click here for Clipart!\"></a>";
GifartLine[4]  = "<!-- gifart --><a href=\"http://www.gifart.com/cgi-bin/affiliate/clickthru.cgi/jbarta\"><img src=\"" + depth + "tack/adpics/gifart4.gif\"  border=\"0\" WIDTH=\"120\" HEIGHT=\"90\"  ALT=\"Click here for Clipart!\"></a>";
GifartLine[5]  = "<!-- animation factory --><a href=\"http://www.qksrv.net/click-517001-1492349\" target=\"_top\"><img src=\"" + depth + "tack/adpics/animfact1.gif\" width=\"100\" height=\"100\" alt=\"Animated Clipart\" border=\"0\"></a>";
GifartLine[6]  = "<!-- animation factory --><a href=\"http://www.qksrv.net/click-517001-14657\" target=\"_top\"><img src=\"" + depth + "tack/adpics/animfact2.gif\" width=\"100\" height=\"100\" alt=\"Free Animations\" border=\"0\"></a>";
GifartLine[7]  = "<!-- animation factory --><a href=\"http://www.qksrv.net/click-517001-39297\" target=\"_top\"><img src=\"" + depth + "tack/adpics/animfact3.gif\" width=\"100\" height=\"100\" alt=\"Free Animations\" border=\"0\"></a>";
GifartLine[8]  = "<!-- animation factory --><a href=\"http://www.qksrv.net/click-517001-1161485\" target=\"_top\"><img src=\"" + depth + "tack/adpics/animfact4.gif\" width=\"120\" height=\"60\" alt=\"Animations!\" border=\"0\"></a>";



function grabAd(adtype)
{
   if (adtype == "randad")
   {
      adline = BannerLine[getRandom(23)];
      document.write("<P ALIGN=\"center\">" + adline + "</P>");
   }

   else if (adtype == "inlineb")
   {
      adline = BannerLine[getRandom(23)];
      document.write("<P ALIGN=\"center\"><FONT SIZE=\"1\" FACE=\"verdana,arial,helvetica\" COLOR=\"#BBBBBB\">Advertisement</FONT><BR>" + adline + "</P>");
   }

   else if (adtype == "gifart")
   {
      adline = GifartLine[getRandom(8)];
      document.write(adline);
   }
}

