$(document).ready(function() {
//$(".group").attr("title",$(".group").children().next(".caption").html());
/*
if($(".group").attr("title")=="poseidon"){
	var a = $(this).next(".caption").html();
	$(".group").attr("title",a);
}
*/
	$("a#single_image").fancybox();
	
	/* Using custom settings */
	
	$("a#inline").fancybox({
		'hideOnContentClick': true
	});

	$("a.group").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayOpacity': .8,
		'overlayColor': '#000',
		'titlePosition':'over'
		
	});
	$("a.illu").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayOpacity': .8,
		'overlayColor': '#000',
		'titlePosition':'inside'
	});
	
		$("a[rel=lightbox]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">Bild ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
		}
	});
	$("a[rel=lightbox2],a[rel=lightbox3],a[rel=lightbox4],a[rel=lightbox5] ").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayOpacity': .8,
		'overlayColor': '#000',
		'titlePosition':'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over"><strong>'+title+'</strong> (' +  (currentIndex + 1) + ' / ' + currentArray.length + ')</span>';
		}
	});	

	$("a.thickbox").fancybox({
		'width'				: 820,
		'height'			: '98%',
        'autoScale'     	: true,
		'overlayOpacity': .8,
		'overlayColor': '#000',
		'scrolling': 'auto',
		'centerOnScroll': true,
		'type'				: 'iframe'
	});
	$("a.thickbox_krk").fancybox({
		'width'				: 750,
		'height'			: 500,
        'autoScale'     	: true,
		'overlayOpacity': .8,
		'overlayColor': '#000',
		'scrolling': 'auto',
		'centerOnScroll': true,
		'type'				: 'iframe'
	});
	
	$("a.thickbox2").fancybox({
		'width'				: '75%',
		'height'			: '75%',
        'autoScale'     	: true,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'overlayOpacity': .8,
		'centerOnScroll': true,
		'overlayColor': '#000',
		'type'				: 'iframe'
	});
	
	$("a.overlay-flash").fancybox({ 
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayOpacity': .8,
		'overlayColor': '#000',
		'titlePosition':'inside'
	});
	
		$(".group").each(function(){
		var a = $(this).children().next(".caption").html();
		$(this).attr("title",a);
		});
	
});
function callFancy(m_href,titel) { 
	var j1 = document.getElementById("hiddenclicker"); 
	j1.href = m_href; 
	j1.title = titel;
	$('#hiddenclicker').trigger('click'); 
} 
$(document).ready(function(){
	
	$(".toggle_container").hide();
 
	$("h1.trigger").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
	});
	
	$("h1.trigger").click(function(){
		$(this).next(".toggle_container").slideToggle("normal,");
	});
 
});

$(document).ready(function() {
	$('a[href*=#]').bind("click", function(event) {
		event.preventDefault();
		var ziel = $(this).attr("href");

		$('html,body').animate({
			scrollTop: $(ziel).offset().top
		}, 500 , function (){location.hash = ziel;});
});
return false;
});
function ggg() {
	$("html,body").stop();
	$('a[href*=#]').bind("click", function(event) {
		event.preventDefault();
		var ziel = $(this).attr("href");

		$('html,body').animate({
			scrollTop: $(ziel).offset().top
		}, 500 , ggg ());
});
return false;
}

function sb(m_href) { 
	/*var j1 = document.getElementById(m_href); 
	j1.href = 'images/gr/'+m_href+'.jpg'; 
	j1.title = 'titel';*/
	refp = '#'+m_href; 
	$(refp).trigger('click'); 
} 
function GroupDelegate(m_href,titel) { 
	var j1 = document.getElementById("hiddenclicker"); 
	j1.href = m_href; 
	j1.title = titel;
	$('#hiddenclicker').trigger('click'); 
} 
