﻿<!--
/*****************************************************************************************
 *
 *	@author		Isaac Rivera
 *	@version	August 30, 2005
 *
 *	multiple_external_ad_refresh_kit.js
 *	
 *	Use to refresh multiple TYPE "I" ads.
 *****************************************************************************************/

/**
 *	This is a convenience Array where ad objects can be stored using the utility function
 *	"addAdToList". If this Array is used the function "refreshAdsList" can be used with no
 *	parameters to refresh the ads.
 */
this.$$__ADS_LIST__$$ = new Array();

/**
 *	Utility function that makes ad Objects of the required format for this ad refresh library.
 *
 *	@param	id 	an ad magic number.
 *
 *	@param	w 	the width in pixels of the ad
 *
 *	@param	h 	the height in pixels of the ad
 */
 this.makeAdObject = function(id, w, h) {
	return {id:id, width:w, height:h};
};

/**
 *	Utility function that makes and stores ad Objects of the required format for this ad refresh library.
 *
 *	@param	id 	an ad magic number.
 *
 *	@param	w 	the width in pixels of the ad
 *
 *	@param	h 	the height in pixels of the ad
 *
 *	If this function is used to store ads, then the function "refreshAdsList" can be used to refresh the list.
 */
 this.addAdToList = function(id, w, h) {
	this.$$__ADS_LIST__$$.push(makeAdObject(id, w, h));
};


/**
 *	refreshAdFrames		Refreshes an Array of ads. The Array can have 1 or more ads.
 *						Items in the collection have to be Objects of the format:
 *
 *						{id:MagicNumber, width:adWidth, height:adHeight}
 *
 *	@param	adsList 	an array of ad Objects as created by the function makeAdObject.
 *						These Objects have the format:
 *						
 *						{id:MagicNumber, width:adWidth, height:adHeight}
 *
 *	You can use the utility function "makeAdObject" to produce ad Objects of the 
 *	required format.
 */
this.refreshAdFrames = function(adsList) {
	for(var i = 0; i < adsList.length; i++) {
		var adsScr1 = adsD.getTime() % 0x3fffffff;
		parent["adsF" + i].location.href = window.adsHt + "/html/" +adsList[i].id + "/" 
				+ adsScr1 + "/" + window.adsExt + "?" + window.adsNMSG + "&width=" 
				+ adsList[i].width + "&height=" + adsList[i].height + "&target=" + window.adsTar 
				+ window.adsTz + window.adsScS + window.adsSr + window.adsSN 
				+ window.adsWM + window.adsOt + "&CT=I";
	}
};

/**
 *	refreshAdsList		Refreshes a JS-kept list of ads. The Array can have 1 or more ads.
 *						Items in the collection have to be Objects of the format:
 *
 *						{id:MagicNumber, width:adWidth, height:adHeight}
 *
 *	You can store ads for this function using the utility function "addAdToList" to produce 
 *	and store ad Objects of the required format.
 */
this.refreshAdsList = function() {
	for(var i = 0; i < this.$$__ADS_LIST__$$.length; i++) {
		var adsScr1 = adsD.getTime() % 0x3fffffff;
		parent["adsF" + i].location.href = window.adsHt + "/html/" +this.$$__ADS_LIST__$$[i].id + "/" 
				+ adsScr1 + "/" + window.adsExt + "?" + window.adsNMSG + "&width=" 
				+ this.$$__ADS_LIST__$$[i].width + "&height=" + this.$$__ADS_LIST__$$[i].height 
				+ "&target=" + window.adsTar + window.adsTz + window.adsScS + window.adsSr 
				+ window.adsSN + window.adsWM + window.adsOt + "&CT=I";
	}
};
//-->
