function init () {
  $('#text').hide();
  $('#text').corner('round 5px');

  $('#menu').hover(
    function () {
      $(this).css('background-color', '#fff' );
      $(this).corner('round 5px');
    }, 
    function () {
      $(this).removeAttr("style");
    }
  );
  // Set Background Image
	changeBg(Math.round((Math.random() * 3) + 1));
}

function initGallery (sGalleryGroupName) {
	$('a[rel=' + sGalleryGroupName + ']').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>';
		}
	});
}

function hideContent(sContentObjectName) {
  $(sContentObjectName).fadeOut('slow', function() {
  });	
}

function loadContent(sContentObjectName, sItem) {
  var sContentUrl = 'content_' + sItem + '.html';
  $(sContentObjectName).fadeOut('slow', function() {
    // Reload Content
  	$.get(sContentUrl, function(data) {
    	$(sContentObjectName).html(data);
  		// Add UP Image to Content
  		$(sContentObjectName).append('<div id=\"up\"><a href=\"javascript:hideContent(\'#text\');\"><img src=\"images/up.png\" alt=\"Ausblenden\"></a></div>');
  	});
  	changeBg(sItem);
  	$(sContentObjectName).fadeIn('slow', function() {
    });
  });	
}

function changeBg (sImageID) {
	var confFullscreenrOptions = {width: 1200, height: 800, bgID: '#bgimg'};
  var sImageSrc = '/images/backgrounds/' + sImageID + '.jpg';
	$('#bgimg').attr('src',sImageSrc);
	jQuery.fn.fullscreenr(confFullscreenrOptions);
}

