$(document).ready(function(){
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	//Full Caption Sliding (Hidden to Visible)
	$('.boxgrid-1.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'303px'},{queue:false,duration:200});
	}, function() {
		$(".cover", this).stop().animate({top:'423px'},{queue:false,duration:160});
	});
	$('#slideshow').hover(function(){
    clearInterval(playSS);
	}, function() {
		playSS = setInterval( "slideSwitch()", 5000 );
	});
	//Horizontal Sliding
	$('.boxgrid-2.slideright').hover(function(){
		$(".cover", this).fadeTo(500, 0);
		$(".boxgrid-2").fadeTo(500, 0.8);
	}, function() {
		$(".cover", this).fadeTo(50, 1);
		$(".boxgrid-2").fadeTo(50, 1);
	});
	//Horizontal Sliding
	$('.boxgrid-3.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:200});
	}, function() {
		$(".cover", this).stop().animate({top:'-140px'},{queue:false,duration:160});
	});
	
	var playSS = setInterval( "slideSwitch()", 5000 );
});

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

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

	var $next =  $active.next().length ? $active.next()
			: $('#slideshow img:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
			.addClass('active')
			.animate({opacity: 1.0}, 1000, function() {
					$active.removeClass('active last-active');
			});
}
	
/*$(".cover", this).stop().animate({left:'-258px'},{queue:false,duration:300});*/
/*$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});*/
	
/*		
	//Vertical Sliding
	$('.boxgrid.slidedown').hover(function(){
		$(".cover", this).stop().animate({top:'-423px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
	});
	//Horizontal Sliding
	$('.boxgrid.slideright').hover(function(){
		$(".cover", this).stop().animate({left:'499px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
	});
	//Diagonal Sliding
	$('.boxgrid.thecombo').hover(function(){
		$(".cover", this).stop().animate({top:'423px', left:'499px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
	});
	//Partial Sliding (Only show some of background)
	$('.boxgrid.peek').hover(function(){
		$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
	});

	//Caption Sliding (Partially Hidden to Visible)
	$('.boxgrid.caption').hover(function(){
		$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'220px'},{queue:false,duration:160});
	}); */

