jQuery(document).ready(function(){
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	//Vertical Sliding
	jQuery('.boxgrid.slidedown').hover(function(){
		jQuery(".cover", this).stop().animate({top:'-244px'},{queue:false,duration:300});
	}, function() {
		jQuery(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
	});
	//Horizontal Sliding
	jQuery('.boxgrid.slideright').hover(function(){
		jQuery(".cover", this).stop().animate({left:'325px'},{queue:false,duration:300});
	}, function() {
		jQuery(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
	});
	//Diagnal Sliding
	jQuery('.boxgrid.thecombo').hover(function(){
		jQuery(".cover", this).stop().animate({top:'244px', left:'325px'},{queue:false,duration:300});
	}, function() {
		jQuery(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
	});
	//Partial Sliding (Only show some of background)
	jQuery('.boxgrid.peek').hover(function(){
		jQuery(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
	}, function() {
		jQuery(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
	});
	//Full Caption Sliding (Hidden to Visible)
	jQuery('.boxgrid.captionfull').hover(function(){
		jQuery(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
	}, function() {
		jQuery(".cover", this).stop().animate({top:'244px'},{queue:false,duration:160});
	});
	//Caption Sliding (Partially Hidden to Visible)
	jQuery('.boxgrid.caption').hover(function(){
		jQuery(".cover", this).stop().animate({top:'120px'},{queue:false,duration:160});
	}, function() {
		jQuery(".cover", this).stop().animate({top:'140px'},{queue:false,duration:160});
	});
	
	//Caption Sliding (Partially Hidden to Visible)
	jQuery('.boxgrid.slideright_caption').hover(function(){
		jQuery(".cover", this).stop().animate({top:'140px'},{queue:false,duration:160});
		jQuery(".image", this).stop().animate({top:'188px', left:'230px'},{queue:false,duration:300});
	}, function() {
		jQuery(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
		jQuery(".image", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});					
	});
	
	jQuery('.boxgrid.slideleft_caption').hover(function(){
		jQuery(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
		jQuery(".image", this).stop().animate({top:'0px', right:'0px'},{queue:false,duration:300});
	}, function() {
		jQuery(".cover", this).stop().animate({top:'204px'},{queue:false,duration:160});
		jQuery(".image", this).stop().animate({top:'244px', right:'325px'},{queue:false,duration:300});					
	});
	
	jQuery('.boxgrid.slidedown_caption').hover(function(){
		jQuery(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
		//jQuery(".image", this).stop().animate({top:'0px'},{queue:false,duration:300});
	}, function() {
		jQuery(".cover", this).stop().animate({top:'-50px'},{queue:false,duration:300});
		//jQuery(".image", this).stop().animate({top:'-244px'},{queue:false,duration:300});
	});
	
	imageInterval = window.setInterval("moveImage();", 6000);
	
	moveImage = function(){		
		jQuery('.nivoSlider').animate({		    
		    opacity: '0'
		  }, 3000, function() {
		    // Animation complete.
			  jQuery('.nivoSlider').animate({		    
				    opacity: '1'
				  }, 3000, function() {
				    // Animation complete.
				  });
		  });
	}
	
});
