var ImageFolder = "http://blastoffadmin.motiongrid.com/AdRotator/"; //Folder name containing the images


var ImageFileNames = new Array(
         'boxing_ad.jpg',
         'hm_aeropostale.jpg',
         'hm_bowflex.jpg',
         'hm_footlocker.jpg',
         'hm_hdc.jpg',
         'hm_priceline.gif',
         'hm_smashbox.jpg',
         'hm_staples.gif',
         'hm_textbooks.jpg',
         'hm_golfsmith.jpg',
         'hm_smooth-fitness.jpg'
); 

                     
var ImageURLs = new Array( 
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?MgMID=0&MgOID=0&MgLid=1&MgSPID=0&Pin=',
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?CID=218&MgMID=660255&MgOID=975&MgLid=984&MgSPID=738340&Pin=', 
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?CID=218&MgMID=714925&MgOID=1611&MgLid=1622&MgSPID=738330&Pin=', 
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?CID=218&MgMID=503063&MgOID=596&MgLid=592&MgSPID=738320&Pin=', 
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?CID=218&MgMID=756197&MgOID=2420&MgLid=2435&MgSPID=738340&Pin=', 
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?CID=218&MgMID=17742&MgOID=429&MgLid=431&MgSPID=738330&Pin=', 
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?CID=218&MgMID=515766&MgOID=685&MgLid=681&MgSPID=738330&Pin=', 
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?CID=218&MgMID=714917&MgOID=1610&MgLid=1621&MgSPID=738330&Pin=', 
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?CID=218&MgMID=19864&MgOID=270&MgLid=271&MgSPID=738340&Pin=' ,
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?CID=218&MgMID=763473&MgOID=2506&MgLid=2522&MgSPID=738330&Pin=',
                    'http://mall.blastoffnetwork.com/LinkRouterV8.asp?CID=218&MgMID=763478&MgOID=2507&MgLid=2523&MgSPID=738330&Pin='
); 

var NumberOfImages = 11;

var DefaultURL = 'http://www.blastoffnetwork.com'; //Default hyperlink for the Banner Ad

var DisplayInterval = 30; //Number of seconds to wait before the next image is displayed

var TargetFrame = ""; //Name of the frame to open the hyperlink into

//Internal variables (do not change these unless you know what you are doing)
var IsValidBrowser = false;
var IsFirstTime = true;
var BannerAdCode = 0;
var BannerAdImages = new Array(NumberOfImages);
var DisplayInterval = DisplayInterval * 1000;
var NumberOfImages = ImageFileNames.length;

//A dd a trailing forward slash to the ImageFolder variable if it does not already have one
if (ImageFolder.substr(ImageFolder.length - 1, ImageFolder.length) != "/" && ImageFolder != "") { ImageFolder += "/";
}

if (TargetFrame == '') {
var FramesObject = null;
} else {
var FramesObject = eval('parent.' + TargetFrame);
}

//Function runs when this page has been loaded and does the following:
//1. Determine the browser name and version
// (since the script will only work on Netscape 3+ and Internet Explorer 4+).
//2. Start the timer object that will periodically change the image displayed
// by the Banner Ad.
//3. Preload the images used by the Banner Ad rotator script
function InitializeBannerAdRotator(nCustID) {

//Determine the browser name and version
//The script will only work on Netscape 3+ and Internet Explorer 4+
var BrowserType = navigator.appName;
var BrowserVersion = parseInt(navigator.appVersion);

IsValidBrowser = true;

if (BrowserType == "Netscape" && (BrowserVersion < 3)) {
IsValidBrowser = false;
}

if (BrowserType == "Microsoft Internet Explorer" && (BrowserVersion < 4)) {
IsValidBrowser = false;
}

if (IsValidBrowser) {
	if (IsFirstTime){
		IsFirstTime = false;
		TimerObject = setTimeout("ChangeImage()", DisplayInterval);
		BannerAdCode = 0;
		
		for (i = 0; i < NumberOfImages; i++) {
		BannerAdImages[i] = new Image();
		BannerAdImages[i].src = ' ' + ImageFolder + ImageFileNames[i];
		}
		
		BannerAdCode = parseInt(Math.random() * NumberOfImages);
		window.document.bannerad.src = BannerAdImages[BannerAdCode].src;
	}
	}

}

//Function to change the src of the Banner Ad image
function ChangeImage() {

if (IsValidBrowser) {
BannerAdCode = BannerAdCode + 1;

if (BannerAdCode == NumberOfImages) {
BannerAdCode = 0;
}

window.document.bannerad.src = BannerAdImages[BannerAdCode].src;
TimerObject = setTimeout("ChangeImage()", DisplayInterval);
}
}

//Function to redirect the browser window/frame to a new location,
//depending on which image is currently being displayed by the Banner Ad.
//If Banner Ad is being displayed on an old browser then the DefaultURL is displayed
function ChangePage(nCustID) {

if (IsValidBrowser) {

if (TargetFrame != '' && (FramesObject)) {
FramesObject.location.href = ImageURLs[BannerAdCode] + nCustID;
} else {
//document.location = ImageURLs[BannerAdCode] + nCustID ;
window.open(ImageURLs[BannerAdCode] + nCustID) ;
}

} else if (!IsValidBrowser) {
document.location = DefaultURL  + nCustID;
}
}
// -->
