var allAds;
var idx = 0;
var cnt;

function init( ads ) {
	allAds = ads
	cnt = allAds.length;
}

function showAds() {
	var ad;
	var imgs = '';
	for( var i=0; i <3; i++ ) {
		if( idx == cnt ) idx = 0;
		ad = allAds[idx];
		imgs += '<a href="http://'+ad[1]+'" target="_blank"><img src="images/werb/'+ad[0]+'_side.jpg" border="0" /></a><br/><br/>';
		idx++;
	}
	$('div#adrepl').replaceWith('<div id="adrepl">' + imgs + '</div>' );
	setTimeout( "showAds()", 10000 );
}

