// JavaScript Document


function slideSwitch() {
    var $active = $('#slideshow .active');

    if ( $active.length == 0 ) $active = $('#slideshow .slidein:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow .slidein:first');
   
   $active.addClass('last-active');
	$active.removeClass('active');


		$('.last-active .captiontop').animate({left: -360}, 500, function() {
																	   
				$('.last-active .captionbottom').animate({bottom: -50}, 500, function() {
																			 
																	   
						$next.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 500, function() {
							
								$('.active .captiontop').animate({left: 0}, 500, function() {
																	   
										$('.active .captionbottom').animate({bottom: 0}, 500, function() {
							
																			   
												$active.removeClass('last-active');	
							   
										});														   
								});
        				});
				});														   
		});
	

  
}



$(document).ready(function(){
		
  

	
	$('#slideshow div:first').addClass('active').css({opacity: 1});
	$('.active .captiontop').css({left: 0});
	$('.active .captionbottom').css({bottom: 0});
	
	setInterval( "slideSwitch()", 4000 );		   
						   
						   
	$('.homebin').hover( function () {
		 		$('.homeblue', this).stop().css({display:'block'}, {queue:false,duration:200});
      },
      function () {
      		  $('.homeblue', this).stop().css({display:'none'}, {queue:false,duration:200});
      
			  });
   });

