$(function(){
  $("#news div h3").click(
        function () {
          $("#news div.active").removeClass("active");
          $(this).parent().toggleClass("active");
          return false;
        }
      );

  $("a.projectShow").click(
        function () {
          $(this).parent().parent().children(".archive").show("slow");
          $(this).hide();
          return false;
        }
      );

  $("#gallery img").fullsize({iconOffset: 0,leftOffset: 0, topOffset: 0});

  $("#structure div a.header").click(function () {
        $(this).nextAll("p").toggle("fast");
        return false;
  });

  var i=0;
  var j=0;
  var theme = $("#themeList a");
  var corp = $("#corpList a");


  function rotateCovers()
  {
    if (i>theme.length-1) {i=0}
    $(theme[i]).trigger('mouseover');
    i++;
    if (j>corp.length-1) {j=0}
    $(corp[j]).trigger('mouseover');
    j++;
  }

  var intervalID=setInterval(rotateCovers, 2000);

  //$('.clients-list div').fitMaxHeightByRow();
});
