﻿$(document).ready(function () {
    $("#menu ul li:not(#menu ul li.active)").hover(function () {
        $(".left", this).css("background", "url('images/menubgleft.png') no-repeat");
        $(".mid", this).css("background", "url('images/menubg.png') repeat-x");
        $(".right", this).css("background", "url('images/menubgright.png') no-repeat");
    }, function () {
        $(".left", this).css("background", "url('images/menubglefttrans.png') no-repeat");
        $(".mid", this).css("background", "url('images/menubgtrans.png') repeat-x");
        $(".right", this).css("background", "url('images/menubgrighttrans.png') no-repeat");
    });

    $("#slideshow").cycle({
        fx: 'fade',
        timeout: 6000,
        speed: 1400,
        cleartypeNoBg: true
    });

    $("#model").MyDropdown();
    $("#benzine").MyDropdown();

    $("#slideshowbinnen").cycle({
        fx: 'fade',
        timeout: 4000,
        speed: 1400,
        prev: '#prev',
        next: '#next',
        cleartypeNoBg: true
    });

    $('#agendaitems').jcarousel({
        vertical: true,
        scroll: 1
    });

    $('a.bestemming[title]').qtip({
        style: {
            classes: 'ui-tooltip-custom'
        },
        position: {
            my: 'bottom left',
            at: 'top center',
            adjust: {
                x: -20,
                y: 10
            }
        }
    });

    $('.accordionButton').click(function () {
        $('.accordionButton').removeClass('on');
        $('.accordionContent').slideUp('normal');
        if ($(this).next().is(':hidden') == true) {
            $(this).addClass('on');
            $(this).next().slideDown('normal');
        }
    });
    $('.accordionButton').mouseover(function () {
        $(this).addClass('over');
    }).mouseout(function () {
        $(this).removeClass('over');
    });
    $('.accordionContent').hide();

    $(".fotoviewer").fancybox({
        helpers: {
            title: {
                type: 'float'
            }
        },
        arrows: true
    });

    $('.bestemmingClick').click(function () {
        window.location.href = $('a:first', $(this)).attr('href');
    }).css({ 'cursor': 'pointer' });

    $('.fotopop').fancybox();
});
