$(function(){
    $("#tweets").tweet({
        query: "cafeneys",
        join_text: "auto",
        avatar_size: 0,
        count: 3,
        auto_join_text_default: "", 
        auto_join_text_ed: "",
        auto_join_text_ing: "",
        auto_join_text_reply: "",
        auto_join_text_url: "",
        loading_text: '<div class="loadingTweets">Tweets worden geladen..</div>',
        template: '<p>{text}</p><strong><a href="{user_url}" class="tu_new" target="_blank">{screen_name}</a></strong><a class="timeGray">{time}</a>' 
    });	
    $('.toggleHeader').click(function(){
    	var obj = $(this);
    	if($('#headerTop').hasClass('hiddenHeader')) {
    		$('#headerTop').animate({height: '427px'}, 'slow', function(){
    			obj.html('Verbergen').removeClass('hiddenButton');
    			$(this).removeClass('hiddenHeader');
    		});	    		
    		$.cookie('show_header', '1', { expires: 1, path: '/' });
    	}
    	else {	    		
    		$('#headerTop').animate({height: '121px'}, 'slow', function(){
    			obj.html('Tonen').addClass('hiddenButton');
    			$(this).addClass('hiddenHeader');
    		});
    		$.cookie('show_header', '0', { expires: 1, path: '/' });
    	}
    	return false;
    });
    if($('.headerSlider img').length > 0)
    {
	    $('.headerSlider').cycle({
	    	timeout: 6000,
	    	after: function() {
	    		var id_slide = $(this).index();
	    		$('.description').fadeOut('slow');
	    		$('.description:eq('+id_slide+')').fadeIn('fast');
	    	},
	    	prev: '.prevSlide',
	    	next: '.nextSlide'
	    });    	
    }
    else
    {
		$('#headerTop').animate({height: '121px'}, 0, function(){
			$('.toggleHeader').html('Tonen').addClass('hiddenButton');
			$(this).addClass('hiddenHeader');
		});
		$.cookie('show_header', '0', { expires: 1, path: '/' });   	
    }
});
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-3353071-12']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();	
