Shadowbox.init({
	players: ["img", "qt", "swf", "iframe"],
	onOpen: function(cb) {
		//gtrack('/gallery/'+cb.gallery+'/'+cb.title);
	}
});

$(document).ready(function(){

	$(".thumb").hover(function(){
		$(".desc:first", this).slideDown("fast");
	}, function(){
		$(".desc:first", this).slideUp("fast");
	});

	$(".desc").click(function(){
		$("a:first", $(this).parent()).click();
	});

  $('a[rel="external"]').click(function(e){
		gtrack("/linkto/"+$(this).attr('href'));
		window.open($(this).attr('href'));
		return false;
  });

  $('a[rel="email"]').click( function(e){
		gtrack('/email');
  });

	$(".thumbs p.links a").hover(function() {
		$(this).parents(".project").find(".thumb_desc").eq($(this).parent().children().index(this)).slideDown("fast");
	}, function() {
		$(this).parents(".project").find(".thumb_desc").eq($(this).parent().children().index(this)).slideUp("fast");
	});
	
	function gtrack(string) {
		try {
			pageTracker._trackPageview(string);
		} catch (err) { 
			console.log("trackPageView: "+string);
		}
	}

});
