$(document).ready(function () { 
 
    $('#main-menu li').hover(
        function () {
            //show its submenu
            $('ul', this).slideDown(100);
 
        }, 
        function () {
            //hide its submenu
            $('ul', this).slideUp(100);         
        }
    );
    
    $('input[name="username"], input[name="password"]').click(function() {
    	if ($(this).val() == 'e-mailadres' || $(this).val() == 'password') {
    		$('input[name="username"]').val('');
    		$('input[name="password"]').val('');
    	}
    });
    
    $('input[name="password"]').focus(function() {
    	if ($(this).val() == 'password') {
    		$(this).val('');
    	}
    });
    
	$('#team-logos img').mouseover(function(){
		this.src = this.src.replace('_32_grey', '_32');
	});
	
	$('#team-logos img').mouseout(function(){
		this.src = this.src.replace('_32', '_32_grey');
	});
	
	$('.carousel-div').click(function(){
		window.location = $(this).find('a').attr('href');
    	return false;
	});
	
	// carousel config:
	$('#carousel').fadeContent({
		'interval'   : 4000,
		'speed'      : 1500,
		'fader_item' : '.fader'
	});
	
	$('#mycarousel').jcarousel();
	
});

setInterval(function() {
	$.get('/lib/keepalive.php');
}, 60000);
