//<![CDATA[
$(document).ready(function(){

    // hide sub menus
    $('#quicknavi ul').hide();
    // toggle sub menus on hover

    $('#quicknavi li ul').css( { 'visibility' : 'visible' } );
    $('#quicknavi > li')
        .hover(function(e) {
            $(this).children('ul').hoverFlow(e.type, {
                'height': 'show',
                'marginTop': 'show',
                'marginBottom': 'show',
                'paddingTop': 'show',
                'paddingBottom': 'show'
            });
        }, function(e) {
            $(this).children('ul').hoverFlow(e.type, {
                'height': 'hide',
                'marginTop': 'hide',
                'marginBottom': 'hide',
                'paddingTop': 'hide',
                'paddingBottom': 'hide'
            });
        });

    var first = true; //for first round of rotator
    //Set meta datasource
    jQuery.metadata.setType("class");
    //Append pictures to rotator after document ready

$('#rotate-pictures').nivoSlider({
    effect: 'boxRain', // Specify sets like: 'fold,fade,sliceDown'
    slices: 15, // For slice animations
    boxCols: 10, // For box animations
    boxRows: 6, // For box animations
    animSpeed: 500, // Slide transition speed
    pauseTime: 4000, // How long each slide will show
    startSlide: 0, // Set starting Slide (0 index)
    directionNav: false, // Next & Prev navigation
    directionNavHide: true, // Only show on hover
    controlNav: false, // 1,2,3... navigation
    controlNavThumbs: false, // Use thumbnails for Control Nav
    controlNavThumbsFromRel: false, // Use image rel for thumbs
    controlNavThumbsSearch: '.jpg', // Replace this with...
    controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
    keyboardNav: true, // Use left & right arrows
    pauseOnHover: true, // Stop animation while hovering
    manualAdvance: false, // Force manual transitions
    captionOpacity: 0.8, // Universal caption opacity
    prevText: 'Prev', // Prev directionNav text
    nextText: 'Next', // Next directionNav text
    randomStart: false, // Start on a random slide
    beforeChange: function(){}, // Triggers before a slide transition
    afterChange: function(){}, // Triggers after a slide transition
    slideshowEnd: function(){}, // Triggers after all slides have been shown
    lastSlide: function(){}, // Triggers when last slide is shown
    afterLoad: function(){} // Triggers when slider has loaded
});

//Against Blur thing
$('a').focus(function(){ $(this).blur();});
//For the image links
$("a[href$='.pdf']").addClass("pdf");
$("a[href$='.doc'], a[href$='.txt'], a[href$='.rft']").addClass("txt");
$("a[href$='.zip'], a[href$='.rar']").addClass("zip");
$("a[href*='mailto:']").addClass("email");
});

function googleTranslateElementInit() {
    new google.translate.TranslateElement({
        pageLanguage: 'de',
        gaTrack: true,
        gaId: 'UA-7667169-1',
        floatPosition: google.translate.TranslateElement.FloatPosition.TOP_RIGHT
    });
}

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-7667169-1']);
_gaq.push(['_gat._anonymizeIp']);
_gaq.push(['_trackPageview']);
(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
// ]]>

