$(document).ready(function() {
	var topads = $('#topAds .topad');
	var topads_count = topads.size();
	var topads_timeout = 15000;
	var topads_current = 0;
	if(topads_count>0) {
			topads.hide();
			topads.eq(0).show();
			if(topads_count>1) setTimeout(rotate_topads, topads_timeout);
		}
	
	function rotate_topads() {
		topads.eq(topads_current).fadeOut('slow', function() {
			topads_current = (topads_current + 1) % topads_count
			topads.eq(topads_current).fadeIn('slow')
		});
		
		
		setTimeout(rotate_topads, topads_timeout)
	}
});
