$(document).ready(function() {

    $('.hide').hide();

    $('#overview-table tbody tr').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });
        
    });

    $('#overview-table tbody tr').click(function() {
        window.location.href = $(this).children('td:eq(1)').children('a').attr('href');
    });

    $('.apart').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });

    });

    $('.apart').click(function() {
        window.location.href = '/admin/categorie/add';
    });

    $('#overview-table tfoot tr').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });

    });

    $('#overview-table tfoot tr').click(function() {
        window.location.href = '/admin/categorie/add';
    });


    $('#overview-table-ad tbody tr').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });

    });

    $('#overview-table-ad tbody tr').click(function() {
        window.location.href = $(this).children('td:eq(1)').children('a').attr('href');
    });

    $('.apart2').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });

    });

    $('.apart2').click(function() {
        window.location.href = '/admin/ads/add';
    });

    $('#overview-table-ad tfoot tr').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });

    });

    $('#overview-table-ad tfoot tr').click(function() {
        window.location.href = '/admin/ads/add';
    });

    $('#overview-table-link tbody tr').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });

    });

    $('#overview-table-link tbody tr').click(function() {
        window.location.href = $(this).children('td:eq(1)').children('a').attr('href');
    });

    $('.apart3').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });

    });

    $('.apart3').click(function() {
        window.location.href = '/admin/links/add';
    });

    $('#overview-table-link tfoot tr').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });

    });

    $('#overview-table-link tfoot tr').click(function() {
        window.location.href = '/admin/links/add';
    });

    $('#overview-table-setting tbody tr').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });

    });

    $('#overview-table-setting tbody tr').click(function() {
        window.location.href = $(this).children('td:eq(1)').children('a').attr('href');
    });

    $('#overview-table-setting tfoot tr').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFCC33'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFFFCC'} , { duration: 400, queue: false} );
        });

    });

    $('#overview-table-setting tfoot tr').click(function() {
        window.location.href = '/admin/links/add';
    });

    $('.create-button').each(function() {

       var link = $(this).children('a:eq(0)').attr('href');
       var text = $(this).children('a:eq(0)').text();

       $(this).html('<input type="button" onclick="location.href=\'' + link + '\'" value="' + text + '" class="submit" />');

    });

    $('#navcontainer ul li a').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFB03F'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FF9601'} , { duration: 400, queue: false} );
        });
    });

    $('#navcontainer ul li ul li a').mouseover(function() {

        $(this).animate( { backgroundColor: '#FFFFFF'} , { duration: 400, queue: false} );
        $(this).css('cursor', 'pointer');

        $(this).mouseout(function() {
           $(this).animate( { backgroundColor: '#FFB954'} , { duration: 400, queue: false} );
        });
    });

    $('#cat_keuze_hoofd').click(function() {
       $('#keuze_veld').slideUp('slow');
    });

    $('#cat_keuze_sub').click(function() {
       $('#keuze_veld').slideDown('slow');
    });

    $('.submitUpload').click(function () {
        $('#upload_form').slideUp('normal');
        $('#upload_busy').slideDown('normal');
    });

});
