$(function() {
	setupZoom();
	$('#lblockImages .iw').cycle({
		speed: 4000,
		timeout: 5000
	});
	equalHeight($('#main, #left, #right'));
	
	attachTooltips();
	
	
	$('.sponsoren a').click(function() {
		document.location.href = '/tekst/71/Sponsoren/';
		return false;
	});
});

function equalHeight(group) {
    tallest = 0;
    group.each(function() {
        thisHeight = $(this).height();
        if(thisHeight > tallest) {
            tallest = thisHeight;
        }
    });
    group.height(tallest);
}

function attachTooltips() {
	$('.tooltip_trigger').each(function() {
		var tooltip_name = this.id.replace('link_','');
		var tooltip_trigger_object = this;

		$('#tooltip_' + tooltip_name).css({
			'display':'block',
			'opacity':0,
			'marginTop': 0
		});
		

		$(this).mouseover(function() {
			$('#tooltip_' + tooltip_name).stop().animate({
				'opacity':1,
				'marginTop': 10
			}, 350);
		});
		
		$(this).mouseleave(function() {
			$('#tooltip_' + tooltip_name).stop().animate({
				'opacity':0,
				'marginTop': 0
			}, 350);
		});
	});
}
