function setUpCarousel()
{
	if ($('#virtual_gallery').get(0)) {
		stepcarousel.setup({
			galleryid: 'virtual_gallery', //id of carousel DIV
			beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
			panelclass: 'panel', //class of panel DIVs each holding content
			autostep: {enable:true, moveby:1, pause:6500},
			panelbehavior: {speed:1500, wraparound:false, persist:false},
			defaultbuttons: {enable: true, moveby: 1, leftnav: ['/media/blank.gif', -15, 104], rightnav: ['/media/blank.gif', 15, 104]},
			statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
			contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
		});
	}
	
	if ($.browser.msie && $.browser.version < '7.0') {
		$('img.left-nav-button').hover(	function() {
				$(this).addClass('left-nav-button-hover');
			},	function() {
				$(this).removeClass('left-nav-button-hover');
			});
		$('img.right-nav-button').hover(	function() {
				$(this).addClass('right-nav-button-hover');
			},	function() {
				$(this).removeClass('right-nav-button-hover');
			});
	}
}

/*
 * For the Our Team page (#514)
 */
function setUpTeam()
{
	//This next line isn't necessary since we've created some CSS rules
	//$('.bios').not('#intro').hide();	//For development
	
	$('li.employee a').click(function() {
		var thisEmployee = '#' + $(this).attr('id') + '-bio';
		$('.bios .bio').not(thisEmployee).hide();
		$(thisEmployee).fadeIn(800);
		$('hr.bio-divider').fadeTo(800,1);
		return false;
	});
}

function setUpFilter()
{
	$('.staff-groups .filter').click(function() {
		var thisGroup = '.' + $(this).attr('id');
		$('.staff-list li').removeClass('highlighted');
		$('.staff-list li' + thisGroup).addClass('highlighted');
		$('.staff-list li').not(thisGroup).fadeTo(800,0.25);
		$('.staff-list li' + thisGroup).fadeTo(800, 1.0);
		return false;
	});
}

function setUpEmployeeHover()
{
	$('.employee').hover(function() {
		$('.employee').clearQueue();
		$('.employee').not(this).delay(150).fadeTo(350,0.25);
		$(this).delay(150).fadeTo(350,1);
	},function() {
		$('.employee.highlighted').delay(150).fadeTo(500,1);
	});
}


function setUpActiveFilter() {
/*	Highlight was sticking on in Chrome despite class being removed; Disabling feature.	*/
/* 	$('.filter').click(function() {
		$('.filter').removeClass('active-filter');
		$(this).addClass('active-filter');
	}); */
};

function init()
{
	$('#searchform-query').click(function() {
		this.select();
	});
	$('#email_form-address').click(function() {
		this.select();
	});
	
	setUpCarousel();
	setUpTeam();
	setUpFilter();
	setUpActiveFilter();
	setUpEmployeeHover();
}
$(document).ready(init);

