JQ(document).ready(function(){
	
	JQ("#window").hide();

	JQ("#window").slideToggle(1200);	
	
	JQ("#window")
	  .css({
		WebkitBorderBottomLeftRadius: 0, 
		WebkitBorderBottomRightRadius: 0, 
		MozBorderRadiusBottomleft: 0, 
		MozBorderRadiusBottomright: 0, 
		BorderRadius: 0 })
	  .animate({
		WebkitBorderBottomLeftRadius: 8, 
		WebkitBorderBottomRightRadius: 8, 
		MozBorderRadiusBottomleft: 8, 
		MozBorderRadiusBottomright: 8, 
		BorderRadius: 8}, 500);
		
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	//Vertical Sliding
	JQ('.boxgrid.u').hover(function(){
		JQ(".cover", this).stop().animate({top:'-147px'},{queue:false,duration:300});
	}, function() {
		JQ(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
	});
	JQ('.boxgrid.d').hover(function(){
		JQ(".cover", this).stop().animate({top:'147px'},{queue:false,duration:300});
	}, function() {
		JQ(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
	});
	
	//Horizontal Sliding
	JQ('.boxgrid.l').hover(function(){
		JQ(".cover", this).stop().animate({left:'-294px'},{queue:false,duration:300});
	}, function() {
		JQ(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
	});
	JQ('.boxgrid.r').hover(function(){
		JQ(".cover", this).stop().animate({left:'294px'},{queue:false,duration:300});
	}, function() {
		JQ(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
	});
	
	
	//Diagnal Sliding
	JQ('.boxgrid.ru').hover(function(){
		JQ(".cover", this).stop().animate({top:'-147px', left:'294px'},{queue:false,duration:300});
	}, function() {
		JQ(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
	});
	JQ('.boxgrid.rd').hover(function(){
		JQ(".cover", this).stop().animate({top:'147px', left:'294px'},{queue:false,duration:300});
	}, function() {
		JQ(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
	});

	JQ('.boxgrid.lu').hover(function(){
		JQ(".cover", this).stop().animate({top:'-147px', left:'-294px'},{queue:false,duration:300});
	}, function() {
		JQ(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
	});
	
	JQ('.boxgrid.ld').hover(function(){
		JQ(".cover", this).stop().animate({top:'147px', left:'-294px'},{queue:false,duration:300});
	}, function() {
		JQ(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
	});
	
	//Full Caption Sliding (Hidden to Visible)
	JQ('.boxgrid.c').hover(function(){
		JQ(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
	}, function() {
		JQ(".cover", this).stop().animate({top:'147px'},{queue:false,duration:160});
	});


});
