// JavaScript Document
jQuery(document).ready(function($){
	
	/* uses device agent to filter out mobile broswers from
	 * desktop browsers. will not catch a mobile browser with a 
	 * desktop user agent.  
	 */
	var deviceAgent = navigator.userAgent.toLowerCase();
	var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/);
	if (!agentID) {
		
   function startSlideshow() {
		$('#slideshow').remove();  // after window is resized, container is removed because of a fixed width in slideshow params
		$('#slideshow-container').append('<div id="slideshow"> <img src="inc/img/slideshow/financial-stress.jpg" /> <img src="inc/img/slideshow/preparing-taxes.jpg" /><img src="inc/img/slideshow/business-meeting.jpg"  /><img src="inc/img/slideshow/bills.jpg"  /></div>');
		var w = $('#slideshow').width();  // get the width of the slideshow which is set in css
		
		$('#slideshow').jqFancyTransitions({ 
			effect: '', // wave, zipper, curtain
			width: w, // width of panel
			height: 300, // height of panel
			strips: 20, // number of strips
			delay: 5000, // delay between images in ms
			stripDelay: 50, // delay beetwen strips in ms
			titleOpacity: 0.7, // opacity of title
			titleSpeed: 1000, // speed of title appereance in ms
			position: 'alternate', // top, bottom, alternate, curtain
			direction: 'random', // left, right, alternate, random, fountain, fountainAlternate
			navigation: false, // prev and next navigation buttons
			links: false // show images as links
		});
	}
	
	
	startSlideshow(); // starts after the document is ready
	$(window).afterresize(startSlideshow);  // starts after the window is resized
 
	}
});
