$(document).ready(function(){
	
	// jq loop der 5 teaser um die teaser width
			function loop(){
			$("#jteaserimg").animate({
				left: '-=418'
			}, 800, function(){
			// Animation complete.
			}).delay(4500);
		}
		
		// variable für die anzahl der durchgänge/teaser
		var d = 0;
		
		function animateteaser(){
		// 30 durchgänge der ani, sollte langen
			while(d<=30){
			loop();
			d++;
			
			// nach durchgängen wieder auf x=0 setzen
			if (d == 5 || d == 10 || d == 15 || d == 20 || d == 25 || d == 30){
				$("#jteaserimg").animate({
					left: '0'
				}, 0, function() {
				// Animation complete.   
				});
			}
			
			}
		}
		
		function iniloop(){
		
		$("#jteaserimg").animate({
			left: '0'
		}, 800, function(){
		// Animation complete.
		startloop();
		}).delay(3000);
		}
		
		function startloop(){
		//alert("fertig");
		animateteaser();
		}
		
//starten
	//animateteaser();
	iniloop();
	
});		


