/* 
 * Front-end JQuery
 */

    /* -------------------------------------------------------------------------
     * SITE functions
     * -----------------------------------------------------------------------*/
     //tabs
        
     $(document).ready(function() {
    //Main Menu Hover-----------------------------------------------------------
      //move the image in pixel
         var move = -15;

         //zoom percentage, 1.2 =120%
         var zoom = 1.2;

         //On mouse over those thumbnail
         $('.teaser').hover(function() {

             //Set the width and height according to the zoom percentage
             width = $('.teaser').width() * zoom;
             height = $('.teaser').height() * zoom;

             //Move and zoom the image
             $(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:400});

             //Display the caption
             $(this).find('div.teaserCaption').stop(false,true).fadeIn(400);
         },
         function() {
             //Reset the image
             $(this).find('img').stop(false,true).animate({
                 'width':$('.teaser').width(),
                 'height':$('.teaser').height(),
                 'top':'0',
                 'left':'0'
             }, {duration:400});

             //Hide the caption
             $(this).find('div.teaserCaption').stop(false,true).fadeOut(400);
         });
         //---------------------------------------------------------------------
         //for the map
         /*$('#teaserMap').hover(function() {
             //Display the caption
             $(this).find('div.teaserCaption').show("slow");
         },
         function() {
             //Hide the caption
             $(this).find('div.teaserCaption').hide("slow");
         });*/
         //---------------------------------------------------------------------
         //news & events
         $(".top").click(function() {
              if ($(this).find("ul").is(":hidden")) {
                $(this).find("ul").slideDown("slow");
                $(this).addClass("open").removeClass("closed");
              } else {
                $(this).find("ul").slideUp("slow");
                $(this).addClass("closed").removeClass("open");
              }
        });
        //---------------------------------------------------------------------
        $(function() {
            $("#tabs").tabs();
        });
        
        //---------------------------------------------------------------------

    });
    