$(document).ready( function() {
	$('.clist>ul>li>ul').hide();
	$('.clist>ul>li>a').click( function() {
		$(this).parent().siblings('li').children('a').removeClass('actif');
		if($(this).next('ul:not(:visible)').length > 0) {
			$('.clist>ul>li>ul:visible').hide();
			$(this).next('ul:not(:visible)').show();
			$(this).addClass('actif');
		}
		else {
			$(this).next('ul').hide();
			$(this).removeClass('actif');
		}
		return false;
	});
	$('#capability>h2>a').each( function() {
		if(!$(this).hasClass('actif')) {
			$(this).parent().next('div').hide();
		}
	})
	$('#capability>h2>a').click(function() {
		if($(this).hasClass('actif')) {
			$(this).removeClass('actif');
			$(this).parent().next('div').hide();
		}
		else {
			$(this).addClass('actif');
			$(this).parent().next('div').show();
		}
		return false;
	});
	$('.recherche>input[type=text]').defaultValue({ text: 'SEARCH'});

	$('#mapamerique>div').hide();
	$('#mapamerique>a').hover( function() {
		$(this).siblings('.' + $(this).attr('class')).show();

	},
	function() {
		$(this).siblings('.' + $(this).attr('class')).hide();
	});
	$('body').append('<div id="popdiv"></div>')
	$('#popdiv').hide();
	$('#popdiv').width($('body').width());
	$('#popdiv').height($('body').height());
	$('fieldset.popup>a').click(function() {
		var image = $('<img />');
		image.attr('src',$(this).attr('href'));
		$('#popdiv').html(image);
		$('#popdiv').show();
		return false;
	});
	$('#popdiv>img').live('click', function() {
		$('#popdiv').hide();
	})
	if($.browser.msie) {
		if($('.deuxcols').length > 0) {
			$('.deuxcols').css('width','80%');
			$('.deuxcols').columnize({columns: 2 });
		}
	}
	$('#staff>form').hide();
	$('#staff>a').click( function() {
		$('#staff>form').toggle();
		return false;
	});
});