$(document).ready(function() 
{
	// AUTOLOAD CODE BLOCK FOR SLIMBOX
	if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent) && jQuery().slimbox)
	{
		$("a[rel^='lightbox']").slimbox({initialWidth: 300, initialHeight: 300, resizeDuration: 200, captionAnimationDuration: 300, loop: true, imageFadeDuration: 300, overlayOpacity: 0.8, overlayFadeDuration: 200}, null, function (el) 
		{
			return (this === el) || ((this.rel.length > 8) && (this.rel === el.rel));
		});
	}

	// add '[Larger view'] to the title of lightbox images
	$('a[rel="lightbox[\'pageset\']"]').each(function (index, el)
	{
		var title = $(el).attr('title');
		$(el).attr('title', title + ' [Larger view]');
	});

	// zoomify '.zoomee' images
	//$('.zoomee').jqzoom({zoomWidth: 400, zoomHeight: 400, title: true,	position: 'right', xOffset: 15, yOffset: -140});
	
	// fade in on larger images
	$('.banner, #contentbody img:not(.instant)').css('opacity', 0).each(function(i, banner) 
	{
		$(banner).delay(200 * (i+1)).animate({opacity : 1}, 400);
	});
	
	// Modernizr tests for css font-face support otherwise we drop back to cufon replace and load the required js on demand
	if(Modernizr.fontface == false)
	{
		$.getScript("/assets/shared/js/third_party/cufon-yui.js", function(data)
		{
			$.getScript("/assets/site/js/third_party/aaargh_400.font.js", function()
			{
				Cufon.replace('ul#menu li a, ul.expand-options a, .product-title, ul.breadcrumb li', {fontFamily: 'Aaargh',hover: true});
			});
		});
	};	
});

// need to wait for images to load
$(window).load(function ()
{
	// set news columns to the greatest height
	//$('#column_id').greatestHeight();	
});

