var sponsor_counter = 0;

$(function() {
	show_sponsor();
});

function show_sponsor() {
	all = $('#sponsor_animation').attr('rel');	
	all = Number(all);
	if (all != 0) {				
		$('img.sponsor_image_' + sponsor_counter).show();
		setTimeout("hide_sponsor();", 2000);				
	}
}

function hide_sponsor() {
	all = $('#sponsor_animation').attr('rel');
	all = Number(all);
	if (all != 0) {				
		$('img.sponsor_image_' + sponsor_counter).hide();
		if (sponsor_counter < (all-1)) { 
			sponsor_counter++;
		} else {
			sponsor_counter = 0;
		}
		show_sponsor();
	}
}
