var textSpeed = 2000;
var textDuration = 6000;

var fadeStrings = [
	"Providing Investment Solutions for Over 25 Years",	
	"Celebrating our new office - now open in Greenville, South Carolina",	
	"Create &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Preserve &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Grow"
];

 
/*
var fadeStrings = [
	"&quot;Investment management is the management of risks,<br/> not the management of returns.&quot;  Benjamin Graham",
	"Trust, Ethics, Roadmap, Team-Approach, <br/>Fee-Based Asset Management, Transparency, Risk Management"
];
*/
var fadeStringi = 0;

$(function() {
	$(".jstabs a").click(tabLinks);
	if( $('#fadetext')) AnimateText();
});

function AnimateText() {
	var textelement = $("<div/>").html(fadeStrings[(fadeStringi++)%fadeStrings.length]).css({
		fontFamily:"Garamond",
		fontSize: "20px",
		opacity:0, 
		color:"white",
		background:"#4F7739",
		padding:"12px 0px"
	});
	$('#fadetext').append(textelement);
	
	textelement.animate({
		opacity:1.0
	}, textSpeed, "swing", setTimeout(function() {
		textelement.animate({
			opacity:0,
			fontSize:"1px"
		},textSpeed,"swing",function() {
			textelement.remove();
			setTimeout(AnimateText,2000);
		});
	},textDuration));
}

function tabLinks() {
	//get the element mentioned in the id and show it
	var element = $($(this).attr("href")).show();
	
	//hide all of its siblings
	element.siblings().hide();
	
	//stop the event
	//element.preventDefault();
	return false;
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=825,height=575');");
}

function popUpWin(URL,WIDTH,HEIGHT) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+ WIDTH+",height="+ HEIGHT +"');");
}
