$(document).ready(function(){
$(".item-img-a").each(function(index) {
$(this).cycle({
fx: 'fade',
speed: 300,
next: $(this),
timeout: 0
});
});

$(".codeblock").hover(function() {
    var contentwidth = $(this).contents().width();
    var blockwidth = $(this).width();		
    if(contentwidth > blockwidth) {
        $("#artikels").css("overflow","visible");
        $("#artikels .artikel").css("overflow","visible");
        $(this).animate({ width: contentwidth + 10}, 250);
        }
    }, function() {
        $(this).animate({ width: "425px" }, 250, function() {
        $("#artikels").css("overflow","hidden");
        $("#artikels .artikel").css("overflow","hidden");
});
});

$(".codeblock code span").css("color","#555");

var $s = $('#keywords');
  var searchLabel = "Zoeken...";

  function restoreSearch() {   
    if ($s.val() == '') {$s.val(searchLabel);} 
    if ($s.val() == searchLabel) {$s.addClass('faded');}
  }
  
  restoreSearch();
  
  $s.focus(function() {
    $s.removeClass('faded');
    if ($s.val() == searchLabel) {$s.val('');}
  })
  .blur(restoreSearch);

$('span.datum').each(function(index) {$(this).css({display:'inline',fontSize:'.8em'}).prependTo($(this).next('p'));
});

$("#comment").focus(function() {
var position = $(this).position();
$("#artikels").css("overflow","visible");
$("#comments").css("overflow","visible");
$("#tekstballon").fadeIn().css({left:position.left +446,top:position.top});
});

$("#comment").blur(function() {$("#tekstballon").fadeOut();}, function() {
$("#artikels").css("overflow","hidden");
$("#comments").css("overflow","hidden");
});

});


