(function(){

$(document).ready(function(){

	$('#team .member a').click(function(){
		var id = $(this).parents('.member')[0].id.replace('member-', 'details-');
		if ($('#' + id + ':visible').length)
		{
			$('#' + id).slideUp(400);
		}
		else
		{
			$('#team .details').filter(':not(#' + id + ')').slideUp(300);
			$('#' + id).slideDown(500);
		}
		return false;
	});

	if ($('#gallery').length)
	{
		var n = 1;
		$('#gallery div.section ul').each(function(){
			this.id ='ul-' + n;
			n++;
		});
		$('#gallery ul a').each(function(){
			var p = $(this).parents('ul');
			var t = p.find('li.description').html();
			$(this).attr({title: t});
		})
		for (var i = 1; i < n; i++)
		{
			$('#gallery #ul-' + i + ' a').lightBox({
				overlayOpacity: 0.5,
				containerResizeSpeed: 300
			});
		}

}

if ($('#tgallery').length) {
    var n = 1;
    $('#tgallery div.section ul').each(function() {
        this.id = 'ul-' + n;
        n++;
    });
    $('#tgallery ul a').each(function() {
        var p = $(this).parents('ul');
        var t = p.find('li.description').html();
        $(this).attr({ title: t });
    })
    for (var i = 1; i < n; i++) {
        $('#tgallery #ul-' + i + ' a').lightBox({
            overlayOpacity: 0.5,
            containerResizeSpeed: 300
        });
    }

}


	if ($.browser.msie) {
		try {
			document.execCommand("BackgroundImageCache", false, true);
		} catch(err){};
		if (typeof(DD_belatedPNG) != 'undefined')
		{
			DD_belatedPNG.fix('#news, #news li, .photos1 li, #butAcces a, #butUrgence a, #gallery h3, #gallery ul li, img.png');
		}
	}

});

})();