// THOMAS DEMHARTER JAVASCRIPT...

window.addEvent('domready', function(){




var el = $('content_welcome');
var el1 = $('content_archetypen');
var el2 = $('content_moeoef');
var el3 = $('content_feelchair');
var el4 = $('content_superpack');
var el5 = $('content_ums');
var el6 = $('content_lima');
var el7 = $('content_ledsring');
var el8 = $('content_cerazor');
var el9 = $('content_cad');
var el10 = $('content_bias');
var el11 = $('content_wendekubus');
var el12 = $('content_unfolded');
var el13 = $('content_house01');
var el14 = $('content_steps');
var el15 = $('content_demharter');
var el16 = $('content_imprint');
var el17 = $('content_copyrights');

var unterpunkt= el;
var unterpunkt_active= 'link_welcome';
var unterpunkt_previous= 'link_welcome';
var myElement = $(document.body);
// For the Fx.Scroll Event myElement...




var unterpunkt_counter = {"welcome": [1], "archetypen": [1], "moeoef": [1], "feelchair": [1], "superpack": [1], "ums": [1], "lima": [1], "ledsring": [1], "cerazor": [1], "cad": [1], "bias": [1], "wendekubus": [1], "unfolded": [1], "house01": [1], "steps": [1], "demharter": [1], "imprint": [1], "copyrights": [1]};




var p = new Preloader();
	$$('.preLoadImage img').each(function(img) {
		p.addEventOnLoad(img.src, function() {
			img.getParent().setStyle('background', 'none');
			img.setStyle('opacity', 0)
			img.style.display = 'block';
			img.effect('opacity').start(0,1);
		});
		p.addToQueue(img.src);
	})





// all mouseleave events

// $('kwick_main100').addEvent('mouseleave', el.fade.bind(el, [0]));
//$('kwick_main90').addEvent('mouseleave', el1.fade.bind(el1, [0]));
//$('kwick_main80').addEvent('mouseleave', el2.fade.bind(el2, [0]));
//$('kwick_main70').addEvent('mouseleave', el3.fade.bind(el3, [0]));
//$('kwick_main60').addEvent('mouseleave', el4.fade.bind(el4, [0])); not necessary because it needs to be up all the time to enable a click to links
//$('kwick_main50').addEvent('mouseleave', el5.fade.bind(el5, [0]));
// $('kwick_main40').addEvent('mouseleave', el6.fade.bind(el6, [0])); not necessary because it needs to be up all the time to enable to watch if mouse moved away from button by accident


// all mouseenter events
$('link_welcome').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el.fade(1);
		unterpunkt = el;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;
		unterpunkt_previous.tween('color', '#737577');
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);
		//alert(unterpunkt_counter['welcome'][0]);
		unterpunkt_counter['welcome'][0]= unterpunkt_counter['welcome'][0] + 2;  
});


$('link_archetypen').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el1.fade(1);
		unterpunkt = el1;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');
		unterpunkt_counter['archetypen'][0]= unterpunkt_counter['archetypen'][0] + 2;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

		//scroll.toElement('idee');

});


$('link_moeoef').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el2.fade(1);
		unterpunkt = el2;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;	
		unterpunkt_previous.tween('color', '#737577');
		unterpunkt_counter['moeoef'][0]= unterpunkt_counter['moeoef'][0] + 2;
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);



});



$('link_feelchair').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el3.fade(1);
		unterpunkt = el3;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');
		unterpunkt_counter['feelchair'][0]= unterpunkt_counter['feelchair'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

//scroll.toElement('myTop');
});
	

$('link_superpack').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el4.fade(1);
		unterpunkt = el4;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');
		unterpunkt_counter['superpack'][0]= unterpunkt_counter['superpack'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);		
});

$('link_ums').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el5.fade(1);
		unterpunkt = el5;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');		
		unterpunkt_counter['ums'][0]= unterpunkt_counter['ums'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);		
});
$('link_lima').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el6.fade(1);
		unterpunkt = el6;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');	
		unterpunkt_counter['lima'][0]= unterpunkt_counter['lima'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

});

$('link_ledsring').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el7.fade(1);
		unterpunkt = el7;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');		
		unterpunkt_counter['ledsring'][0]= unterpunkt_counter['ledsring'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

});

$('link_cerazor').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el8.fade(1);
		unterpunkt = el8;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');		
		unterpunkt_counter['cerazor'][0]= unterpunkt_counter['cerazor'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

});

$('link_cad').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el9.fade(1);
		unterpunkt = el9;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');	
		unterpunkt_counter['cad'][0]= unterpunkt_counter['cad'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

});

$('link_bias').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el10.fade(1);
		unterpunkt = el10;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');
		unterpunkt_counter['bias'][0]= unterpunkt_counter['bias'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);
});

$('link_wendekubus').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el11.fade(1);
		unterpunkt = el11;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');
		unterpunkt_counter['wendekubus'][0]= unterpunkt_counter['wendekubus'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

});

$('link_unfolded').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el12.fade(1);
		unterpunkt = el12;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');
		unterpunkt_counter['unfolded'][0]= unterpunkt_counter['unfolded'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

});


$('link_house01').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el13.fade(1);
		unterpunkt = el13;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');
		unterpunkt_counter['house01'][0]= unterpunkt_counter['house01'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);


});


$('link_steps').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el14.fade(1);
		unterpunkt = el14;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');		
		unterpunkt_counter['steps'][0]= unterpunkt_counter['steps'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

});

$('link_demharter').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el15.fade(1);
		unterpunkt = el15;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');
		unterpunkt_counter['demharter'][0]= unterpunkt_counter['demharter'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);
});


$('link_imprint').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el16.fade(1);
		unterpunkt = el16;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');
		unterpunkt_counter['imprint'][0]= unterpunkt_counter['imprint'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

});


$('link_copyrights').addEvent('click', function(e) {
		// You often will need to stop propagation of the event
		e.stop();
		unterpunkt.fade(0);
		el17.fade(1);
		unterpunkt = el17;
		unterpunkt_previous = unterpunkt_active;
		unterpunkt_active = this;		
		unterpunkt_previous.tween('color', '#737577');		
		unterpunkt_counter['copyrights'][0]= unterpunkt_counter['copyrights'][0] + 1;  
		var myFx = new Fx.Scroll(myElement).start(0, 0 * document.body.offsetHeight);

});




  
 /*

Für MouseEvent Over... gelb einfärben...  
 ohne Weiss für Aktives Element noch nicht gelöst wie...

*/
 
 $('link_welcome').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			//alert(unterpunkt_counter['welcome'][0])
			if(unterpunkt_active.id == 'link_welcome'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['welcome'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});
 
$('link_archetypen').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_archetypen'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['archetypen'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});
 
$('link_moeoef').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_moeoef'){
			var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['moeoef'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});
 
$('link_feelchair').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_feelchair'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['feelchair'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});
 
$('link_superpack').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_superpack'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['superpack'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});

$('link_ums').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_ums'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['ums'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});

 
$('link_lima').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_lima'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['lima'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});

 
$('link_ledsring').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_ledsring'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['ledsring'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});

$('link_cerazor').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_cerazor'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['cerazor'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});


$('link_cad').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_cad'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['cad'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});


$('link_bias').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_bias'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['bias'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});


$('link_wendekubus').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_wendekubus'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['wendekubus'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});


$('link_unfolded').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_unfolded'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['unfolded'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});


$('link_house01').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_house01'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['house01'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});


$('link_steps').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_steps'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['steps'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});

$('link_demharter').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_demharter'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['demharter'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});

 
 $('link_imprint').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_imprint'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['imprint'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});

 
 
 $('link_copyrights').set('opacity', 0.7).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'color': '#FFFF00'
			});
		},
	mouseleave: function(){
			// Morphes back to the original style
			if(unterpunkt_active.id == 'link_copyrights'){
				var linkcolor = '#FFFFFF'	
				}else if(unterpunkt_counter['copyrights'][0] >1) {
				var linkcolor = '#737577'	
				} else var linkcolor = '#000000'
			
			this.morph({
				opacity: 0.7,
				color: linkcolor
				//alert (this)
				//alert(unterpunkt_active);
			});
		}
	});

 
}); // end DOM Event
// JavaScript Document
