jQuery(function($) {
  newsBoxes();
  publications();
  linkTables();
});

function newsBoxes () {
  var $boxContent = $('#content .newsContent');
  if (! $boxContent.length ) return;
  
  $boxContent
  .click(function(event) {
    if ( $(event.target).is('a') ) return true;
    
    window.location = $(this).find('h1 a').attr('href');
  })
  .hover(
    function() { $(this).addClass('hover'); },
    function() { $(this).removeClass('hover'); }
  )
  ;
}

function publications () {
  var pubImages = $('#news > ul > li > img');
  if (! pubImages.length ) return;
  
  pubImages.click(function() {
    window.location = $(this).next('a').attr('href');
  })
}

function linkTables () {
  var linkTables = $('#content table.daten, #content table.trLinks');
  if (! linkTables.length ) return;
  
  linkTables.find('tr')
  .css('cursor', 'pointer')
  .click(function(event) {
    if ( $(event.target).is('a') ) return true;
    window.location = $(this).find('a').attr('href');
  })
  ;
}
