jQuery(document).ready(function(){

// smooth scrolling
	$("a.softscroll").click(function() {
		var elementClicked = $(this).attr("href");
		var destination = $(elementClicked).offset().top;
		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 500 );
		return false;
	});
             
	// Ticker
	$('#ticker').list_ticker({
		speed:5000,
		effect:'fade'
	}) 
	
	// bx Slider
	$('#slider').bxSlider({
		mode: 'horizontal', 
		infiniteLoop: true,   // true, false - display first slide after last
		speed: 1000,          // integer - in ms, duration of time slide transitions will occupy
		pause: 8000,          // integer - in ms, the duration between each slide transition
		auto: true            // true, false - make slideshow change automatically
	});

	// tooltips
	$('[rel="tooltip"], .tooltip').tipsy({
			live: true,
			gravity: 's'
		});	
	
	// fancybox
	$('a[href$=.jpg],a[href$=.png],a[href$=.gif]').fancybox({
		'titleShow' : true,
		'titlePosition' : 'over',
		'centerOnScroll' : true,
		'padding' :	5,
		'overlayColor' :'#F1F1ED'
	}); 
	
	$('a.iframe').fancybox({
		'titleShow' : false,
		'width' : 800,
		'height' : 600,
		'padding' :	5,
		'overlayColor' :'#F1F1ED'
	});
	
	// collapsible definition list
	$('#mapRoute').hide();
	$('#mapButton').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')}).click(function(){
  	$(this).next().slideToggle('normal');
	});
	
	// alternating rows in the date list
	$("ul.date li:even").addClass('even') 
	$("ul.date li:odd").addClass('odd')
	
	// open links with rel=external in a new window
	$('.external').click( function() {
		window.open(this.href);
		return false;
	});
	

});
