// boccard javascript file © contreforme sàrl 2007-2012
function footer_behaviour(){
	// if footer exists
    if($('footer')){
    	// get togglers and stretchers
        var togglers = $ES('li[class="location"]','footer');
        var stretchers = $ES('li[class="adress"]','footer');
        // declare accordion
        var footerAcc = new Accordion(togglers,stretchers,{
        	opacity:true,
            onActive:function(tog,stretch){
            	tog.addClass('active');
            },
            onBackground:function(tog,stretch){
            	tog.removeClass('active');
            }
        });
    }
}

function links_behaviour(){
	// each link
	$each($$('a'),function(el){
    	// if rel is external add the target=_blank attribute
    	if(el.getAttribute('rel') == 'external'){
        	el.setAttribute('target','_blank');
        }
    });
}

window.addEvent('domready', function(){
    footer_behaviour();
    links_behaviour();
});

