
/* -- Fade in thumbnail images -- */

$('div[class^="thumbnail"] ul li a').children('img').each(function() {
	// Hide the image
	$(this).hide().stop();
	
	// Create the image resource
	var $t  = $(this);
	var img = new Image();
	img.onload = function() {
		$t.fadeIn();
	}
	
	// Load the image
	img.src = $(this).attr('src');
});

/* -- Fancybox -- */

$('a.fancybox').fancybox({
	zoomSpeedIn    : 300,
	zoomSpeedOut   : 300,
	overlayColor   : '#000000',
	overlayOpacity : 0.5
});

$('a.open-in-window').each(function() {
	var u = $(this).attr('href').substring(jQueryBaseHref.length, $(this).attr('href').length);
	$(this).attr('href', jQueryBaseHref + '/text/window' + u);
}).fancybox();


/* -- Cycle in side banners; e.g. About us -- */

$('#two-columns-with-sidebar').find('#right-column').cycle({
	fx : 'fade',
	timeout: 3000,
	speedIn:  800, 
	speedOut: 300,
	nowrap : 0
});
