$(function () {
if ($.browser.msie && $.browser.version < 7) return;/*For IE6*/
$('img').hide();
});

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 8,
        wrap: 'last',
	scroll:1,
	animation:800,
        initCallback: mycarousel_initCallback
    });
});


$(function () {
	$.sifr({textTransform:'uppercase',textAlign: 'left'});
	$('h2.pagetitle').sifr({font:'Trade Gothic LT Std Bd Cn',height:40,offsetTop:1});
	$('#page-content h2').sifr({font:'Trade Gothic LT Std Bd Cn',height:40,offsetTop:1});
	$('#page-content h3').sifr({font:'Trade Gothic LT Std Bd Cn',color:'#000',height:20});		
	$('h3.group-show').sifr({font:'Trade Gothic LT Std Bd Cn',height:20});
	$('h4.post-title').sifr({font:'Trade Gothic LT Std Bd Ext',height:18,width:290});	
	$('h5.exhibit-date').sifr({font:'Trade Gothic LT Std Bd Ext',height:18});		
	$('h3.stitles').sifr({font:'Trade Gothic LT Std Bd Cn',height:18});		
	$('h2.artist').sifr({font:'Trade Gothic LT Std Bd Cn',height:18});
	$('h3.post-title').sifr({font:'Trade Gothic LT Std Bd Cn',height:18,width:580,color: '#808080'});	
	$('table td').sifr({font:'Trade Gothic LT Std Bd Cn',height:20,width:500});		
	$('table th').sifr({font:'Trade Gothic LT Std Bd Cn',height:20});
	$('h2.main-artist').sifr({font:'Trade Gothic LT Cn',height:30,color: '#3171b9'});
	$('h3.main-title').sifr({font:'Trade Gothic LT Cn',height:25,link: '#fff',color: '#fff'});
	$('h4.main-date').sifr({font:'Trade Gothic LT Cn',height:20,color: '#ffffff'});		
});

$(function () {
	if ($.browser.msie && $.browser.version < 8) return;
	$('#current-gallery li')
		.find('a')
		.append('<span class="hover" />').each(function () {
				var $span = $('> span.hover', this).css('opacity', 0);
				$(this).hover(function () {
					// on hover
					$span.stop().fadeTo(500, 1);
				}, function () {
					// off hover
					$span.stop().fadeTo(500, 0);
				});
			});
			
});

$(function () {
	if ($.browser.msie && $.browser.version < 7) return;//will not work on IE6
	$('.ngg-gallery-thumbnail')
		.find('a')
		.append('<span class="hover" />').each(function () {
				var $span = $('> span.hover', this).css('opacity', 0);
				$(this).hover(function () {
					// on hover
					$span.stop().fadeTo(500, 1);
				}, function () {
					// off hover
					$span.stop().fadeTo(500, 0);
				});
			});
			
});

var i = 0;
var int=0;//IE Fix
$(window).bind("load", function() {
	var int = setInterval("doThis(i)",500);
});

function doThis() {
	var imgs = $('img').length;
	if (i >= imgs) {
		clearInterval(int);
	}
	$('img:hidden').eq(0).fadeIn(500);
	i++;
}