google.setOnLoadCallback(function() {

	// Place init code here instead of $(document).ready()

	// animations

	// forms

	$(function(){ 
	// find all the input elements with title attributes
		$('input[title!=], textarea[title!=]').hint();
	});

	$('#searchsubmit').hover(
		function () {
			$('#s').addClass('hover');
		}, 
		function () {
			$('#s').removeClass('hover');
		}
	);

	$('#work .post:last, #articles .post:last, #webtoday .post:last, #library .post:last').addClass('last');

	// email

	$(function(){
		$('a.email').nospam({
			replaceText: true
		});
	});

	$(function(){
		$('a.email-more').nospam();
	});

	// open new window

	function externalLinks() {
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName('a');
		for (var i=0; i<anchors.length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute('href') &&
				anchor.getAttribute('rel') == 'external')
				anchor.target = '_blank';
		}
	}

	window.onload = externalLinks;

});