

function showTeaser(obj){
	
	var left = ($(document).width()- obj.width())/2;
	
	showTrans();
	obj.css('left', left).fadeIn('slow');
}

function hideTeaser(obj){
	removeTrans();
	obj.fadeOut('slow');
}

function elementsResize(windowWidth){
	var teaserBox = $('#teaserBigBox');
	var transDiv = $('#transDiv');
	teaserBox.css('left', (windowWidth - teaserBox.width())/2);
	transDiv.css({
		width: function(){
			return windowWidth + 'px'
		},
		height: function(){
			return $(document).height() + 'px'
		}
	});
}

// ###############################################################################
var transCounter = 0;
// Transparente Flaeche anzeigen

function showTrans() {
	if ($('#transDiv').is(':hidden')) {
		$('#transDiv').css({
			width: function(){
				return $(document).width() + 'px'
			},
			height: function(){
				return $(document).height() + 'px'
			},
			opacity: 0.8
		}).show();
	}
	transCounter++;
}

// Transparente Flaeche entfernen
function removeTrans() {
	transCounter--;
	if (transCounter < 0) {
		transCounter = 0;
	}
	if (transCounter == 0) {
		$('#transDiv').hide();
	}
}

