$(document).ready(function() {

	// Add the correct quotes for IE6
	$("q, blockquote").prepend("“").append("”");
	$("q q, blockquote q").prepend("‘").append("’");

	// Add classes to inputs for IE6
	$("input[type='text'], input[type=’password’]").addClass("text");
	$("input[type=’button’], input[type=’submit’], input[type=’checkbox’], input[type=’image’], input[type=’radio’], input[type=’reset’], button").addClass("nontext");
	$("input[type=’button’], input[type=’submit’], input[type=’reset’], button").addClass("button");
	
	// Map Pop-up
	$('.map').click( function () {
		$('#map').fadeIn(500); $('#overlay').fadeIn(500);
	});
	
	$('#overlay').click( function() {
		$('#map').fadeOut(500); $('#overlay').fadeOut(500);
	});
	
	
	$('#thumbs img').hide();
	$('.news li:last').css("border-bottom", "0");
	$('#map .close').click(function() {
		$(this).parent().hide();
		return false;
	});
	
	
	// Feature Slideshow
	var gallery = $('#feature').galleriffic('#thumbs', {
		delay:                  10000, // in milliseconds
		numThumbs:              20, // The number of thumbnails to show page
		preloadAhead:           0, // Set to -1 to preload all images
		enableTopPager:         false,
		enableBottomPager:      false,
		imageContainerSel:      '#slideshow', // The CSS selector for the element within which the main slideshow image should be rendered
		controlsContainerSel:   '#controls', // The CSS selector for the element within which the slideshow controls should be rendered
		captionContainerSel:    '#caption', // The CSS selector for the element within which the captions should be rendered
		loadingContainerSel:    '', // The CSS selector for the element within which should be shown when an image is loading
		renderSSControls:       true, // Specifies whether the slideshow's Play and Pause links should be rendered
		renderNavControls:      false, // Specifies whether the slideshow's Next and Previous links should be rendered
		playLinkText:           'Play',
		pauseLinkText:          'Pause',
		prevLinkText:           'Previous',
		nextLinkText:           'Next',
		nextPageLinkText:       'Next &rsaquo;',
		prevPageLinkText:       '&lsaquo; Prev',
		enableHistory:          false, // Specifies whether the url's hash and the browser's history cache should update when the current slideshow image changes 
		autoStart:              true, // Specifies whether the slideshow should be playing or paused when the page first loads 
		onChange:               undefined,
		onTransitionOut:        function(callback) {
															// $('#caption').fadeTo(501, 0.0);
															$('#slideshow').fadeTo(501, 0.0, callback);
														},
		onTransitionIn:         function() {
															$('#slideshow').fadeTo(501, 1.0);
															// $('#caption').fadeTo(501, 0.8);
														},
		onPageTransitionOut:    undefined,
		onPageTransitionIn:     undefined
    });
	
});