
// Enables preset text in textfields to be cleared.
$(document).ready(function() {
	$('.clearField').clearField();
});

// Nav first and last selectors, some hovers as well (love IE6...)
$(document).ready(function() {
	$('.nav li:first-child').addClass('first-child');
	$('.nav li:last-child').addClass('last-child');
	$('#nav-account li:last-child a').attr('id', 'nav-manuscript');
	$('#sidebar p.document').hover( function(){ $(this).addClass('hover'); }, function(){ $(this).removeClass('hover'); });
});

// Fires the bookshelf carousel.
$(function() {
	$(".bookshelf").jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		mouseWheel: true,
		visible: 4
	});
	$('form dd input').clearField();
});

// Footer social icon hover states
$(document).ready(function() {
	$('#footer-social dt a').hover(function() {
		$(this).parent().next().fadeIn(200);
	}, function() {
		$(this).parent().next().fadeOut(200);
	});
	$('#footer > li').hover(function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
});

// Footer supported organisations
$(document).ready(function() {
	$('#menu-supportedorgs a').click(function() {
		window.open(this.href);
        return false;
	});
});
