Shadowbox.init();

$(document).ready(function() {

	// I'm on the outside
	hostname = window.location.hostname
	$("a[href^=http]")
		.not("a[href*='" + hostname + "']")
		.addClass('link external')
		.attr('target', '_blank');
	
  // IE handholding
  $('.item:nth-child(4n+4)').addClass('last');

	$('.tiny-picture a').each(function() {
	  bgImg = $(this).attr('href').replace('.jpg', '-thumb.jpg');
	  $(this).css({
	    background: "url("+bgImg+") center center no-repeat" });
	});
	$('.tiny-picture a').click(function() {
	  bgImg = $(this).attr('href');
	  $('.tiny-picture').removeClass('current');
	  $(this).parent().addClass('current');
	  $('.big-picture').append('<div class="picture">&nbsp;</div>')
	  
	  $('.picture:last-child').fadeIn().css({
	    background: "url("+bgImg+") center center no-repeat" });
	  return false;
	});
	$('.tiny-picture:first-child a').trigger('click');
	
});