// LOADING OF FUNCTIONS
$(document).ready(function(){
	boxes();
	fade();
});

/* THE FOLLOWING IS FOR ANIMATING HOVER BOXES */

function boxes() {
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	//Vertical Sliding
	$('.boxgrid.slidedown').hover(function(){
		$(".cover", this).stop().animate({top:'-176px'},{queue:false,duration:550});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:550});
	});
	//Horizontal Sliding
	$('.boxgrid.slideright').hover(function(){
		$(".cover", this).stop().animate({left:'425px'},{queue:false,duration:550});
	}, function() {
		$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:550});
	});
	//Diagnal Sliding
	$('.boxgrid.thecombo').hover(function(){
		$(".cover", this).stop().animate({top:'260px', left:'325px'},{queue:false,duration:550});
	}, function() {
		$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:550});
	});
	//Partial Sliding (Only show some of background)
	$('.boxgrid.peek').hover(function(){
		$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
	});
	//Full Caption Sliding (Hidden to Visible)
	$('.boxgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:550});
	}, function() {
		$(".cover", this).stop().animate({top:'176px'},{queue:false,duration:550});
	});
	//Caption Sliding (Partially Hidden to Visible)
	$('.boxgrid.caption, .boxgrid2.caption, .boxgrid3.caption').hover(function(){
		$(".cover", this).stop().animate({top:'287px'},{queue:false,duration:550});
	}, function() {
		$(".cover", this).stop().animate({top:'454px'},{queue:false,duration:550});
	});
}

/* THE FOLLOWING OPENS LINKS IN NEW WINDOW WITHOUT USING _BLANK */

$(function() {
	$('a[rel*=external]').click( function() {
		window.open(this.href);
		return false;
	});
});
