var adsDiv;
var currentRow = 1;
var top = 0;

setAdAnimation = function()
{
	adsDiv = document.getElementById("adImages");
	
	if ( adsDiv )
	{
		var ads = adsDiv.getElementsByTagName("img");
		var adNumber = ads.length;
		var rows = Math.ceil( adNumber / 6 );
		
		setTimeout("moveAds("+rows+")", 7000)
	}
}

moveAds = function(rows)
{	
	if ( currentRow != rows )
	{
		top -= 116;
	}
	else 
	{
		top = 0;
		currentRow = 0;
	}
	
	adsDiv.style.top = top + "px";
	
	currentRow += 1;
	setTimeout("moveAds("+rows+")", 7000)
}