function startLavalamp() {
//LAVALAMP MENU
    $('#nav ul#lavaLampBasicImage').lavaLamp({
        fx: "easeOutQuad",
        autoResize:true,
        speed: 300
    });
}

$(function(){

    $('#setYear').change(function(){
        $('#setYearForm').submit();
    });

    $('#setHarbor').change(function(){
        $('#setHarborForm').submit();
    });

    $('#setSector').change(function(){
        $('#setSectorForm').submit();
    });

    $('#setCompany').change(function(){
        $('#setCompanyForm').submit();
    });

    //TRAININGEN LOKET DROPDOWN
	 $('#TrloketDropdown').hover( function() {
        $('#subnavLoketTrnng').stop(true, true).fadeIn(200);
    }, function() {
        $('#subnavLoketTrnng').stop(true, true).fadeOut(200);
    });

    //SOCIAL MEDIA HOVER
    if (navigator.appName != "Microsoft Internet Explorer") {
        $('.socialIcon').fadeTo(0, 1);
        $('.socialIcon').hover( function() {
            $(this).stop(true, true).fadeTo(300, 0.6);
        }, function() {
            $(this).stop(true, true).fadeTo(300, 1);
        });
    }

    //CUFON
    Cufon.replace('h1');
    Cufon.replace('.mainContent h2');
    Cufon.replace('#nav a, #subnavLoketTrnng a', { hover : true });
    Cufon.replace('.leftblock h2', { hover : true });

    //CYCLE ARTIKEL HOME
    $('#header_cycle').cycle({
        fx: 'fade',
        timeout: 4500
    });

    //CYCLE NEWS ARCHIVE
    $('#newsArchive').cycle({
        fx: "scrollVert",
        timeout: 0,
        startingSlide:   0,
        pager:  '.pager',
        pagerAnchorBuilder: function(idx, slide) {
            return '<a href="#"> &bull; </a>';
        },

        before: function(slide,next){
                $("#newsArchive").animate({
                'height' :  $(next).height()+20
                }, 1000);
        }
    }, 500);

    //CYCLE MEMBERS
    $('.mailinqsPage').cycle({
        fx: "scrollHorz",
        timeout: 0,
        startingSlide:   0,
        pager:  '.pager',
        after: function(slide,next){
            $(".mailinqsPage").animate({
            'height' :  $(next).height()+20
            }, 1000);
        }
    }, 500);

    $('.oddeven:even').css("background-color", "#eff1f7");

    //CYCLE GUESTBOOK
    $('.cycle').cycle({
        fx: "scrollVert",
        timeout: 0,
        startingSlide:   0,
        pager:  '.pager',
        pagerAnchorBuilder: function(idx, slide) {
            return '<a href="#"> &bull; </a>';
        },

        before: function(slide,next){
            $(".cycle").animate({
            'height' :  $(next).height()
            }, 1000);
        }
    }, 500);

    $(".validateMe").validate({
        messages: {
            name: {
                required: 'Vul hier uw naam in'
            },
            mail: {
                required: 'Vul hier uw e-mailadres in',
                email: 'Vul hier een geldig e-mailadres in'
            },
            seccode: {
                required: 'Type hier de beveiligings code over'
            }
        }
    });

    //FANCYBOX
        $(".fancybox").fancybox();
        $(".ifancybox").fancybox({
            type: 'iframe',
            width: '80%',
            height: '80%'
    });

    //FANCYBOX FLOORPLANNER
        $("a.fancyboxIframe").fancybox({
            'width'        : '85%',
            'height'      : '85%',
            'autoScale'       : false,
            'transitionIn'    : 'none',
            'transitionOut'    : 'none',
            'type'        : 'iframe'
        });

    //FANCYBOX PROJECTEN
    $("a.gallery").fancybox();

    //DROPDOWN
    $('#nav ul li').hover( function() {
        $(this).children('ul').stop(true, true).fadeIn(200);
    }, function() {
        $(this).children('ul').stop(true, true).fadeOut(200);
    });

    setTimeout('startLavalamp()', 150);

    var addThis = ' \
        <div class="addthis_toolbox addthis_default_style "> \
            <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> \
            <a class="addthis_button_tweet"></a> \
            <a class="addthis_counter addthis_pill_style"></a> \
        </div> \
        <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4d876ad2446fbbb6"></script>';

    $('#addThis').append(addThis);
});

