$(document).ready(function(){
  $('#slogans').innerfade({ 
    animationtype: 'slide', 
    speed: 'normal', 
    timeout: 5000, 
    type: 'random', 
    containerheight: '4em' }); 
    
  // countdown
  var austDay = new Date();
	austDay = new Date(2011,8,2,9,00);
	
	if(new Date() < austDay){
	  beforeCountdown();
	}
	
	function beforeCountdown(){
	  $("#subForm").hide();
    $(".remark_before").show();
    $(".remark_after").hide();
	}
	
  function afterCountdown(){
    $("#subForm").show();
    $(".remark_before").hide();
    $(".remark_after").show();
  }
  
  
  $("#counter").countdown({
    until: austDay,
    onExpiry: afterCountdown
  });
  
  // tags
  $(".tag_title").click(function(){
    $(this).next().toggle();
  })

  function open_tag() {
    if(document.location.hash != ""){
      var hash_word = document.location.hash;
      hash_word = hash_word.substr(1, hash_word.length);
      $("a[name="+hash_word+"]").next().click();
    }
  }
  open_tag();

  // /tags

  // moet laatst want houdt de pagina op
  $("#tweets").tweet({
      avatar_size: 32,
      count: 4,
      username: "by2_be",
      template: "{time} {text}",
      loading_text: "laden ..."
    });
  }).bind("loaded", function(){
    $(this).find("a.tweet_action").click(function(ev) {
      window.open(this.href, "Retweet",
        'menubar=0,resizable=0,width=550,height=420,top=200,left=400');
      ev.preventDefault();
    });

});

