function newsRotator() {
	$('#recentNewsBlock li').css({'opacity':0.0});
	$('#recentNewsBlock li:first').css({'opacity':1.0, 'z-index':100});
	setTimeout('rotate()', 10000);
}

function rotate() {
	if ($('#recentNewsBlock li.show').length == 0) {
		var current = ($('#recentNewsBlock li:first'));
	} else {
		var current = ($('#recentNewsBlock li.show'));
	};
	
	if (current.next().length != 0) {
		var next = current.next();
	} else {
		var next = ($('#recentNewsBlock li:first'));
	};
	
	current.removeClass('show').animate({opacity: 0.0}, 1000, function() {
		$(this).css('z-index', 0);
	});
	next.addClass('show').animate({opacity: 1.0}, 1000, function() {
		$(this).css('z-index', 100);
		setTimeout('rotate()', 7000);
	});
	
}




$(function() {

		newsRotator();
		
    $('.ngg-gallery-thumbnail a').lightBox();
    
    $('.pano-thumb a').fancybox({
    'type': 'iframe',
    'height': 390,
    'width': 800
    });
    
    
    $('a.vimeoLink').fancybox({
    'type': 'iframe',
    'height': 390,
    'width': 800
    });
    
    $('.panoImage a').fancybox({
    'type': 'iframe',
    'height': 390,
    'width': 800
    });   
    
    $('.vimeo_gallery_item a').removeAttr('rel').fancybox({
    'type': 'iframe',
    'height': 390,
    'width': 800
    });
    

    
});
