function init() {
	
	$('#content img').each(function(index, el){
		var img_src = el.src;
		$(el).load(function () {
			$(this).animate({ opacity: 1 }, 'normal')
		}).attr('src', img_src).css('opacity', 0);
	});
	
	var span = $('<span class="period">&deg;</span>').get(0);
	//$('ul.tabs').tabs('#content > div').history();
	$('p, p *').each(function (index,element) {
	    $.each(element.childNodes, function (index,node) {
	        if (node.nodeType == 3) {
	            $.each(node.nodeValue.split('.'), function (index,fragment) {
	                if ( index > 0 ) {
	                    element.insertBefore(span.cloneNode(true),node);
	                }
	                element.insertBefore(document.createTextNode(fragment),node);
	            });
	            element.removeChild(node);
	        }
	    });
	});

	$('body a:not(.popupwindow)').filter(function() {
			var theHref = this;
			if (theHref.hostname && theHref.hostname !== location.hostname) {
				$(theHref).not(".noAutoIcon").addClass("offSite");
				$(theHref).not(".noAutoLink").attr('target','_blank').bind('click keypress', function(event) {
					var code=event.charCode || event.keyCode;
	                if (!code || (code && code == 13)) {
						if(pageTracker){
							var fixedLink = this.href;
							fixedLink = fixedLink.replace(/https?:\/\/(.*)/,"$1");
							fixedLink = '/outgoing/' + fixedLink;
							pageTracker._trackPageview(fixedLink);
	                    };
	                };
	            });
	        };
	    });
	
}
$(document).ready(init);
