var headline_count;
var current_headline=0;

$(document).ready(function(){

	$(".show-hide-project1").click(function(){
		$("#project1").slideToggle("normal");
		return false;
	});
	$(".show-hide-project2").click(function(){
		$("#project2").slideToggle("normal");
		return false;
	});
	$(".show-hide-project3").click(function(){
		$("#project3").slideToggle("normal");
		return false;
	});



	$(".show-hide-blog1").click(function(){
		$("#blog1").slideToggle("normal");
		return false;
	});
	$(".show-hide-blog2").click(function(){
		$("#blog2").slideToggle("normal");
		return false;
	});
	$(".show-hide-blog3").click(function(){
		$("#blog3").slideToggle("normal");
		return false;
	});


	$(".show-hide-news1").click(function(){
		$("#news1").slideToggle("normal");
		return false;
	});
	$(".show-hide-news2").click(function(){
		$("#news2").slideToggle("normal");
		return false;
	});
	$(".show-hide-news3").click(function(){
		$("#news3").slideToggle("normal");
		return false;
	});

	$(".footerteaser").hide();

	$("p.footerdrop").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false; 
	});

	headline_count = $("div.headline").size();
	$("div.headline:eq("+current_headline+")").css('top', '5px');
	setInterval(headline_rotate,5000); //time in milliseconds

});

function formatText(index, panel) {
return index + "";
};

$(function () {

	$('.anythingSlider').anythingSlider({
		easing: "easeInOutExpo",
		autoPlay: true,
		delay:  10000,
		startStopped: false,
		animationTime: 800,
		hashTags: false,
		buildNavigation: true,
		pauseOnHover: true,
		startText: "Go",
		stopText: "Stop",
		navigationFormatter: formatText
	});
	
	$("#slide-jump").click(function(){
		$('.anythingSlider').anythingSlider(9);
	});
	
});

function headline_rotate() {
  old_headline = current_headline % headline_count;
  new_headline = ++current_headline % headline_count;
  $("div.headline:eq(" + old_headline + ")").css('top', '20px');
  $("div.headline:eq(" + new_headline + ")").show().animate({top: 5},"slow");     
}

