//All the code is Copyright 2011 Paul Evans, no copying, modifying, etc allowed

if (!window.console) console = {log: function() {}};
$(document).ready(function() { 
    $('a[rel~=external]').attr('target','_blank'); 
    $('a').live('click',function(){$(this).blur();});
});

$(document).ready(function() {
	$('#back_to_top').click(function(e) {
		$('html, body').animate({scrollTop:0}, 'slow');
		e.preventDefault();
	});
	
	$('.genwide, .project').each(function(index){
		if (href = $(this).find('a').attr('href')) {
                    var extlink = /\/\//;
                    if (extlink.test(href))
                        $(this).wrap('<a href="' + href + '" class="wraplink" rel="external" />');
                    else
                        $(this).wrap('<a href="' + href + '" class="wraplink" />');
                    $('a[rel~=external]').attr('target','_blank');
                }
	});	
});

