var seconds = 6;

function nextAd(type) {

	if ($('div.' + type + '-ad.current-' + type).attr('id') == $('div.' + type + '-ad:last').attr('id')) {

		showAd($('div.' + type + '-ad:first'),type);

	} else {

		showAd($('div.' + type + '-ad.current-' + type).next(),type);

	}

	setTimeout("nextAd('" + type + "')", seconds * 1000);

}

function showAd(ad,type) {

	$('div.' + type + '-ad').fadeOut('slow');
	$('div.current-' + type + '').removeClass('current-' + type);

	$(ad).addClass('current-' + type);
	$(ad).fadeIn('slow');

}

$(document).ready(function() {

	if (false) {

	$('div.leader-ad:first').addClass('current-leader');
	$('div.skyscraper-ad:first').addClass('current-skyscraper');
	$('div.box-ad:first').addClass('current-box');

	setTimeout("nextAd('leader')", seconds * 1000);
	setTimeout("nextAd('skyscraper')", seconds * 1000);
	setTimeout("nextAd('box')", seconds * 1000);

	}

});
