
$(document).ready(function() {
	
	$('#historywrapper .historyItem').hide();
	
	$(".location").each(function(index, element) {
		var current = $('> a', this);
		current.cluetip({
			local:true,
			hidelocal:true,
			sticky: true,
			arrows:true,
			closeText: 'Schlie&szlig;en',
			onShow:function(ct, c) {
				$('#cluetip').addClass('locationsClueTip');
			}
			});
	});
	
	$('#locationsMap').click(function() {
		$('#cluetip').hide();
	});
	
	$(".history").each(function(index, element) {
		var current = $('> a', this);
		current.cluetip({
			local:true,
			hidelocal:true,
			sticky: false,
			dropShadowSteps: 3,
			arrows:true,
			closeText: 'Schlie&szlig;en',
			onShow:function(ct, c) {
				$('#cluetip').addClass('historyClueTip');
			}
			});
		current.click(function() {
			var currentElement = $(this).attr('rel').replace('.', '.history');
			$('.historyItem').hide();
			$(currentElement).show();
		});
	});
	
	$('#historyMap').click(function() {
		$('#cluetip').hide();
	});
});
