$(document).ready(function() {
	jQuery(function()
	{
		// Build navigation
		$("ul.sf-menu").superfish({ 
            pathClass:  'current' 
        }); 

		// Photo slideshow control
		$("a[rel='example1']").colorbox();
		$("a[rel='example2']").colorbox({
			transition:	"fade",
			current:	"",
			onLoad:		function(){$("object").css("visibility","hidden")},	//hide Flash content (YouTube)
			onClosed:	function(){$("object").css("visibility","visible")}	//show Flash content on close
		});
		$("a[rel='example3']").colorbox({transition:"none", width:"75%", height:"75%"});
		$("a[rel='example4']").colorbox({slideshow:true});
		$(".example5").colorbox();
		$(".example6").colorbox({iframe:true, innerWidth:425, innerHeight:344});
		$(".example7").colorbox({width:"80%", height:"80%", iframe:true});
		$(".example8").colorbox({width:"50%", inline:true, href:"#inline_example1"});
		$(".example9").colorbox({
			onOpen:function(){ alert('onOpen: colorbox is about to open'); },
			onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
			onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
			onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
			onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
		});

		// Homepage image fader
		/*$('ID or class of the element containing the fading objects').innerfade({ 
				animationtype: Type of animation 'fade' or 'slide' (Default: 'fade'), 
				speed: Fadingspeed in milliseconds or keywords (slow, normal or fast)(Default: 'normal'), 
				timeout: Time between the fades in milliseconds (Default: '2000'), 
				type: Type of slideshow: 'sequence', 'random' or 'random_start' (Default: 'sequence'), 
				containerheight: Height of the containing element in any css-height-value (Default: 'auto')  
				runningclass: CSS-Class which the container get’s applied (Default: 'innerfade') });*/

		$('#center_image_list').innerfade({ 
				animationtype: 'fade', 
				speed: 'normal', 
				timeout: '3000', 
				type: 'random_start', 
				containerheight: 'auto',  
				runningclass: 'innerfade'
		});
		// Fix for...wait for it...IE
		$('#center_image_list').css('display', 'block');
	});

	$('#read_full_article').toggle(
		function(){
			$('#read_full_article').html('Hide the full article &gt;');
			$('#full_article').show('fast');
	 },
		function(){
			$('#read_full_article').html('Read the full article &gt;');
			$('#full_article').hide('fast');
	 });
 });
