// JavaScript Document

	//greenMenu script
	$(document).ready(function(){ 
        $("ul.sf-menu").superfish({
            pathClass:  'current' 
        }); 
    });
	
	// Disclosure Show/Hide script
	$(document).ready(function(){ 
	//close all the content divs on page load 
		$('.smallPrint').hide(); 
		// toggle slide 
		$('#slideToggle').click(function(){ 
			// by calling sibling, we can use same div for all demos 
			$(this).siblings('.smallPrint').slideToggle(); 
		}); 
	});
	
	//Ticker animation function
	function AnimateWalker(Walker, GoEnd){
		// Left Walk 1 by 1
		newLeft = parseInt(Walker.css("left")) - 1;
		//check for animation end, then reset
		if(newLeft < -2320) newLeft = 932;
		Walker.css("left", newLeft);
		return true;
	}

	$(function(){
		$("#ticker").animator(10, AnimateWalker);
	});
	
	// Font re-sizing functions
	$(document).ready(function(){
		// Reset Font Size
		var originalFontSize = $('html').css('font-size');
		$(".resetFont").click(function(){
			$('html').css('font-size', originalFontSize);
		});
		// Increase Font Size
		$(".increaseFont").click(function(){
			var currentFontSize = $('html').css('font-size');
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum*1.2;
			//Let's not let the font-size get too big
			if(newFontSize < 25){
				$('html').css('font-size', newFontSize);
			}
			return false;
		});
		// Decrease Font Size
		$(".decreaseFont").click(function(){
			var currentFontSize = $('html').css('font-size');
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum*0.8;
			//Let's not let the font-size get too small
			if(newFontSize > 8){
				$('html').css('font-size', newFontSize);
			}
			return false;
		});
	});
	
	//test slideshow
	//function slideSwitch() {
//		var $active = $('#slideshow IMG.active');
//	
//		if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
//	
//		var $next =  $active.next().length ? $active.next()
//			: $('#slideshow IMG:first');
//	
//		$active.addClass('last-active');
//	
//		$next.css({opacity: 0.0})
//			.addClass('active')
//			.animate({opacity: 1.0}, 2000, function() {
//				$active.removeClass('active last-active');
//			});
//	}
//	
//	$(function() {
//		setInterval( "slideSwitch()", 10000 );
//	});
	
	// FundSelectList function
	$(document).ready(function(){
		$(".opener-chooseFund").click(function(){
			$(".fundSublist").toggle();
		});
	});
	
	// show/Hide Switch
	$(document).ready(function() {
		$("#showCharts").click(function() {
			$("#compCharts").toggle();
			$("#compTables").toggle();
		});
		$("#hideCharts").click(function() {
			$("#compCharts").toggle();
			$("#compTables").toggle();
		});
	});
	
	// Table Alternate row coloring
	$(document).ready(function() {
		$('table.fundTable tbody tr:not([th]):odd').addClass('altRow')
		$('table.returnsTable tbody tr:not([th]):odd').addClass('altRow')
		$('table.displayTable tbody tr:not([th]):odd').addClass('altRow')
		$('table.LLTable tbody tr:not([th]):even').addClass('altRow')
   })
	
	// Function for IA Signup modal
	
	function signUpResponse() {
		var msg = "Thank you for your subscription.";
		$.prompt(msg);
			
	}
	
	
