$(document).ready(function()
        {
        $('#slideshow-home-intro').cycle({
		  //width: '860px',
		  height: '375px',
		  fit: true,
          fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, scrollHorz, scrollVert etc... delay: 500
          //speed: 'slow',
		  speedIn:  1300,
		  speedOut: 1400,
		  easing: 'easeInOutExpo',
          pause: 0,
         // timeout: 1000,
         // delay: 500,
		  after:   onAfter,
		  pager:'#navigation',
          prev: '#slider_prev',
          next: '#slider_next',
		  timeoutFn: calculateTimeout,
		  startingSlide: 0,		  
		  pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#navigation li:eq(' + (idx) + ') a';
          }
		  });
        });
		
		// sets correct timing for each slide
		function calculateTimeout(currElement, nextElement, opts, isForward) { 
			var index = opts.currSlide; 
			//alert(index);
			if (index == 0) {
				return -2000;
			}
			else if (index == 1) {
				return 2000;
			}
			else if (index == 2) {
				return -2300;
			}
			else if (index == 3) {
				return -2300;
			}
			else if (index == 4) {
				return -2300;
			}
			else if (index == 10) {
				return 6000;
			}
			/* else if (index == 5) {
				return 30;
			} */
			else return 2500;
		}
		
		function onAfter(curr, next, opts){
			var index = opts.currSlide;
			if (index == 11) {
				window.location = 'pages/intro.html';
			}
		}
