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

//LEDENCIRCULAIRE
    //THE ODD EVEN SEPERATOR
    $('.ledencirculaire tr:even').css("background", "#EEE");

    //THE HOVER
    $('.ledencirculaire tr:even').hover(function(){
        $(this).css("background", "#0060af").css("color", "#FFF");
    }, function(){
        $(this).css("background", "#EEE").css("color", "#000");
    });

    $('.ledencirculaire tr:odd').hover(function(){
        $(this).css("background", "#0060af").css("color", "#FFF");
    }, function(){
        $(this).css("background", "#FFF").css("color", "#000");
    });

    //THE LINK
    $('.ledencirculaire tr').click(function(){
        window.location = $(this).attr('title');
    });
//LEDENCIRCULAIRE

    //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);
        });
    }

    //ONFOCUS INPUTFIELD
    $('#formFade input[type="text"], #formFade input[type="password"], #seachResultBox form input[type="text"], #ledenModule form input[type="text"]').each(function(){
        $(this).attr('value', $(this).attr('title'));
        $(this).focus(function(){
            if ($(this).attr('value') != '' && $(this).attr('value') == $(this).attr('title')) {
                $(this).attr('value', '');
            }
        });
        $(this).blur(function(){
            if ($(this).attr('value') == '') {
                $(this).attr('value', $(this).attr('title'));
            }
        });
    });

    //CUFON
    Cufon.replace('h1')('h2');
    Cufon.replace('#subnav a', { 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()
                }, 1000);
        }
    }, 500);

    //CYCLE SEARCH ARCHIVE
    $('#contentResult').cycle({
        fx: "scrollVert",
        timeout: 0,
        startingSlide:   0,
        pager:  '.contentPager',
        pagerAnchorBuilder: function(idx, slide) {
            return '<a href="#"> &bull; </a>';
        },
        before: function(slide,next){
                $("#contentResult").animate({
                'height' :  $(next).height()
                }, 1000);
        }
    }, 500);

    $('#newsResult').cycle({
        fx: "scrollVert",
        timeout: 0,
        startingSlide:   0,
        pager:  '.newsPager',
        pagerAnchorBuilder: function(idx, slide) {
            return '<a href="#"> &bull; </a>';
        },
        before: function(slide,next){
                $("#newsResult").animate({
                'height' :  $(next).height()
                }, 1000);
        }
    }, 500);

    $('#vacaturesResult').cycle({
        fx: "scrollVert",
        timeout: 0,
        startingSlide:   0,
        pager:  '.vacaturesPager',
        pagerAnchorBuilder: function(idx, slide) {
            return '<a href="#"> &bull; </a>';
        },
        before: function(slide,next){
                $("#vacaturesResult").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'
        });

    //SEARCH
	$('.cycle').cycle({
		fx: "scrollVert",
		timeout: 0,
		startingSlide:   0,
		pager:  '.pager',
		pagerAnchorBuilder: function(idx, slide) {
			return '<a href="#"> &bull; </a>';
		}
	}, 500);
		
    $('#ledenSearch').quicksearch('table.leden');
	
	
    //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);
    });
    $('#nav ul li ul').hide();
    $('#nav ul li ul li a').css({ 'z-index': '9999'});

});



