/*! rabbitinabox.com v3 functionality */
function activateJS(){
	
	// set easing
	jQuery.easing.def = 'easeInOutExpo';
	
	// Show/Hide captions
	$('.boxgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'60px'},{queue:false,duration:550,easing:'easeOutQuad'});
	}, function() {
		$(".cover", this).stop().animate({top:'300px'},{queue:false,duration:600,easing:'easeInQuad'});
	});
	
	// Enable FancyBox
	$("a.video540").fancybox({
		'padding'			: 3,
		'autoScale'			: false,
		'width'				: 540,
		'height'			: 405,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'opacity'			: 'true',
		'titlePosition'		: 'inside'
	});
	
	$("a.video640").fancybox({
		'padding'			: 3,
		'autoScale'			: false,
		'width'				: 640,
		'height'			: 360,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'opacity'			: 'true',
		'titlePosition'		: 'inside'
	});
	
	$("a.shrek").fancybox({
		'padding'			: 3,
		'autoScale'			: false,
		'width'				: 818,
		'height'			: 686,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'opacity'			: 'true',
		'titlePosition'		: 'inside'
	});
	
	// Slide on navigate
	$("a.about").click(function (){
		$(".slider").stop().animate({top:'0'},{queue:false,duration:800});
	});
	
	$("a.work").click(function (){
		$(".slider").stop().animate({top:'-1000px'},{queue:false,duration:800});
	});
	
	$("a.contact").click(function (){
		$(".slider").stop().animate({top:'-2000px'},{queue:false,duration:800});
	});
	
};

/* External links for Strict HTML */
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
	}
};


$(document).ready(function(){
	activateJS();
	externalLinks();
});

