/**
 * jQuery plugins load and settings.
 */
$(function() {
	// Open or close tree
	$('.jTreeOpenClose').click(function() {
		$(this).parent().next().each(function() {
			if ($(this).attr('class') == 'inactive') {
				$(this).removeClass('inactive');
				$(this).prev().find('img').each(function() {
					var newAlt = $(this).attr('src');
					$(this).attr('src', $(this).attr('alt')).attr('alt', newAlt);
				});
			}
			else {
				$(this).attr('class', 'inactive');
				$(this).prev().find('img').each(function() {
					var newAlt = $(this).attr('src');
					$(this).attr('src', $(this).attr('alt')).attr('alt', newAlt);
				});
			}
		});
	});
	
	$('#intro-dialog').dialog({modal: true, width: 'auto', height: 'auto'});
	
	$('a.jPhotoFull').fancybox({imageScale: false, centerOnScroll: false});
	$('a.jPhotoScaled').fancybox();
});
