$(document).ready(function() {
/*
	$('.gallery a').bind('mouseover', function(){
	    $(this).parent('li').css({position:'relative'});
	    var img = $(this).children('img');
	    $('<a class="highslide" href="'+$(this).attr('href')+'" onclick="return hs.expand(this)"><div /></a>').text(' ').css({
	        'height': img.height(),
	        'width': img.width(),
	        'background-color': '#ffffff',
	        'position': 'absolute',
	        'top': 0,
	        'left': 0,
	        'opacity': 0.0
	    }).bind('mouseout', function(){
	        $(this).fadeOut('fast', function(){
	            $(this).remove();
	        });
	    }).insertAfter(this).animate({
	        'opacity': 0.5
	    }, 'fast');
	});
*/
	Cufon.replace('h1 ,h2, h3', { fontFamily: 'HelveticaNeueLTPro' });
	Cufon.replace('#menu a', { fontFamily: 'HelveticaNeueLTPro', hover: true });


	$(window).scroll(function() {
	    //$("#headerContainer").css("top", $(window).scrollTop() + "px");
	    //$("#leftContainer").css("top", $(window).scrollTop() + "px");
	    $("#headerContainer").animate({ top:$(window).scrollTop()+"px" }, { queue: false, duration: 200 });
	    $("#leftContainer").animate({ top:$(window).scrollTop()+"px" }, { queue: false, duration: 200 });
	});
	
	if ($('.galleryslide').length) {
		hs.graphicsDir = '/global/js/galleryslide/graphics/';
		hs.align = 'center';
		hs.transitions = ['expand', 'crossfade'];
		hs.fadeInOut = true;
		hs.dimmingOpacity = 0.8;
		hs.wrapperClassName = 'borderless floating-caption';
		hs.captionEval = 'this.thumb.alt';
		hs.marginRight = 100; // make room for the thumbstrip
		hs.marginBottom = 80 // make room for the controls and the floating caption
		hs.numberPosition = 'caption';
		hs.lang.number = '%1/%2';
		
		// Add the slideshow providing the controlbar and the thumbstrip
		hs.addSlideshow({
			//slideshowGroup: 'group1',
			interval: 5000,
			repeat: false,
			useControls: true,
			overlayOptions: {
				className: 'text-controls',
				position: 'bottom center',
				relativeTo: 'viewport',
				offsetX: 50,
				offsetY: -5
			},
		
			thumbstrip: {
				position: 'middle right',
				mode: 'vertical',
				relativeTo: 'viewport'
			}
		});
	
		// Add the simple close button
		hs.registerOverlay({
			html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
			position: 'top right',
			fade: 2 // fading the semi-transparent overlay looks bad in IE
		});
	};
});

