$(function() {
			
				$.fn.showHtml = function(html, speed)  {
				  return this.each(function() {
			
					 var el = $(this);
			
					 // Preserve the original values of width and height - they'll need 
					 // to be modified during the animation, but can be restored once
					 // the animation has completed.
					 var finish = {width: this.style.width, height: this.style.height};
					
					 // The original width and height represented as pixel values.
					 // These will only be the same as `finish` if this element had its
					 // dimensions specified explicitly and in pixels. Of course, if that 
					 // was done then this entire routine is pointless, as the dimensions 
					 // won't change when the content is changed.
					 var cur = {width: el.width()+'px', height: el.height()+'px'};
					 
					 el.children('span').fadeOut(200, function(){
	
						 // Modify the element's contents. Element will resize.
						 el.html(html);
						 el.children('span').css('visibility','hidden');
				
						 // Capture the final dimensions of the element 
						 // (with initial style settings still in effect)
						 var next = {width: el.width()+'px', height: el.height()+'px'};
						 
						  el.css(cur) // restore initial dimensions
							.animate(next, speed, function() { el.css(finish); 
								el.children('span').hide().css('visibility','visible').fadeIn(200); 
							});
						 });
				  });
			   };

				$('#slideshow').cycle({
					fx:     'fade',
					speed:  'slow',
					timeout: 4000,
					pager:  '#slideshow_nav',
					pagerAnchorBuilder: function(idx, slide) {
					// return sel string for existing anchor
					return '#slideshow_nav li:eq(' + (idx) + ') a';
					},
					after: function() {
						var slide = $('.slide').index(this);						
//						if (slide == 0) { $('a.caption').showHtml('<span>&gt; Lorem ipsum dolor sit sed do eiusmod</span>', 200); }
//						else if (slide == 1) { $('a.caption').showHtml('<span>>&gt; Lorem sed do eiusmod</span>', 200); }
//						else if (slide == 2) { $('a.caption').showHtml('<span>&gt; Lorem ipsum dolor sit do eiusmod sed do eiusmod</span>', 200); }
//						else { $('a.caption').showHtml('<span>&gt; Lorem ipsum dolor sit sed do eiusmod dolor sit sed do te</span>', 200); }
					}
				});
				$('#direct').click(function() {
					$('#slideshow_nav li:eq(2) a').triggerHandler('click');
					return false;
				});
				
				
			});
