$(function() { 

	// Suchergebnisse
	$('.resultBox').each(function() { 
		$(this)
			.wrapInner('<div class="searchcontent"></div>')
			.find('h2')
			.addClass('js')
			.insertBefore($(this).find('.searchcontent'));
			
		$(this).find('h2').click(function() { 
			$(this).toggleClass('auf').next().slideToggle(800);
		});
	});
	

	// Startseite Linkliste
	$('ul.linkliste li').hover(function() { 
		$(this).addClass('hover').find('ul').show();
	}, function() { 
		$(this).removeClass('hover').find('ul').hide();
	});

	if($('.startbox1').length) { 
		$('.startbox1:has(.hidecontent)')
			.addClass('zu')
			.find('h2:first')
			.wrapInner('<span></span>')
			.css({ cursor: 'pointer' });
		$('.startbox1.zu h2')
			.click(function() { 
				$(this).closest('.startbox1').toggleClass('zu');
			});
	};


	// Suchfeld (Kopf)
	$('#head input.suche').val("Suchbegriff eingeben");
	startVal = $('#head input.suche').val();
	$('#head input.suche').focus(function() { 
		if($(this).val() == startVal) { $(this).val(''); }
	}).blur(function() {
		if($(this).val() == '') { $(this).val(startVal); }
	});	
	
	// Colorbox - Thickbox-Ersatz
	if ($('#inhalt table td a.thickbox, #inhalt table td a.colorbox').length) { 
		$('#inhalt table td a.thickbox, #inhalt table td a.colorbox').colorbox({
			iframe: true,
			innerWidth: 506, 
			innerHeight: 391,
			opacity: 0.6,
			close: 'schließen'
		});
	} else { 
		$('a.thickbox, a.colorbox').colorbox({
			opacity: 0.6,
			close: 'schließen'
		});
	};
	$('a.colorbox.flash').colorbox({
		iframe: true,
		innerWidth: 960, 
		innerHeight: 540,
		opacity: 0.6,
		close: 'schließen'
	});

	
});

// Sprungmenü -> Einrichtungen
function Goto() {
	var ziel = $('form#form1 select').attr('value');
	if(ziel == 'http://www.holsteinisches-brustzentrum.de') { 
		var neuesFenster = window.open(ziel, "Holsteinisches Brustzentrum", "");
		neuesFenster.focus();
	} else if(ziel == 'http://www.ich-bin-mir-sicher.de') { 
		var neuesFenster = window.open(ziel, "Mammographie-Screening", "");
		neuesFenster.focus();
	} else if(ziel == '============================' || ziel == 'Unsere Einrichtungen') { 
		
	} else {  
		window.location.href = ziel;
	}
}

/* Captcha-Bild aktualisieren */
function newCaptcha() {
	document.getElementById('captcha').src = 				
	'func/modul_captcha/securimage/securimage_show.php?sid=' + Math.random(); 
	return false;
}
