// Java Document ***********************
//**************************************
// Simple Banner Rotation System V2.3  *
// Adam Tout, Play Along Toys 2006-    *
//**************************************
// array to store filenames for MAIN images w/o file extension 
var main = new Array()
main[0] = "HM_banner_large_spring08"
main[1] = "IMP_banner_large_spring08"
main[2] = "SS_banner_large_spring08"
// array for the links to the corresponding ads above, add target=_blank to open in a new window
var mainLinks = new Array()
mainLinks[0] = "hannahMontana/surfShopHangout.aspx"
mainLinks[1] = "puppy/PIMP_AwesomeAdventurePark_OP.aspx"
mainLinks[2] = "speedStacks/index.aspx"
// generate a random number no greater than the array length
var numMain = Math.floor(Math.random() * (main.length))
// make a variable with all of the components assembeled 
var mainResult = "<A href="+mainLinks[numMain]+"><IMG SRC=Banner_Ads/"+main[numMain]+".jpg>";
//array for the image names to be swapped on the right hand collum of ads
var right = new Array()
right[0] = "Domo_banner_small_spring08"
right[1] = "CPK2_banner_small_spring08"
right[2] = "IMP_banner_small_spring08"
right[3] = "HM_banner_small_spring08"
right[4] = "CB_banner_small_spring08"
right[5] = "CPK_banner_small_spring08"
// Links for the ads on the right 
var rightLinks = new Array()
rightLinks[0] = "domo/index.aspx"
rightLinks[1] = "http://www.mycpk.com/cpklilsprouts.aspx"
rightLinks[2] = "puppy/PIMP_AwesomeAdventurePark_OP.aspx"
rightLinks[3] = "hannahMontana/surfShopHangout.aspx"
rightLinks[4] = "carebears/32465_collectibles.aspx"
rightLinks[5] = "http://www.mycpk.com/cpklilsprouts.aspx"
// Links that are duplicated in the top array...
var rll = rightLinks.length - 1;
// generates a random number first number should be the last array slot, always -1 , always +1 
// this makes sure it will always select a number less than the greatest value in the array and greater than the least value in the array.
// below there are vars to add and subtract one from this number , this makes sure the sequence will never display the same advertisement. 
var numRight1 = Math.floor(Math.random() * (rll-1)+1);
// adds one to the number above 
var numRight2 = numRight1+1;
// subtracts one from the one above 
var numRight3 = numRight1-1;
// creates variables that assemble all of the segments of code above, this just keeps the javascript later on a little cleaner. 
var rightResult1 = "<A href="+rightLinks[numRight1]+"><IMG SRC=Banner_Ads/"+right[numRight1]+".gif>";
var rightResult2 = "<A href="+rightLinks[numRight2]+"><IMG SRC=Banner_Ads/"+right[numRight2]+".gif>";
var rightResult3 = "<A href="+rightLinks[numRight3]+"><IMG SRC=Banner_Ads/"+right[numRight3]+".gif>";
