// This function formerly resided within the cfa_index.tpl - 
$(function() {
	/****** Video Image Cycle with Selectable Menu ******/
	$('#cycle_videos').cycle({
        fx:     'scrollHorz',
        speed:  'slow',
        timeout: 8000,
        pager:  '#video_menu',
        easing:  'easeinout', //for the srollHorz effect
        next:   '#next', 
    	prev:   '#prev',
		cleartype: true, 
		cleartypeNoBg: false,
		pagerAnchorBuilder: function(idx, slide) {
            return '#video_menu li:eq(' + (idx) + ') a';
        }
    });
	/***** Fade in the Shuffle buttons on mouseover *****/
    $('#video_hover').hover(
    	function(){
    		$('#vid_left').show();
    		$('#vid_right').show();
    	},
    	function(){
    		$('#vid_left').fadeOut('fast');
    		$('#vid_right').fadeOut('fast');
    	}
    );
	/***** Video Dialog box *******/
	/* Requires the /js/custom_jquery/video_display.js to be included on page */
	$("#showVideo_cfa").show_video_popup(
		"showVideo", 
		"video_dialog", 
		625, 375,
		"588", "300", 
		"rtmp://cp72569.edgefcs.net/ondemand/",	"flashmedia/kaplan_demos/CFA/CFA_Institute_Presentation.flv", 
		"rtmp", "", 
		"home_video",
		"About the CFA<sup class='reg'>&reg;</sup> Program"
	);
	$("#showVideo_cfa2").show_video_popup(
		"showVideo", 
		"video_dialog", 
		505, 355,
		"475", "290", 
		"", "http://videos.schweser.com/CFA/2011_WhyCFA.flv", 
		"video", "", 
		"home_video",
		"Why Pursue the CFA<sup class='reg'>&reg;</sup> Designation?"
	);	
	
	$('#tabs').tabs();

	$('[id^="cfa_lvl"]').hover(
		 function()
		 {
			var buttonImg = $(this).attr("src");
			$(this).attr("src", buttonImg.replace("_off","_on"));
		 },
		 function()
		 {
			var buttonImg = $(this).attr("src");
			$(this).attr("src", buttonImg.replace("_on","_off"));
		 }
	);
});

