// JavaScript Document

function ShowHideFAQ(selected,total)
{
	var i;
	var selectedStatus = document.getElementById('A'+selected).style.display;

	for (i=1;i<=total;i++)
	{
		document.getElementById('A'+i).style.display = 'none';
		document.getElementById('Q'+i+'_Bullet').src = "/assets/elements/plus.gif";
	}
	
	if (selectedStatus == 'block')
	{
		document.getElementById('A'+selected).style.display = 'none';
		document.getElementById('Q'+selected+'_Bullet').src = "/assets/elements/plus.gif";
	}
	else
	{
		document.getElementById('A'+selected).style.display = 'block';
		document.getElementById('Q'+selected+'_Bullet').src = "/assets/elements/minus.gif";
	}

}

function ShowHideFAQ_original(e) {
	var answerBlock = document.getElementById('A'+e);
	var bulletImg = document.getElementById('Q'+e+'_Bullet');

	if (answerBlock.style.display == 'block') {
		answerBlock.style.display = 'none';
		bulletImg.src = "/assets/elements/plus.gif";
	}
	else {
		answerBlock.style.display = 'block';
		bulletImg.src = "/assets/elements/minus.gif";
	}
}

function CheckURL() {
	// Give selected status to the correct navigation bar tab
	var str = document.URL;
	if (str.match("/assetprotection") != null) {
		document.getElementById('nav_assetprotection').className='selected';
	}
	if (str.match("/casehistories") != null) {
		document.getElementById('nav_casehistories').className='selected';
	}
	if (str.match("/testimonials") != null) {
		document.getElementById('nav_testimonials').className='selected';
	}
	if (str.match("/publications") != null) {
		document.getElementById('nav_publications').className='selected';
	}
	if (str.match("/blog") != null) {
		document.getElementById('nav_blog').className='selected';
	}
	if (str.match("/podcasts") != null) {
		document.getElementById('nav_podcasts').className='selected';
	}
	if (str.match("/seminars") != null) {
		document.getElementById('nav_seminars').className='selected';
	}
	if (str.match("/company") != null) {
		document.getElementById('nav_company').className='selected';
	}
	if (str.match("/contact") != null) {
		document.getElementById('nav_contact').className='selected';
	}

	// Load the page with the correct section displayed open
	if (document.location.pathname === "/assetprotection/why-asset-protection.html")
	{
		switch(document.location.hash)
		{
			case "#Lawsuit":
				ShowHideFAQ('1','6');
				break;
			case "#Business":
		    	ShowHideFAQ('2','6');
				break;
			case "#Accident":
		    	ShowHideFAQ('3','6');
				break;
			case "#Divorce":
			    ShowHideFAQ('4','6');
				break;
			case "#Investigation":
			    ShowHideFAQ('5','6');
				break;
			case "#Debt":
		    	ShowHideFAQ('6','6');
				break;
			default:
			    break;
		}
	}
}

