// JavaScript Document
$(document).ready(function() {
	
	//WERBUNG AUSBLENDEN
	//$('.werbung').bind()
	//if($('.sidebarcontent','.werbung').height() == 0){
	//	$(this).hide();
	//	};
	$('.werbung').each(function() {if($('.sidebarcontent',this).height() == 0){$(this).hide(0);};});
	
	
	bild = 0;
	dir="next";
	autoslide = "on";
  $('#suche').animate({height: 'toggle'}, 0, function() {});
  $('#login').animate({height: 'toggle'}, 0, function() {});
  animatelogin = function(){$('#login').animate({height: 'toggle'}, 300, function() {});}
  animatesuche = function(){$('#suche').animate({height: 'toggle'}, 300, function() {});}
	
	
	topstoriesanimate = function(bild){
		autoslide = "off";
		aktuellesbild = bild;
		bild = bild;
		  $('#topstories_images_animate').animate({marginTop: (175*bild)*-1}, 1000, function() {});
		  $('#topstories_text_animate').animate({marginLeft: (314*bild)*-1}, 1000, function() {});
	}
	topstoriesanimateAUTO = function(){
		if(autoslide=="on"){
		  if(dir=="next"){bild=bild+1;if(bild==5){dir="prev";}}
		  if(dir=="prev"){bild=bild-1;if(bild==0){dir="next";}}

		  $('#topstories_images_animate').animate({marginTop: (175*bild)*-1}, 1000, function() {});
		  $('#topstories_text_animate').animate({marginLeft: (314*bild)*-1}, 1000, function() {});
		}
	}
	
	
	var deinTimer = window.setInterval("topstoriesanimateAUTO()", 10000);
	


//POKERFIRMA TEAM
$('#team1').click(function() {
  $('#team1').animate({width: '146px'}, 300, function() {});
  $('#team2').animate({width: '40px'}, 300, function() {});
  $('#team3').animate({width: '40px'}, 300, function() {});
  $('#team4').animate({width: '40px'}, 300, function() {});
});
$('#team2').click(function() {
  $('#team1').animate({width: '40px'}, 300, function() {});
  $('#team2').animate({width: '146px'}, 300, function() {});
  $('#team3').animate({width: '40px'}, 300, function() {});
  $('#team4').animate({width: '40px'}, 300, function() {});
});
$('#team3').click(function() {
  $('#team1').animate({width: '40px'}, 300, function() {});
  $('#team2').animate({width: '40px'}, 300, function() {});
  $('#team3').animate({width: '146px'}, 300, function() {});
  $('#team4').animate({width: '40px'}, 300, function() {});
});
$('#team4').click(function() {
  $('#team1').animate({width: '40px'}, 300, function() {});
  $('#team2').animate({width: '40px'}, 300, function() {});
  $('#team3').animate({width: '40px'}, 300, function() {});
  $('#team4').animate({width: '146px'}, 300, function() {});
});




//KOLUMNEN INFOBOX
$('#kolumnisteninfogotolinks').click(function() {
  $('#kolumnisteninfocontentanimate').animate({marginLeft: '-340px'}, 300, function() {});

});
$('#kolumnisteninfogotobio').click(function() {
  $('#kolumnisteninfocontentanimate').animate({marginLeft: '0px'}, 300, function() {});

});
//ein/ausblenden
kolumnenboxvis = "yes";
$('#kolumnisteninfobutton').click(function() {
	
	if(kolumnenboxvis == "yes"){
	  $('#kolumnisteninfo').animate({height: '25px'}, 300, function() {});
	  kolumnenboxvis = "no";
	}
	else if(kolumnenboxvis == "no"){
	  $('#kolumnisteninfo').animate({height: '200px'}, 300, function() {});
	  kolumnenboxvis = "yes";
	}

});



function blinkfadeout(){$("#blink").animate({
    opacity: 0.01
  },1000, function() {blinkfadein();});}
function blinkfadein(){$("#blink").animate({
    opacity: 1
  },1000, function() {blinkfadeout();});}
blinkfadeout();

}); 


