$(function(){
    //NAVIGATION DROPDOWN
    /*
    $('#nav li').hover(
        function () { $('ul', this).fadeIn(500);    },
        function () { $('ul', this).fadeOut(200); }
    );
    */

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

    //CUFON
    Cufon.set('fontFamily', 'Tahoma');
    Cufon.replace('h1');
    Cufon.replace('#subnav a', { hover : true });

    Cufon.set('fontFamily', 'Century Old Style Std');
    Cufon.replace('h2');
    Cufon('h2', {
            textShadow: '1px 1px #000'
    });


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

    $('.oddeven:odd').css("background-color", "#fff");

    //CYCLE NEWS pageSlide
    $('#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() + 50
                }, 1000);
        }
    }, 500);

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

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

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

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

    //FANCYBOX
        $(".fancybox").fancybox();

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

    //FANCYBOX PROJECTEN
    $("a.gallery").fancybox({
            titlePosition : 'inside',
            titleFormat   : function(title, currentArray, currentIndex, currentOpts) {
                return '<span id="fancybox-title-inside"><span class="floatRight" style="font-size: 10px; color: #333333;">' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span><span class="flaotLeft">'+title+'</span></span>';
            }
    });

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

    //LAVALAMP MENU
    $('#nav ul#lavaLampBasicImage').lavaLamp({
        fx: "backout",
        autoResize:true,
        speed: 700
    });

    // hover,active fix navigation
    if ($('#nav ul li.selectedLava').length) {
        //ACTIVE MENU HOVER
        $('#nav ul li.inactive').hover( function() {
            $('#nav ul li a.active').css("color","#000");
        }, function() {
            $('#nav ul li a.active').css("color","#fff");
        });
    } else {
        //IF NO ACTIVE BUTTON SHOW HOME AS ACTIVE
        $('#nav ul li a.HOME').css("color","#fff");
    }
});




