﻿var urlArray = new Array(3); //for URL's, increase size as necessary
var banArray = new Array(3); //for banners, increase size as necessary
var tgetArray = new Array(3); //targets for URLs
var altArray = new Array(3); // img alt text
var counter = 1;
var count=1;
var url = "product.php?div=03&id=ClassicSeries_Export"; // initial URL
var tget= "_self"; // initial target
var alt= "Banner - New Classic Series Power Conditioners"; // initial img alt text
var banCount = 3;

// URLs after June 21st
urlArray[0] = "product.php?div=03&id=ClassicSeries_Export";
urlArray[1] = "product.php?div=03&id=MeritXSeriesE";
urlArray[2] = "product.php?div=04&id=AC-210E";

/* URLs after June 21st
/urlArray[0] = "product.php?div=03&id=MeritXSeriesE&re=home";
urlArray[1] = "product.php?div=03&id=10AMP_PWR&re=home";
urlArray[2] = "product.php?div=04&id=AC-210E&re=home";*/

//Targets
tgetArray[0] ="_self";
tgetArray[1] ="_self";
tgetArray[2] ="_self";

// img alt text
altArray[1] ="Banner - New Classic Series Power Conditioners";
altArray[0] ="Banner - Merit X Series Export Models";
altArray[2] ="Banner - AC-210 E";

/* img alt text
altArray[0] ="Banner - Merit X Series Export Models";
altArray[1] ="Banner - 10 AMP Series II Power Conditioners";
altArray[2] ="Banner - AC-210 E";*/

if(document.images) //pre-load all banner images
{
  for(i=0; i< banCount; i++)
  {
    banArray[i] = new Image(500, 303);
    banArray[i].src = "../new/slides/int_slide" + (i+1) + ".jpg";
  }
}

function changeBannerX(counter) //user based banner changer function
{
  document.banner.src = banArray[counter].src; //sets a new banner
  document.banner.alt = altArray[counter];
  url = urlArray[counter]; //sets a new URL to the banner
  tget = tgetArray[counter]; //sets the target
  alte = altArray[counter]; //sets the alt text
  counter++; //increase the counter for the next banner
  }



function changeBanner() //timed banner change function
{
  if(counter >= banCount)
   counter = 0;

  document.banner.src = banArray[counter].src; //sets a new banner
  document.getElementById(banner).alt = altArray[counter]; //sets alt text
  
  url = urlArray[counter]; //sets a new URL to the banner
  tget = tgetArray[counter]; //sets the target
  alt = altArray[counter]; // sets img alt text
  counter++; //increase the counter for the next banner
}


//change the timer as necessary (minutes * 60000) or (seconds * 1000)
var timer = window.setInterval("changeBanner()", 12000);

  
