/*  ================================
     Sitewide JavaScript
    ================================ */

	// Detected and set from HTML
	var isIE6;
	isIE6 = false;

	function sitewidePageLoaded()
	{
		// All pages on load
		
	}

/*  ================================
     Template 1 JavaScript
    ================================ */

	function template1Loaded()
	{
		// Per template on load
		sitewidePageLoaded();
	}
	
	function init(){
		$("#topnav > li").mouseenter(function () {navOn(this);});
		$("#topnav > li").mouseleave(function () {navOff(this);});
	}
	
	$(document).ready(function(){
			var temp = $(".leftColumn > h1").html();
			if (temp){
				if (temp.length > 15){$(".leftColumn > h1").css("font-size", "40px")}	
			}
			init();
	});
	
	function switchCategory(cat){
		$(".net-worth").css("display", "none");
		$(".cash-flow").css("display", "none");
		$(".asset-allocation").css("display", "none");
		$(".investment").css("display", "none");
		$(".security").css("display", "none");
		$(".alternative").css("display", "none");
		
		$(cat).css("display","block");
	}
	
	function navOn(temp) {	
		//safe function to show an element with a specified id
		var x=temp.getElementsByTagName('ul');
		if(x[0]){x[0].style.display = 'block';}
		
		var y=temp.getElementsByTagName('a');
		y[0].style.backgroundColor = '#373B6A';
		y[0].style.color = '#FFF';
	}
	
	//displays the first ul in the container when called in rollover script init()
	function navOff(temp) {
		//safe function to hide an element with a specified id
		var x=temp.getElementsByTagName('ul');
		if(x[0]){x[0].style.display = 'none';}
		
		var y=temp.getElementsByTagName('a');
		y[0].style.backgroundColor = "";
		y[0].style.color = '#373B6A';
	}
