/**
 * @author studiomohawk
 */
$(document).ready(function() {
	$("div.simplepie ul li:odd").addClass("odd");
	$("div.recentEntry ul li:odd").addClass("odd");

	$('div.UBN').append('<img src="http://images.studiomohawk.com/ajax-loader.gif" class="load" />');
	$('div.UBN img.load').fadeOut('normal');
	$('div.blogNetwork').fadeIn('slow');
	$('div.blogNetwork').cycle({ 
			fx: 'scrollUp', 
			timeout: 5000,
			pause: 1
	});

	$('div.entry a img').hover(function() {
		$(this).css('opacity',0.7);
	}, function() {
		$(this).css('opacity', 1.0);
	});

	$('p.feedburnerFlareBlock').addClass('clearfix');
	$('p.feedburnerFlareBlock span').addClass('hide');
	$('p.feedburnerFlareBlock a').wrapInner('<span></span>');
	$('p.feedburnerFlareBlock a:odd').addClass('second');
	$('p.feedburnerFlareBlock a.first span').replaceWith('<img src="http://images.studiomohawk.com/Subscribefeed.png" />');
	$('p.feedburnerFlareBlock a.second span').replaceWith('<img src="http://images.studiomohawk.com/delicious.png" />');
	$('p.feedburnerFlareBlock a img').hover(
		function () {
			$(this).css('opacity', 0.70);
		},
		function () {
			$(this).css('opacity', 1.0);
		});
});

$(document).ready(function() {
	function filterPath(string) {
		return string
			replace(/^\//,'')
			replace(/(index|default).[a-zA-Z]{3,4}$/,'')
			replace(/\/$/,'');
		}
	$('a[href*=#]').each(function() {
		if ( filterPath(location.pathname) == filterPath(this.pathname)
		&& location.hostname == this.hostname
		&& this.hash.replace(/#/,'') ) {
			var $targetId = $(this.hash), $targetAnchor = $('[name=' + this.hash.slice(1) +']');
			var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;
			if ($target) {
				var targetOffset = $target.offset().top;
				$(this).click(function() {
				$('html, body').animate({scrollTop: targetOffset}, 600);
				return false;
				});
			}
		}
	});
});
