<!--

/*#########################################################################################
  # Author : Khaled Elmougey        Email : khaled@futurecompany.com                      #
  # Website: www.futurecompany.com  Title  : Banner Rotator                               # 
  # Version : 1.0.0   Date : December,25,98                                               #  
  # Version : 1.1.0   Date : Febuaray,17,2000                                             #
  # Version : 1.2.0   Date : March,17,2000                                                #                                             
  # Bugs   : I did not encounter any.                                                     #
  # compatibility: It has been tested with MSIE 4.0, 5.0 and Netscape 3.0, 4.0, 4.6.      #
  # Copyrights: you can copy and paste it in to your website as along as you keep this    #
  #             copyright is intact.                                                      # 
  #             copyrights 99, 2000 arabflex.com all rights are reserved.                 #
  # Comments:                                                                             #
  #    1) do not forget to put the <IMG SRC=""> tags in the body.                         #
  #    2) all images suppose to have the same length and width                            #                                
  #    3)Please do email me for any bugs you encounter.                                   #                                 
  #    4)You can set these variables:                                                     #                                  
  #      a) numberOfBanners: number of banners.                                           #                                  
  #      b) displaytime    : how long the banner will be displayed in millisecond.        # 
  #      c) getBanner      : name of each banner .                                        #
  #      d) getSiteUrl     : The site url, when you click the banner.                     #                      
  #      e) imageWidth     : The width of the image                                       #
  #      f) imageHeight    : The height of the image                                      #
  #      g) dir            : the location of the images, if their is no dir leave it as ""#
  #      h) pages          : The pages that a specific banners will be displayed on       #
  #      i) banners0       : The banners that will be displayed on a specific page.       #
  #      j) rotate         : Set it to true to rotate all banners or false to display     #
  #                          a random banner.                                             #
  #      k) random         : set to true to dislpay banners in random.                    #
  #      l) target         : set it to one of the following:                              #
  #                          1) "new" for new window.                                     #
  #                          2) "self" for same window.                                   #
  #                          3) Frame name which you want the web site to be loaded in.   #
  #                             You have to create a frame page to be able to use frames. # 
  ##########################################################################################*/

var numberOfBanners = 6;
var pause       = 60000; 
var imageWidth  = 300;
var imageHeight = 50;
var dir         = "images/banners/";
var rotate      = "true";
var random      = "true";
var target      = "new";
var getBanner  = new Array("banner1.gif","banner0.gif","banner2.gif","banner0.gif","banner3.gif","banner0.gif");

var getSiteUrl = new Array(numberOfBanners);  
getSiteUrl[0]  = "http://www.creaenpereira.com";
getSiteUrl[1]  = "";
getSiteUrl[2]  = "";
getSiteUrl[3]  = "";
getSiteUrl[4]  = "";
getSiteUrl[5]  = "http://arana.tripod.com.co";

var pages   = new Array("page1.html","page2.html","page3.html","page4.html","page5.html");

var banners0 = new Array("0","1","2","3"); 
var banners1 = new Array("0"); 
var banners2 = new Array("3","4"); 
var banners3 = new Array("1","2","3");
var banners4 = new Array("0","2","4"); 

////////////////////////Nothing below this line need to be modified/////////////////////////////

var counter = -1;
var oldCounter = -1;
var add = "";
var b = new Banner(); 
b.desireBanners();

function Banner()
  {
  this.nBanners = numberOfBanners;
  this.banner  = new Array(this.nBanners);  
  this.Url     = new Array(this.nBanners);                      
  this.banners = banners;
  this.address = address;
  this.desireBanners = desireBanners;
  this.setBanners = setBanners;
  }

function banners(tempBanner, i)
  {    
  this.banner[i]     = new Image(imageWidth,imageHeight);                 
  this.banner[i].src = dir + tempBanner; 
  }

function address(getUrl, i) {this.Url[i] = getUrl;}

function desireBanners()
  {
  for (var i = 0; i < this.nBanners; i++)
     {
     var loc    = location.pathname;
     var length = loc.length;
     var start  = loc.lastIndexOf('/') + 1;
     var desirPage = loc.substring(start,length);
     if (desirPage == pages[i])
       { 
       eval("this.nBanners = banners" + i +".length");
       for (var j = 0; j < this.nBanners; j++)
          {
          eval("this.banners(getBanner[banners" + i + "[" + j + "]]," + j + ")");
          eval("this.address(getSiteUrl[banners" + i + "[" + j + "]]," + j + ")");
          }
       return;
       }
     }
  for (var j = 0; j < this.nBanners; j++)
     {
     this.banners(getBanner[j],j);
     this.address(getSiteUrl[j],j);
     }
  }

function setBanners()  
  {
  document.img.src = this.banner[counter].src;   
  add = this.Url[counter];
  }

function displayBanners()
  {
  if (random == "true") 
    {
    while (counter == oldCounter) 
      {counter = Math.round(Math.random() * (b.nBanners - 1));}
    oldCounter = counter;
    }
  else {
       counter++;
       if (counter > (b.nBanners - 1)) {counter = 0;}
       }
  b.setBanners();
  if (rotate == "true") {setTimeout("displayBanners()", pause);}  
  }

function goTo() 
  {
  if (target == "new") {window.open(add,"siteWindow");}
  else {eval("parent." + target + ".location.href = add;");}
  }

function show() {window.status = add;}
// End -->