// Updated: 12/22/2009
// initiate jQuery functions/actions

$(document).ready(function() {
	
	// slideshow plugin - seen on homepage
	$('#slideshow')
	.after('<div id="slideshow-nav">')
	.cycle({
		fx: 'fade',
		delay:  -1000,
		speed: 1200,
		timeout: 5000,
		pager: '#slideshow-nav'
  	});
	
	// pause button to pause slideshow
	$('#btn-pause').click(function () {
    	$('#slideshow').cycle('pause');
    	$('#btn-resume').css("background-position","0 0");
    	$(this).css("background-position","0 -14px");
		return false;
  	});
  	
	// resume button to resume a paused slideshow
	$('#btn-resume').click(function () {
    	$('#slideshow').cycle('resume');
    	$('#btn-pause').css("background-position","0 0");
    	$(this).css("background-position","0 -14px");
		return false;
  	});

	// use jQuery to add <p> element in case JS disabled
	// Animate the Thank You msg that appears after user submits contact form
	$("p.confirmation").append("<a class='close' href='#' title='Close this message'>Close</a>");
	$("a.close").click(function(event){
		event.preventDefault();
		$("p.confirmation").hide("slow");
	});

	// Zebra stripe data tables - tables that are wrapped in div.data
	$(".data tbody tr:odd").addClass('odd');

});