//<![CDATA[

  $(document).ready(function() {
    $("div.cornered").corner();

    $("input[type=text]:first").focus();

    // Nav

    $('#main-nav li.has-submenu').hoverIntent(function() {
      $(this).children("a").addClass("current2");
      $(this).children('.submenu').fadeIn("fast");
    }, function() {
      $(this).children("a").removeClass("current2");
      $(this).children('.submenu').fadeOut("fast"); ;
    });


    // initialize scrollable

    $("#news div.newscroll").scrollable({
      vertical:true,
      size: 1,
      next: 'a.nextNews',
      prev: 'a.prevNews',
      interval: 8000,
      loop: true,
      speed: 600,
      onBeforeSeek: function() {
          this.getItems().fadeTo(300, 0.2);
      },
      onSeek: function() {
          this.getItems().fadeTo(300, 1);
      }
     });

    $("#events div.eventscroll").scrollable({
      vertical:true,
      size: 3,
      next: '#controllers a.nextEvent',
      prev: '#controllers a.prevEvent',

      // items are auto-scrolled in 2 secnod interval
      interval: 5000,

      // when last item is encountered go back to first item
      loop: true,

      // make animation a little slower than the default
      speed: 600
      // // when seek starts make items little transparent
      // onBeforeSeek: function() {
      //     this.getItems().fadeTo(300, 0.2);
      // },
      //
      // // when seek ends resume items to full transparency
      // onSeek: function() {
      //     this.getItems().fadeTo(300, 1);
      // }
     });

     // Tabs

     var tabContainers = $('div.tabs > div.infoContentIn');

     $('div.tabs ul.tabNavigation a').click(function () {
         tabContainers.hide().filter(this.hash).show();

         $('div.tabs ul.tabNavigation a').removeClass('current');
         $(this).addClass('current');

         return false;
     }).filter(':first').click();

  });
//]]>
