$(function() {
	function initialClose()
	{
		if (window.location.hash != '')
		{
			var hash = window.location.hash.replace('#', '');
			if (this.id == hash)
			{
				return;
			}
		}
		$(this).parent('li').addClass('close').attr('title', 'Expand to view more details');
	}
	// Add the onclick toggle event and then close them all to start with
	$('.faqs li h3').each(function() {
		$(this).toggle(featOpen, featClose);
	});
	$('.faqs li h3').addClass('fakelink').each(initialClose);
	$('p.toTop').remove();
	setJsClass();
});

function featClose()
{
	$(this).parent('li').addClass('close').attr('title', 'Expand to view more details');
	window.location.hash = this.id;
}

function featOpen()
{
	$(this).parent('li').removeAttr('class').attr('title', 'Collapse to hide details');
	window.location.hash = this.id;
}

function setJsClass()
{
	if (document.body.className != '')
	{
		document.body.className += ' js';
	}
	else
	{
		document.body.className = 'js';
	}
}