var timer;

function adArray()
{
	for (i=0; i*2<adArray.arguments.length; i++)
	{
		this[i] = new Object();
		this[i].src = adArray.arguments[i*2];
		this[i].href = adArray.arguments[i*2+1];
	}
	this.length = i;
}

function getAdNum()
{
	dat = new Date();
	dat = (dat.getTime()+"").charAt(8);

	if (dat.length == 1)
		ad_num = dat%ads.length;
	else
		ad_num = 0;

	return ad_num;
}

function rotateImages()
{
	if (document.images)
	{
		ad_num = (ad_num+1)%ads.length;
		document.js_ad.src = ads[ad_num].src;

		if (typeof ads_big != 'undefined')
		{
			document.getElementById('js_ad_big').href = ads_big[ad_num].src;
		}

		timer = setTimeout("rotateImages()", 7000);
	}
}

function stopRotate() {
	clearTimeout(timer);
}
