$(document).ready(function() {
  function filterPath(string) {
  return string
    .replace(/^\//,'')
    .replace(/(index|default).[a-zA-Z]{3,4}$/,'')
    .replace(/\/$/,'');
  }
  var locationPath = filterPath(location.pathname);
  $('a[href*=#]').each(function() {
    var thisPath = filterPath(this.pathname) || locationPath;
    if (  locationPath == thisPath
    && (location.hostname == this.hostname || !this.hostname)
    && this.hash.replace(/#/,'') ) {
      var $target = $(this.hash), target = this.hash;
      if (target) {
        var targetOffset = $target.offset().top;
        $(this).click(function(event) {
          event.preventDefault();
          $('html, body').animate({scrollTop: targetOffset}, 400, function() {
            location.hash = target;
          });
        });
      }
    }
  });
});

jQuery(document).ready(function($){
	$("a[rel='lightbox']").colorbox({maxWidth:"95%"/* , maxHeight:"95%" */});
});


jQuery(document).ready(function($){

// Google Reader notes
	$('ul.gReader-list li').removeClass('gReader-item');

	$('ul.gReader-list li').hover(function() {

		// Stuff that happens when you hover on + the stop()
		$('.gReader-notes', this).stop().animate({
			'opacity': 0.8
			}, 400)

	},function() {

		// Stuff that happens when you unhover + the stop()
		$('.gReader-notes', this).stop().animate({
			'opacity': 0
			}, 700)

	})

// Portfolio excerpt
	$('div.folio-img a').removeClass('noJS');

	$('div.folio-img a').hover(function() {

		// Stuff that happens when you hover on + the stop()
		$('div.portfolioHover', this).stop().animate({
			'opacity': 0.9
			}, 400)

	},function() {

		// Stuff that happens when you unhover + the stop()
		$('div.portfolioHover', this).stop().animate({
			'opacity': 0
			}, 700)

	})

});