$(document).ready(function(){
	/* 
	 * GLOBAL
	 */
    //�.block = rounded corner 
	DD_roundies.addRule('.block', '15px', true);
	DD_roundies.addRule('.formbutton', '5px', true);

    // contact block
    $('#header .contact').css({
        'cursor': 'pointer'
    }).click(function(){
    	if ($(this).find('.more a').length>0) {
    		window.location = $(this).find('.more a').attr('href');
    	}
    });
	DD_roundies.addRule('#header .contact .more', '0 0 15px 15px', true);


    /* submit buttons */
	DD_roundies.addRule('.button', '15px', true);
    
    // auto submit on select
    $('.activities-search select').change(function(){
    	$(this).parent().submit();
    });	

   	// alert
    $('.block.alert').delay(4000).slideUp();
    
    /* 
     * HOME 
     */
    if ($('body#home-page').length>0) {
	   	// rounded corners for mains 3 blocks
		DD_roundies.addRule('#content .column', '15px', true);
		DD_roundies.addRule('#content .more', '0 0 15px 15px', true);

    	// news (actus) click & effects
	    $('#content .column.first .blog.template').before('<ul id="blog-navigation" />').cycle({
	    	fx : 'scrollDown',
	    	pager:  '#blog-navigation',
	    	pause : 1,
	    	pauseOnPagerHover : 1, 
	    	timeout : 9000,
	    	pagerEvent: 'mouseover', 
	    	delay : 	4000
	    });    	
	    // activities top4 rollover
	    $('#content .column.middle .activities-top li').hover(function(){
	    	$(this).addClass('selected');
	    }, function(){
	    	$(this).removeClass('selected');
	    });	
	    
	    // displays page bits by bits
/*	    $('#body, #header .title, #content .column, #header .contact, #utils').hide();	    
	    $('#body').fadeIn('slow', function() {
		    $('#header .title').fadeIn('slow', function() {
		    	$('#content .column.first').fadeIn('slow', function() {
			    	$('#content .column.middle').fadeIn('slow', function() {
			    		$('#content .column.last .cycle .items').css('height', '80px');
				    	$('#content .column.last').fadeIn('slow', function() {
					    	$('#header .contact').fadeIn('slow', function() {
						    	$('#utils').fadeIn('slow');
						    });
					    });
				    });
			    });
		    });
	    });
*/
    }
    
    /*
     * ACTIVITIES
     */
    if ($('body#activites-page').length>0) {
		DD_roundies.addRule('.table .block', '10px', true);
    }
});
