// JavaScript Document


var currentdate = 0;
var core = 0;

function initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
  }
}


// Type the number of images you are rotating.

link = new initArray(
"#",
"http://www.xtcgym.com/"
);

image = new initArray(
"images/ads-3/ad1.jpg",
"images/ads-3/ad2.jpg"
);

text = new initArray(
"Stephano's Hair Salon",
"XTREME Training Center"
);

var currentdate = new Date();
var core = currentdate.getSeconds() % image.length;
var ranlink  = link[core];
var ranimage = image[core];
var rantext  = text[core];


// Specify the first and last part of the image tag. 

document.write('<a href=\"' +ranlink+ '\" target="_blank"><img src=\"'+ranimage+'\" border="0" alt=\"'+rantext+'\"></a>');