// This array contains the submenus that will be displayed when you roll over the main navigation items that contain submenu items.  Match up the array number with the number of the navigation item in the list, leaving blank array objects for those nav items that have no submenu.
var submenu = new Array();
submenu[0] = '';
submenu[1] = '';
submenu[2] = '\
	<ul>\
		<li><a href="/Services/Financial-Planning.php">Financial Planning</a></li>\
		<li><a href="/Services/Statement-Services.php">Statement Services</a></li>\
		<li><a href="/Services/Management-Consulting.php">Management Consulting</a></li>\
		<li><a href="/Services/Wealth-Planning.php">Wealth Planning</a></li>\
		<li><a href="/Services/Taxes.php">Tax Services</a></li>\
	</ul>\
';
submenu[3] = '\
	<ul>\
		<li><a href="/About-Us/">About the Company</a></li>\
		<li><a href="/About-Us/Principals.php">Meet Thad and Paul</a></li>\
		<li><a href="/About-Us/Staff.php">Our Staff</a></li>\
	</ul>\
';
submenu[4] = '\
	<ul>\
		<li><a href="/News/Announcements.php">Announcements</a></li>\
		<li><a href="/News/Articles.php">Articles</a></li>\
		<li><a href="/News/Press.php">Press Releases</a></li>\
	</ul>\
';


// This is the markup and content that will be displayed when someone toggles one of the options on the home page profile box.  Object 0 is the default content/markup. The rest should match up with the profile-type that's being called.
switchBoxText = new Array();
switchBoxText[0] = '\
	<p>Strong relationships are the key to strong financial results. Tell us a little about you, and learn more about the financial services that will benefit you most.</p>\
';
switchBoxText[1] = '\
	<p>The majority of clients Kee, Huchok &amp; Co. serves are business owners - just like you. Our comprehensive small business services include:</p>\
	<ul>\
		<li><a href="/Services/Statement-Services.php" class="switchLink">Statement Services</a></li>\
		<li><a href="/Services/Taxes.php" class="switchLink">Tax Services</a></li>\
		<li><a href="/Services/Management-Consulting.php" class="switchLink">Management Consulting</a></li>\
		<li><a href="/Services/Financial-Planning.php" class="switchLink">Financial Planning</a></li>\
		<li><a href="/Services/Wealth-Planning.php" class="switchLink">Wealth Planning</a></li>\
	</ul>\
';
switchBoxText[2] = '\
	<p>Kee, Huchok &amp; Co. regularly assists clients in the formation and start-up of new business ventures.</p>\
	<ul>\
		<li><a href="/Services/New-Business-Owners.php#entity_selection" class="switchLink">Entity Selection</a></li>\
		<li><a href="/Services/New-Business-Owners.php#business_plans" class="switchLink">Business Plans</a></li>\
		<li><a href="/Services/New-Business-Owners.php#cash_flow_analysis" class="switchLink">Cash Flow Analysis</a></li>\
		<li><a href="/Services/New-Business-Owners.php#computer-based_accounting" class="switchLink">Computer-Based Accounting</a></li>\
		<li><a href="/Services/New-Business-Owners.php#tax_planning" class="switchLink">Tax Planning</a></li>\
	</ul>\
';
switchBoxText[3] = '\
	<p>Many Kee, Huchok &amp; Co. clients own investment real estate. Our experience provides you with insight and advice invaluable to your real estate ventures.</p>\
	<ul>\
		<li><a href="/Services/Investment-Real-Estate.php#cash_flow_analysis" class="switchLink">Cash Flow Analysis</a></li>\
		<li><a href="/Services/Investment-Real-Estate.php#tax_planning" class="switchLink">Tax Planning</a></li>\
		<li><a href="/Services/Investment-Real-Estate.php#tax-free_exchanges" class="switchLink">Tax-Free Exchanges</a></li>\
		<li><a href="/Services/Investment-Real-Estate.php#cost_segregation_studies" class="switchLink">Cost Segregation Studies</a></li>\
		<li><a href="/Services/Investment-Real-Estate.php#computer-based_accounting" class="switchLink">Computer-Based Accounting</a></li>\
	</ul>\
';
switchBoxText[4] = '\
	<p>In today\'s market, the ownership of an investment portfolio is not without ups and downs. Let Kee, Huchok &amp; Co. assist you with investment analysis and planning.</p>\
	<ul>\
		<li><a href="/Services/Investment-Portfolio.php#investment_strategies" class="switchLink">Investment Strategies</a></li>\
		<li><a href="/Services/Investment-Portfolio.php#risk_assessment" class="switchLink">Risk Assessment</a></li>\
		<li><a href="/Services/Investment-Portfolio.php#tax_planning" class="switchLink">Tax Planning</a></li>\
		<li><a href="/Services/Investment-Portfolio.php#estate_planning" class="switchLink">Estate Planning</a></li>\
		<li><a href="/Services/Investment-Portfolio.php#personal_financial_plans" class="switchLink">Personal Financial Plans</a></li>\
	</ul>\
';
switchBoxText[5] = '\
	<p>Kee, Huchok &amp; Co. can help with all your financial needs, from business start-up to retirement planning. We serve our clients in all areas of their financial life.</p>\
	<ul>\
		<li><a href="/Services/General-Finances.php#retirement_planning" class="switchLink">Retirement Planning</a></li>\
		<li><a href="/Services/General-Finances.php#college_planning" class="switchLink">College Planning</a></li>\
		<li><a href="/Services/General-Finances.php#representation" class="switchLink">Representation before Taxing Authorities</a></li>\
		<li><a href="/Services/General-Finances.php#insurance_analysis" class="switchLink">Insurance Analysis</a></li>\
		<li><a href="/Services/General-Finances.php#tax_planning" class="switchLink">Tax Planning</a></li>\
	</ul>\
';


// This function opens the requested submenu and styles the top-level nav item.
function menu(foo) {
	menuReset();
	document.getElementById('submenu'+foo).style.display = 'block';
	document.getElementById('submenu'+foo).innerHTML = submenu[foo];
	document.getElementById('nav1_'+foo).style.background = '#E1E1E1';
	document.getElementById('nav1_'+foo).style.borderLeft = '1px solid #FFF';
	document.getElementById('nav1_'+foo).style.borderRight = '1px solid #FFF';
	document.getElementById('nav1_'+foo).style.width = '154px';
}

// This function resets all submenus and switches top-level nav item style back to normal.
function menuReset() {
	menus = document.getElementsByTagName('div');
	for (i=0 ; i<menus.length ; i++) {
		if (menus[i].className==='submenu') {
			menus[i].innerHTML = '';
			menus[i].style.display = 'none';
		}
	}
	nav1Links = document.getElementsByTagName('a');
	for (i=0 ; i<nav1Links.length ; i++) {
		if (nav1Links[i].className==='activeNav') {
			nav1Links[i].style.background = 'none';
			nav1Links[i].style.borderLeft = 'none';
			nav1Links[i].style.borderRight = 'none';
			nav1Links[i].style.width = '156px';
		}
	}
}


// This variable keeps track of which profile is being displayed on the home page.
var switchStatus = '0';

// This function opens the requested profile content and formats the corresponding link to make it "active," or falls back to the default content if a profile is clicked "off."
function switchBox(foo,bar,blah) {
	switchBoxReset()
	if (switchStatus === foo) {
		document.getElementById('switchContent').style.backgroundColor = '#FFF';
		document.getElementById('switchContent').style.backgroundImage = 'url(images/bg_switchbox_0.jpg)';
		document.getElementById('switchContent').style.color = '#013667';
		document.getElementById('switchContent').innerHTML = switchBoxText[0];
		switchStatus = '0';
	} else {
		document.getElementById('switchNav1_'+foo).childNodes[0].style.backgroundPosition = 'top right';
		document.getElementById('switchContent').style.backgroundColor = '#'+blah;
		document.getElementById('switchContent').style.backgroundImage = 'url(images/bg_switchbox_'+foo+'.jpg)';
		document.getElementById('switchContent').style.color = '#'+bar;
		document.getElementById('switchContent').innerHTML = switchBoxText[foo];
		switchLinks = document.getElementsByTagName('a');
		for (i=0 ; i<switchLinks.length ; i++) {
			if (switchLinks[i].className==='switchLink') switchLinks[i].style.color = '#'+bar;
		}
		switchStatus = foo;
	}
}

// This function resets the stylized profile links.
function switchBoxReset() {
	opts = document.getElementsByTagName('li');
	for (i=0 ; i<opts.length ; i++) {
		if (opts[i].className==='resetme') opts[i].childNodes[0].style.backgroundPosition = 'top left';
	}
}

// Form activation script
function activate(brillig) {
	document.getElementById('config').name = "config";
	document.getElementById('config').value = brillig;
}

function setup() {
	// This function makes external links open in new windows, unless noted otherwise (rel="self" in anchor)
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var URL = anchors[i].href;
		if ((URL.search('kh-cpas')===-1 && URL.search('http')!==-1 && anchors[i].rel !== 'self') || anchors[i].rel === 'external') anchors[i].target = "_blank";
	}
}
window.onload = setup; 