/*	=====================================================================
 *	
 *	Version: June 5, 2007. Modified by Isaac Rivera
 *	
 *	HOW TO USE:
 *
 *	1) 	Upload this file to Bigbowl.
 *
 *	2)	Modify and use this line of code on your application's html to 
 *		include this js function in your page at the top of the module:
 *
 *		<script language="javascript" src="full_url_to_your_dir/izk_flash_adrefresh.js"></script>
 *
 *	2) Call from Flash:
 *
 *		getURL("javascript:IZKadRefresher.refreshAds();");
 */

this.IZKadRefresher = function(theAds)
{
	this.ads = theAds;
	this.counter = 0;
}

/*	=====================================================================
 *	Refreshes the all ad frames passes initially to the constructor:
 *	Sample call FLASH: getURL("javascript:IZKadRefresher.refreshAds();");
 *	Sample call JS: IZKadRefresher.refreshAds();
 */
this.IZKadRefresher.prototype.refreshAds = function()
{
	if((this.counter += 1) >= 3)
	{
		var adsD = new Date();
		var adsScr1 = adsD.getTime() % 0x3fffffff;
		for(var ind = 0; ind < this.ads.length; ind++)
		{
			parent["adsF" + ind].location.href = window.adsHt + "/html/" + this.ads[ind][0] + "/" 
					+ adsScr1 + "/" + window.adsExt + "?" + window.adsNMSG + "&width=" 
					+ this.ads[ind][1] + "&height=" + this.ads[ind][2] + "&target=" + window.adsTar 
					+ window.adsTz + window.adsScS + window.adsSr + window.adsSN 
					+ window.adsWM + window.adsOt + "&CT=I";
		}
	}
}

/*	=====================================================================
 *	Creates the IZKadRefresher object:
 *
 *	MODIFY THESE PARAMETERS TO SUIT YOUR APPLICATION:
 *
 *	@param	[["magic_number_1", ad_width, ad_height], ["magic_number_N", ad_width, ad_height]]
 *
 *			A square-brackett enclosed, comma-separated list of square-brackett enclosed, 
 *			comma-separated lists each of which includes a magic number, ad width and ad height
 *			for as many ads as you want to refresh:
 */
this.IZKadRefresher = new IZKadRefresher([["93207470", 728, 90], ["93207469", 180, 150]]);
