
$(function(){
	
	// LOGO REMOVE CLASS
	$('#logo, .pfeil').removeClass('over');
	
	
	$('#logo a')
	.mouseover(function(){
			$('#logo a').css('background-position', '200px 70px');
			$('#logo a').stop().animate({backgroundPosition: '320px 70px'}, {duration:750});
	})
	.mouseout(function(){
			$('#logo a').stop().animate({backgroundPosition: '360px 70px'}, {duration:750, complete:function(){
					$('#logo a').css('background-position', '-20px 70px');																						 
			}});	
	});
	
	

	// SET TIMER VAR
	var TimeOut = false;
	
	// HIDE
	$('#logo, .pozzi7, .referenzen, .news, .kontakt, #content, footer').hide();
	
	//$('#logo').fadeIn(1000);
	$('#logo').animate({height: 'toggle', opacity:'show'}, {duration:1000, easing:'jswing'});
	
	// click auf logo -> animation starten
	$('#animation').click(function(){
		
		$('.pozzi7').animate({height: 'toggle', opacity:'show'}, 300, 'jswing', function(){
			$('.referenzen').animate({height: 'toggle', opacity:'show'}, 300, 'jswing', function(){
				$('.news').animate({height: 'toggle', opacity:'show'}, 300, 'jswing', function(){
					$('.kontakt').animate({height: 'toggle', opacity:'show'}, 300, 'jswing', function(){
						$('#content').animate({width: 'toggle', opacity:'show'}, 600, 'jswing', function(){
							$('footer').animate({height: 'toggle', opacity:'show'}, 300, 'jswing');																		 
						});
					});																					  
				});																					  
			});					   
		});
		
		$('#animation').unbind('click');
		return false;
		
		TimeOut = true;
	});
	
	// falls logo nicht geklickt wird -> animation automatisch starten
	setTimeout(function(){ 
		if(TimeOut == false){
			
			$('.pozzi7').animate({height: 'toggle', opacity:'show'}, 300, 'jswing', function(){
				$('.referenzen').animate({height: 'toggle', opacity:'show'}, 300, 'jswing', function(){
					$('.news').animate({height: 'toggle', opacity:'show'}, 300, 'jswing', function(){
						$('.kontakt').animate({height: 'toggle', opacity:'show'}, 300, 'jswing', function(){
							$('#content').animate({width: 'toggle', opacity:'show'}, 600, 'jswing', function(){
								$('footer').animate({height: 'toggle', opacity:'show'}, 300, 'jswing');																		 
							});
						});																					  
					});																					  
				});					   
			});
			
			$('#animation').unbind('click');
			
		};
	}, 4000);

	
	
	// NAVIGATION EFFEKTE
	
	// PFEIL ROT EFFEKT
	// #navigation li ul li a:hover span.pfeil{display:block; visibility:visible; width:185px; height:18px; background:url(../img/pfeil_rot.png) top left no-repeat;}
	$('#navigation li ul li a span').mouseover(function(){
			$(this).css('background-image', 'url(web/../img/pfeil_rot.png)');
			$(this).stop().animate({backgroundPosition: '0 0', opacity: '1'}, {duration:500});
	})
	.mouseout(function(){
			$(this).stop().animate({backgroundPosition: '15px 0', opacity: '0'}, {duration:750, complete:function(){
					$(this).css('background-image', 'none');
					$(this).css('background-position', '-20px 0');
			}});
	});
	
	
	// NAVIGATIONSPUNKTE EFFKET	
	/*
	$('#navigation li').mouseover(function(){
			$('#logo a').css('background-position', '200px 70px');
			$('#logo a').stop().animate({backgroundPosition: '320px 70px'}, {duration:750});
	})
	.mouseout(function(){
			$('#logo a').stop().animate({backgroundPosition: '360px 70px'}, {duration:750, complete:function(){
					$('#logo a').css('background-position', '-20px 70px');																						 
			}});	
	});
	*/
	


});








