$().ready(function(){

	// animations

	// forms

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

	// email

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

	// 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;

	// gallery

	$('#gallery').cycle({
		fx: 'fade',
		speed:  500,
		timeout: 5000,
		pager: '#slides',
		next: '#next',
		prev: '#prev',
		containerResize: 0
	});

	// navigation

	$('#gallery-nav li.hover a, #page-nav li.hover a').hover(
		function () {
			$(this).animate({
				color: '#68228b' }, 500
			)
		},
		function () {
			$(this).animate({
				color: '#000' }, 500
			)
		}
	);

});
