// Onload scripts specific to home pages ("true" and "transitional")
// Dependencies: 
//	jQuery 1.4+,
//	jQuery Cycle Plugin ("Lite" distribution will not work. Must use "full" or "regular")

// Implement acordian functionality for secondary navigation
$('#navSecondary > li:has(ul) > a').click(function(event) {
	event.preventDefault();
	var isToggle = $(this).parent().hasClass('expanded');
	$('#navSecondary > li.expanded ul').slideUp();
	$('#navSecondary > li.expanded').removeClass('expanded')
	if (! isToggle) {
		$(this).siblings('ul').slideDown();
		$(this).parent().addClass('expanded');
	}
	$(this).blur();
});

// Set input boxes to hide / show default text on focus / blur
$('body.homeTransitional #content input.text').each(function() {
	$(this).nhpInputDefaultText();
});

// Start banner rotation
if ($('#bannerRotationCollection div.bannerRotation').size() > 1) {
	$('#bannerRotationCollection').randomizeElementCollection('div.bannerRotation');
	$('#bannerRotationCollection').cycle({
		timeout: 6000,
		speed: 2000,
		pause: 1,
		pager: '#rotationIndicator'
	});
}
