Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h4');



function switchLanguage(lang) {
	u = location.href.split('/');
	u[3] = lang;
	location.href = u.join('/');
}


function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

     var $sibs  = $active.siblings();
     var rndNum = Math.floor(Math.random() * $sibs.length );
     var $next  = $( $sibs[ rndNum ] );

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 8000 );
});



function flashPutHref(href) { location.href = href; }


		$(document).ready(function() {



			
			$("a[rel=foto-album]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});



			$("a[rel=in_de_media]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'inside',
				'scrolling' 	: 'no',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Item ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			
			
			
			
			$("#subnav:first").css("padding-left", $("#nav li a.active").attr("offsetLeft")-55);
			$("#subnav").css("width", (960 - $("#nav li a.active").attr("offsetLeft")+55));
			
//			$("#programmaGallery").jqGalScroll();
			

		});
