<!--

var ad_source = new Array();
var ad_alt = new Array();
var ad_url = new Array();
var ad_target = new Array();

// Set ad images source
ad_source[0] = "uploaded/hotspot_ads/Hotspot_ad_1.gif";
ad_source[1] = "uploaded/hotspot_ads/PPL_234coffee.gif";
ad_source[2] = "uploaded/hotspot_ads/Greg_Lewis.jpg";
/* ad_source[3] = "";
ad_source[4] = "";
ad_source[5] = "";
ad_source[6] = "";
ad_source[7] = "";
ad_source[8] = "";
ad_source[9] = ""; */

// Set ad images alternate text
ad_alt[0] = "Place Your Business Ad Here";
ad_alt[1] = "Valuable legal services for less than the cost of a cup a coffee a day";
ad_alt[2] = "State Farm Agent Greg Lewis: Providing Insurance And Financial Services";
/* ad_alt[3] = "";
ad_alt[4] = "";
ad_alt[5] = "";
ad_alt[6] = "";
ad_alt[7] = "";
ad_alt[8] = "";
ad_alt[9] = ""; */

// Set ad images link url
ad_url[0] = "hotspot_ads.htm";
ad_url[1] = "http://www.sandracousins.com";
ad_url[2] = "http://www.greglewis.ca";
/* ad_url[3] = "";
ad_url[4] = "";
ad_url[5] = "";
ad_url[6] = "";
ad_url[7] = "";
ad_url[8] = "";
ad_url[9] = ""; */

// Set ad link url target window
ad_target[0] = "";
ad_target[1] = "PPL_234coffee";
ad_target[2] = "hotspot_ad_2";
/* ad_target[3] = "";
ad_target[4] = "";
ad_target[5] = "";
ad_target[6] = "";
ad_target[7] = "";
ad_target[8] = "";
ad_target[9] = ""; */

// Choose random ad
var ad_to_display = Math.floor(Math.random() * ad_source.length);

// Display chosen ad
var ad_content = '<img src="' + ad_source[ad_to_display] + '" alt="' + ad_alt[ad_to_display] + '" title="' + ad_alt[ad_to_display] + '" border="0">';
if (ad_url[ad_to_display] != "") {   // Wrap in anchor if ad has URL
  var ad_target_temp = ad_target[ad_to_display];
  if (ad_target_temp != "") ad_target_temp = ' target="' + ad_target_temp + '"';   // Add anchor target window if specificed
  ad_content = '<a href="' + ad_url[ad_to_display] + '"' + ad_target_temp + '>' + ad_content + '</a>';
}
document.write(ad_content);

function testRandomness() {  // ***** FOR DEBUGGING
  var times = 10000;
  var count = new Array(2);
  for (i = 0; i < count.length; i++)
    count[i] = 0;
  var countRnd;
  for (i = 0; i < times; i++) {
    countRnd = Math.floor(Math.random() * count.length);
    count[countRnd] += 1;
  }
  var output = "";
  for (i = 0; i < count.length; i++)
    output += "Number of " + i + "s = " + count[i] + " (" + Math.round(count[i] / times * 100) + "%)\n";
  alert(output);
}

// -->
