$(document).ready(function()
  {
   $('#anispan').keydown(function() {
 if ($(this).val()=="recrapla"){
   $("#verzenden").removeAttr("disabled");
 }
});
        $(".tweet").tweet({
          join_text: "auto",
          username: "woutervanreeven",
          avatar_size: 48,
          count: 12,
          auto_join_text_default: "we said,",
          auto_join_text_ed: "we",
          auto_join_text_ing: "we were",
          auto_join_text_reply: "we replied",
          auto_join_text_url: "we were checking out",
          loading_text: "loading tweets..."
        });
   $(".content-item").css("width", $('#rightcontent').width());
    $('#menu li').mouseover(function()
      {

        var cnt = $(this).attr('title');
        switch (cnt) {
          case 'about':
            $("body").css("background", "url('/woutervanreeven/images/backgrounds/" + cnt + ".jpg')");
          case 'projecten':
            $("body").css("background", "url('/woutervanreeven/images/backgrounds/" + cnt + ".jpg')");
        }
        $("body").css("background-repeat", "no-repeat");
        $("body").css("background-attachment", "fixed");
        $("body").css("background-color", "#000000");
      }
    );

    VideoJS.player.newBehavior("playButton", function(element)
      {
        _V_.addListener(element, "click", this.onPlayButtonClick.context(this));
      }, {
      onPlayButtonClick: function(event) {
          this.enterFullScreen();
          this.play();
        }
      }
    );

    $("video").VideoJS();
    var hash = window.location.hash.split('/');
    if (hash[1]) {
      ajax_request(hash[2], hash[3]);
    } else {
      // ajax_request('index','test');
    }
    $('#menu li').hover(function()
      {
        var image = $(this).attr('rel');
        if (image) {
          $("#header").removeClass('header').addClass(image);
        }
      }
    );
    $('#rechts').click(function()
      {
        //$('#inrechts').show();
        $('#rechts').animate({width: "200px"}, 1000);
        //$('#rechts').width("200px").slideDown();
      }
    );
    $('#rechts').mouseout(function()
      {
        //$('#inrechts').hide();
        $('#rechts').animate({width: "20px"}, 1000);

      }
    );
    $('a').click(function()
      {
        var hash = this.hash.split('/');
        if (hash[1]) {
          ajax_request(hash[2], hash[3]);
        }

      }
    );
    $('#fancyClock').tzineClock();


    function ajax_request(file, go) {
      $('#rightcontent').html('<p><img src="images/ajax-loader.gif"/></p>');
      $.ajax(
        {
        url: 'meer/' + file + '.php?go=' + go,
        success: function(data) {
            $('#rightcontent').html(data);
          }
        }
      );

    }

    $(".overwindow").live('click', function()
      {
        $.fn.colorbox(
          {
          href: $(this).attr('href'),
          width: "80%", height: "80%",
          iframe: true,
          onComplete: function() {
              alert("is geladen");
            }
          }
        );
        return false;
      }
    );
    $("#tabsen").tabs();
    $("input:button, input:submit").button();
    $('input.stap1').click(function()
      {
        $("#tabsen").tabs("select", 1);

      }
    );

    $("a.jQueryBookmark").click(function(e)
      {
        e.preventDefault(); // this will prevent the anchor tag from going the user off to the link
        var bookmarkUrl = this.href;
        var bookmarkTitle = this.title;

        if (window.sidebar) {// For Mozilla Firefox Bookmark
          window.sidebar.addPanel(bookmarkTitle, bookmarkUrl, "");
        } else if(window.external || document.all) {// For IE Favorite
          window.external.AddFavorite(bookmarkUrl, bookmarkTitle);
        } else if(window.opera) {// For Opera Browsers
          $("a.jQueryBookmark").attr("href", bookmarkUrl);
          $("a.jQueryBookmark").attr("title", bookmarkTitle);
          $("a.jQueryBookmark").attr("rel", "sidebar");
        } else {// for other browsers which does not support
          alert('Your browser does not support this bookmark action');
          return false;
        }
      }
    );

    $('#rightcontent').fadeIn(2000);
  }
);
function scrollto(element, wele) {
  var w = $('#rightcontent').width()-40;
  w = w * wele;
  $('#content-scroll').animate({scrollLeft: w}, 'slow');
}
function fadeiten(items) {
  $(items + ' li').hide();
  $(items + ' li').each(function(i)
    {
        $(this).delay(i*500).fadeOut(1500, function()
        {
          $(this).fadeIn(700);
         }
      );
    }
  );
}

