var containerWidth = 0;

$(document).ready(function(){
		getContainerWidth();	
});

jQuery.fn.fxCenter = function(newWidth,newHeight){
		newWidth = (newWidth) ? newWidth : jQuery(this).width();
		newHeight = (newHeight) ? newHeight : jQuery(this).height();
		var newLeft = (jQuery(window).width()-newWidth) / 2;
		var newTop = (jQuery(window).height()-newHeight) / 2;
		return jQuery(this).css({left:newLeft,top:newTop,width: newWidth, height: newHeight, position: "absolute"});
}

function getContainerWidth(){
	containerWidth = 0;
	$(".viewport img").each(function(i){
		containerWidth += this.width;
	});
	$("#scrollbar1 .overview").css("width",containerWidth);
}

function swapThumb(){
			var projektbild = $('.projektbild');
			projektbild.hide();
			//projektbild.eq(0).show();
	$('.submenublock2 a').each(function(i){
		$(this).hover(function(){
			projektbild.hide();
			projektbild.eq(i).show();
		},function(){
			projektbild.hide();
		});
	});
}
function swapThumb2(){
			var projektbild = $('.projektbild2');
			projektbild.hide();
			//projektbild.eq(0).show();
	$('.submenublock4 a').each(function(i){
		$(this).hover(function(){
			projektbild.hide();
			projektbild.eq(i).show();
		},function(){
			projektbild.hide();
		});
	});
}

