


	is_preloading = false;


	var Browser = {
		detect: function() {
		var UA = navigator.userAgent;
		this.isKHTML = /Konqueror|Safari|KHTML/.test(UA);
		this.isGecko = (/Gecko/.test(UA) && !this.isKHTML);
		this.isOpera = /Opera/.test(UA);
		this.isMSIE = (/MSIE/.test(UA) && !this.isOpera);
		this.isMSIE7 = this.isMSIE && !(/MSIE 6\./.test(UA) && !this.isOpera);
		this.isMSIE6 = this.isMSIE && !this.isMSIE7;
		}
	}
	Browser.detect();







	function Load() {


		/**
		*
		*	INITIALISIEREN
		*
		**/
		this.init = function(arr) {
			if(arr.length > 0) {

				count(arr.length);
				rand = Math.round(Math.random()*100);

				this.imgs = new Array();
				this.imgsIE = new Array();
				for(i=0; i<arr.length; i++) {

					if(!Browser.isMSIE) {

						this.imgs[i] = new Image(1,1);
						this.imgs[i].onload = function() { count('+'); };
						this.imgs[i].src = '/imgs/' + arr[i];

					} else {

						this.imgs[i] = new Image(1,1);
						this.imgs[i].onload = function() { count('+'); };
						this.imgs[i].src = '/imgs/' + arr[i] + '?' + rand;

						this.imgsIE[i] = new Image(1,1);
						this.imgsIE[i].src = '/imgs/' + arr[i];

					}

				}

			}
		}


		/**
		*
		*	ZÄHLEN
		*
		**/
		count = function(v) {

			if(v == '+') {

				this.counter++;
				
				amount = (counter * loading_percentage);
				if(amount > 100) { amount = 100; };
				$('preloader_counter').innerHTML = amount;

				if(this.counter == this.maxcounter) {

					finish();

					this.counter = 0;
					this.maxcounter = 0;

				}
				
					
				

			}

			else {

				this.counter = 0;
				this.maxcounter = v;
				
				this.loading_percentage = Math.round(100 / v);

			}

		}


		/**
		*
		*	BEENDEN
		*
		**/
		this.afterFinish = function(v) {

			finishfunction = v;

		}
		finish = function() {

			new Effect.Fade('preloader', { duration:0.5, afterFinish:function() {
			
				Element.remove('preloader');

				window.setTimeout(function() { 
					eval(finishfunction);
				}, 750);
				
			}});

		}


	}
























	/**
	*
	*	LOAD ANY PAGE
	*
	**/
	function load_page(which) {

		if(which == 'intro') {

			load_intro_page();

		}

		else {

			new Effect.Appear('innersite', { duration:0.6, afterFinish:function() {
			
				window.setTimeout(function() {
					new Effect.Appear('contentbox', { duration:0.8, to:0.8 });	
				}, 300);
			
			}});


		}

	}


















	/**
	*
	*	UNLOAD AND CLOSE ANY PAGE
	*
	**/
	function unload_page(target) {


		if(current_page == 'intro') {

			close_intro();
			timer = 2000;

		}

		else {

			new Effect.Fade('innersite', { duration:0.6 });
			timer = 650;

		}



		window.setTimeout(function() { window.location.href = target; }, timer);

		return false;

	}





















	/**
	*
	*	CLOSE INTRO
	*
	**/
	function close_intro() {

		function close_intro_nav() {

			nav_items = $('nav').getElementsByTagName('li');

			_plusminus = 1;
			_duration = 1;

			for(i=0; i<nav_items.length; i++) {

				(_plusminus == 1) ? _plusminus = -1 : _plusminus = 1;
				_duration = ((Math.round(Math.random() * 10)-3) / 10); if(_duration < 0.2) _duration = 0.2;

				new Effect.MoveBy(nav_items[i], 0, (900) * _plusminus, { duration:_duration });
				new Effect.Fade(nav_items[i], { duration:_duration });

			}

		}

		close_intro_nav();
		window.setTimeout(function() {

			new Effect.BlindUp('innersite', { duration:0.3 });

		}, 1000);

	}

















	/**
	*
	*	LOAD INTRO
	*
	**/
	function load_intro() {

		window.setTimeout(function() {

			$('innersite').style.background = 'url(/imgs/bg_intro.jpg) no-repeat';
			new Effect.BlindDown('innersite', { duration:0.3, afterFinish:function() {

				new Effect.Appear('h2', { afterFinish:function() {

					nav_items = $('nav').getElementsByTagName('li');
					for(i=0; i<nav_items.length; i++) {
						new Effect.Appear(nav_items[i].firstChild, { duration:0.3, queue:'end' });
					}

				}});

			}});

		}, 500);

	}

	function load_intro_page() {

		load_intro();

	}











	function _go(where) {
	
		if(where == 'set') where_am_i = 0;

		p = document.getElementsByClassName('content-item');
		dir = false;
		
		if(where == 'up') { 
			dir = 1;
			if((where_am_i+1) > 0) { dir = false; }
			else { where_am_i++; }
		}
		
		if(where == 'down') { 
			dir = -1;
			if((where_am_i-1) <= (p.length * -1)) { dir = false; }
			else { where_am_i--; }
		}
		
		
		if(where_am_i == ((p.length * -1) +1)) { 
			$('b_down').style.visibility = 'hidden';
		} else { 
			$('b_down').style.visibility = 'visible';
		}
		
		if(where_am_i == 0) { 
			$('b_up').style.visibility = 'hidden';
		} else { 
			$('b_up').style.visibility = 'visible';
		}
		

		if(dir) { 
		
			new Effect.MoveBy('innercontentbox', (dir * 295), 0, { duration:0.1, queue:'end' }); 			
			
		}

		return false;

	}











	var wheelCallback = Prototype.K;

	function handleMouseWheel(delta) {

		if(delta < 0) _go('down');
		if(delta > 0) _go('up');

	}



	function wheel(event){
	  var delta = 0;
	  if (!event) event = window.event;
	  if (event.wheelDelta) {
		delta = event.wheelDelta/120;
		if (window.opera) delta = -delta;
	  } else if (event.detail) {
		delta = -event.detail/3;
	  }
	  if (delta) handleMouseWheel(delta);
	}

	if (window.addEventListener)
	  window.addEventListener('DOMMouseScroll', wheel, false);
	window.onmousewheel = document.onmousewheel = wheel;






	
	
	
	
	
	
	
	
	
	currentBigBox = 1;
	
	function bigpop(what) {
	
		if($('big'+what)) {
		
			Element.show('modal');
	
			new Effect.Fade('contentbox', { 
				duration:0.2, 
				to:0.2 
			}); 

			new Effect.Appear('big'+what, { 
				duration:0.2,
				to:0.8 
			});
			
			currentBigBox = what;
			
		}
		
		return false;
		
	}



	function bigclose(what) {
	
		if(what == 'current') what = currentBigBox;
	
		if($('big'+what)) {
		
			new Effect.Fade('big'+what, { 
				duration:0.2 
			}); 
			
			new Effect.Appear('contentbox', { 
				duration:0.2, 
				to:0.8
			});
			
			Element.hide('modal');
			
		}
			
		return false;
		
	}



	

