function dom_init() {

  // See http://fancybox.net/api for all options
  $("a.youtube").fancybox({ 
		'width': 700, 
      'height': 500, 
      'overlayOpacity':0.6,
			'hideOnContentClick': false,
      'autoDimensions': false,
			'callbackOnClose': function() {
          $("#fancy_content").empty();
       } 
	});
	
  $(".gallery a").fancybox();
			
  $("#full").hide();
  $("#show-content").click(function() {    
    $("#full").slideToggle("fast");
	if($("#show-content").html() == "Weiterlesen")
	{
		$("#show-content").html("Überblick");			
	}
	else
	{
		$("#show-content").html("Weiterlesen");
	}

    return false;
  });

	if($(".pics").length != 0)
	{
		$("#show-content").remove();
	
	}
  
  // $(".gallery a").removeClass('last');
  // $(".gallery a:nth-child(3)").addClass('last');
	
	// enable circular scrollables with a click handler
	if($(".scroll").length != 0)
	{
	
		myscroller = $(".scroll").scrollable({ circular: true });

		
		next_item = function() {
			$(myscroller).data("scrollable").next();	
			myindex = $(myscroller).data("scrollable").getIndex();
			mydata = $(myscroller).data("scrollable");
		
	
		
			if(myindex != -1)
			{
				mytext = mydata.getItems()[myindex].innerHTML;
			
				if(myindex + 1 < mydata.getSize()){
					mytitle = mydata.getItems()[myindex + 1].title;	
				}
				else
				{
					mytitle = mydata.getItems()[0].title;
				}
			
				//console.log($(this).data("scrollable").getItems());
				currenttitle = mydata.getItems()[myindex].title;		
			}
			else
			{
				mytext = mydata.getItems()[0].innerHTML;
				mytitle = mydata.getItems()[1].title;
				currenttitle = mydata.getItems()[0].title;
			}
		
			//$("#teaser_viel-text:last-child").hide();
			$("#teaser_viel-text p").remove();
			$("#teaser_viel-text").append("<p><strong>" + currenttitle + "</strong>: " + mytext + "</p>");
			$("#next-year").html(currenttitle + ' &raquo;');	
		
		};
		$('.scroll').click(next_item);
		$('#next-year').click(next_item);
	}
}
