$(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, .outils-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 .box', '15px', true);
		DD_roundies.addRule('#content .box .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');
	    });	
	    
    }
    
    /*
     * ACTIVITIES
     */
    if ($('.table').length>0) {
		  DD_roundies.addRule('.table .block', '10px', true);
    }
});
