$(document).ready(function () {
	
	// ein-/ausklappbare Definitionslists
	$("dl.collapseList dd").hide();
	$("dl.collapseList dt").click(function(){
		if ($(this).next("dd").css("display")!="block") {
			$(this).addClass("selected");
			$(this).next().slideDown("fast");
		} else if ($(this).attr("class")=="selected") {
			$(this).next().slideUp("fast");
			$(this).removeClass("selected");
		}
		return false;
	});

	// Schnellzugriff Einsatzbereiche
	$("ul#quickList li:even").addClass("alt");
	$('#quickListSwitcher').click(function () {
		$('ul#quickList').slideToggle('medium');
	});
	
	// open all links with 'li.external a' in a new browser window
	// $("li.external a, a[title='Bilddatenbank']").click( function() {
	// $("li.external a").click( function() {
	//	window.open(this.href);
	//	return false;
	//});
	
	$("li.external a, .external").each(function(index) {
    $(this).attr("title", $(this).attr("title") + " - externe Website");
		
		$(this).click(function() {
			window.open(this.href);
			return false;
		});
  });

	
	// Hover für die QS Logos in der Kontextspalte
	$("img.gsHover").fadeTo("slow", 0.2); // This sets the opacity of the thumbs to fade down to 30% when the page loads
	 	$("img.gsHover").hover(function(){
	 	$(this).fadeTo("fast", 1.0); // This should set the opacity to 100% on hover
	 	},function(){
	 	$(this).fadeTo("slow", 0.2); // This should set the opacity back to 30% on mouseout
	});

});
