/* Scrollbox für die Startseite */
// make jquery prototype compatible
var j = jQuery.noConflict();

  j(document).ready(function () {
  
  // initialze the pane
  var pane = j('#pane');
  pane.jScrollPane({
   animateTo:true, 
   showArrows:true}
  );

    // bind the shortnews to click event
  j('a.scroll-to-element-demo').click(function() {
   // resize the news-panel to the next news
   if (j(this).parent().parent().next().attr('id') != null)
    var top = j('#otherNews ul').css("top").substring(0, j('#otherNews ul').css("top").indexOf('px'));
   else 
    var top = 31;

     j('#otherNews ul').css("top", (top-31)+"px");

     // resize the scrollable news-content to the clicked news
   var targetElementSelectorString = j(this).attr('rel');
   pane[0].scrollTo(targetElementSelectorString);
   return false;
  });
});

