
	function showAnimation() {
		
		document.getElementById("flash").style.display = "block";
		document.getElementById("header").style.zIndex = "100";
		document.getElementById("flash").style.zIndex = "1";

}
	
	
	window.animation = window.animation || {};

	animation = function() {}

	animation.prototype = {
		iFadeSpeed : 2000,

		iShowMS : 3000,
		iCurrentImg : 0,
		aImages : new Array(),
		aPreloadImages : new Array(),
		iImageCnt : 0,

		addImage : function(imagePath, iWidth, iHeight) {
			this.aImages[this.iImageCnt] = new Object();
			this.aImages[this.iImageCnt].src = imagePath;
			this.aImages[this.iImageCnt].width = iWidth;
			this.aImages[this.iImageCnt].height = iHeight;
			this.iImageCnt++;
		},

		initAnimation : function() {

			for( i=0; i<this.aImages.length; i++ ){
				this.aPreloadImages[i] = new Object();
				this.aPreloadImages[i].src = this.aImages[i].src;
				this.aPreloadImages[i].width = this.aImages[i].width;
				this.aPreloadImages[i].height = this.aImages[i].height;
			}

			$("#header-images").append('<div id="headerImgAnim"></div>')
			$('#headerImgAnim').addClass('loading');

			$.preload( this.aPreloadImages, {
			base:'',
			ext:'',
			aPreloadImages : this.aPreloadImages,
			onFinish:function(){
				$("#headerImgAnim").hide();
				for( i=0 ; i < this.aPreloadImages.length ; i++){
					$("#headerImgAnim").append('<img src="' + this.aPreloadImages[i].src + '" width="' + this.aPreloadImages[i].width + '" heigth="' + this.aPreloadImages[i].height + '" />');


				}

				$("#headerImgAnim").removeClass('loading');
				$("#headerImgAnim img:eq(0)").addClass('active');
				$("#headerImgAnim").fadeIn(anim.iFadeSpeed, function () {
					if (anim.aPreloadImages.length > 1)
						anim.playAnim();
				});
			}});
		},

		 playAnim : function(){
			var oActiveImg = $("#headerImgAnim img:eq(" + this.iCurrentImg + ")");
			oActiveImg.addClass('active');
			if(this.iCurrentImg == this.aPreloadImages.length - 1){
				this.iCurrentImg = 0;
			} else {
				this.iCurrentImg++;
			}
			var oNextImg = $("#headerImgAnim img:eq(" + this.iCurrentImg + ")");
			oNextImg.show();
			window.setTimeout(function(){ anim.resume(oActiveImg)},this.iShowMS);
		},
		resume : function(oActiveImg){
			oActiveImg.fadeOut(anim.iFadeSpeed, function(){ anim.playAnim(); $(this).removeClass('active') })
		}
	}
	
	$(document).ready(function(){
		$('a[rel*=lightbox]').lightBox({
			imageLoading:'../../images/lightbox-ico-loading.gif',
			imageBtnPrev:'../../images/lightbox-btn-prev.gif',
			imageBtnNext:'../../images/lightbox-btn-next.gif',
			imageBtnClose:'../../images/lightbox-btn-close.gif',
			imageBlank:'../../images/lightbox-blank.gif',
			txtImage: 'Bild',
			txtOf : 'von'
		});
		
	})
