$().ready(function() {
   if (!($.browser.msie && $.browser.version < 7)) $('#home .gallery .content .info .title span, #home .gallery .content .info .title .wysiwyg, #home .gallery .content .info ul li a').corner({ tl: { radius: 2 }, tr: { radius: 2 }, bl: { radius: 2 }, br: { radius: 2 } });

   $('#home .boxes ul li h6').corner({ tl: { radius: 2 }, tr: { radius: 2 }, bl: { radius: 0 }, br: { radius: 0 } });
	$('#home .boxes ul li .info').corner({ tl: { radius: 2 }, tr: { radius: 2 }, bl: { radius: 2 }, br: { radius: 2 } });

	$(window).resize(function() {
		var $parent;

		$parent = $('#home .boxes ul li');
		$parent.find('h6').equal('height');
		$parent.find('.info').equal('height', true);
		$parent.find('.info .wysiwyg').equal('height');
		$parent.find('.info').equal('height');
	});
	$(window).trigger('resize');
	
	
	$('#home .dates .menu a').click(function() {
		var $buttons = $(this).closest('.menu').find('a');
		var index = $buttons.index(this);

		$buttons.removeClass('active');
		$(this).addClass('active');
		$(this).closest('.dates').find('.content > ul').hide().eq(index).show();
	});
	
	$('#home .gallery .menu ul li a').attr('href', 'javascript:void(0)').attr('target', '_self').hover(
		function() {
			$(this).closest('.menu').removeClass().addClass('menu button' + ($(this).closest('ul').find('a').index(this) + 1));
		},
		function() {
			$(this).closest('.menu').removeClass().addClass('menu button' + ($(this).closest('ul').find('a').index($(this).closest('ul').find('a.active')) + 1));
		}
	).click(function() {
		var $buttons = $(this).closest('ul').find('a');
		var index = $buttons.index(this);

		$(this).closest('.menu').removeClass().addClass('menu button' + (index + 1));
		$(this).closest('.gallery').find('> .content').hide().eq(index).show();
		$buttons.removeClass('active').eq(index).addClass('active');
	});
});
