/* 	$("#tabs").tabs();Cufon Font Replacement */

$(document).ready(function() {	

	//Get the height of the first item
	$('#mask').css({'height':$('#panel-1').height()});	
	
	//Calculate the total width - sum of all sub-panels width
	//Width is generated according to the width of #mask * total of sub-panels
	$('#panel').width(parseInt($('#mask').width() * $('#panel div').length));
	
	//Set the sub-panel width according to the #mask width (width of #mask and sub-panel must be same)
	$('#panel div').width($('#mask').width());
	
	//Get all the links with rel as panel
	$('a[rel=panel]').click(function () {
	
		//Get the height of the sub-panel
		var panelheight = $($(this).attr('href')).height();
		
		//Set class for the selected item
		$('a[rel=panel]').removeClass('selected');
		$(this).addClass('selected');
		
		//Resize the height
		$('#mask').animate({'height':panelheight},{queue:false, duration:500});			
		
		//Scroll to the correct panel, the panel id is grabbed from the href attribute of the anchor
		$('#mask').scrollTo($(this).attr('href'), 800);		
		
		//Discard the link default behavior
		return false;
	});
	
});
   
Cufon.replace('#box_Quicklinks a', {fontFamily: 'MyriadNormal',hover: true,hover: {strong: true, em: true, color:'#655B4F' }});
/*Cufon.replace('ul.main-nav a', {fontFamily: 'MyriadCond',hover: true,hover: {strong: true, em: true, color:'#FFCC33' }});*/
Cufon.replace('#box_Campus a', {fontFamily: 'MyriadNormal',hover: true,hover: {strong: true, em: true, color:'#83B0C0' }});
Cufon.replace('#innerSlide a', {fontFamily: 'MyriadNormal',hover: true,hover: {strong: true, em: true, color:'#A6C0CB' }});
Cufon.replace('ul.sub-nav a', {hover: true,hover: {strong: true, em: true, color:'#83B0C0' }});
Cufon.replace('span.tabLink2', {fontFamily: 'MyriadNormal',strong: true, em: true, color:'#333' });


Cufon.replace('.tabNav2,  #topNav,ul.sub-nav li span', { fontFamily: 'MyriadCond' });
Cufon.replace('#mainMenu, .ministryHeaderTitle, .ministryTitleBlock, #addressBar_,#innerSlide,#addressBar_Homepage_, .pageTitle, .crumbTrail, .midBox_, #watchButtons, #tabsHolder', { fontFamily: 'Myriad' });



$(document).ready(function(){
	$(function()
{
    $('.custom_button, .hover_menu').mouseenter(function()
    {
        $('.hover_menu').fadeIn('fast');
        $('.custom_button').addClass('active');
        $(this).data('in', true);
        $('.hover_menu').data('hidden', false);
    }).mouseleave(function()
    {
        $(this).data('in', false);
        setTimeout(hideMenu, delay);
    });

    var delay = 400;
    function hideMenu()
    {
        if (!$('.custom_button').data('in') && !$('.hover_menu').data('in') && !$('.hover_menu').data('hidden'))
        {
            $('.hover_menu').fadeOut('fast');
            $('.custom_button').removeClass('active');
            $('.hover_menu').data('hidden', true);
        }
    }
});
        function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "Go",             // Start text
		        stopText: "Stop",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            $("#slide-jump").click(function(){
                $('.anythingSlider').anythingSlider(6);
            });
            
        });



$("#slider").easySlider({
				auto: true, 
				continuous: true,
				numeric: false
			});

  $(".btn-slide").click(function(){
$("#slide-panel").toggle();


});
	$(document).pngFix();
	
	
						   
$(".tab_contentMain").hide(); //Hide all content
	$("ul.tabsMain li:first").addClass("active").show(); //Activate first tab
	$(".tab_contentMain:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabsMain li").click(function() {
		$("ul.tabsMain li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_contentMain").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).show(); //Fade in the active content
		return false;
	});

	

$("div.clickable").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
	});

		
	$('a.media').media({width:580, height:550});
	$('.media').media( 
		{params: {wmode: 'transparent'}}
	);
	//jMP3 init
	$("#sound").jmp3();
	$(".tdmAudio").jmp3({
		showfilename: "false",
		backcolor: "000000",
		forecolor: "00ff00",
		width: 350,
		showdownload: "true"
	});
	$(".pod").jmp3({
		showfilename: "false",
		backcolor: "000000",
		forecolor: "00ff00",
		width: 260,
		showdownload: "true"
	});
});

$(function(){  $("table.mainTable tr:even").addClass("oddrow");});






$(document).ready(function () {
	$("ul.menu_body li:even").addClass("alt");
    $('img.menu_head').click(function () {
	$('ul.menu_body').slideToggle('medium');
    });
	$('ul.menu_body li a').mouseover(function () {
	$(this).animate({ fontSize: "14px", paddingLeft: "20px" }, 50 );
    });
	$('ul.menu_body li a').mouseout(function () {
	$(this).animate({ fontSize: "12px", paddingLeft: "10px" }, 50 );
    });
});


	
$(document).ready(function(){
	
       $('#tweets').tweets({
           tweets:4,
           username: "fbcjax"
       });



	$('#hnav').autosprites({
		offset: '92px',
	orientation: 'horizontal',
	over: { opacity: 'show' },
	overSpeed: 500,
	out: { opacity: 'hide' },
	outSpeed: 500,
	activeState: false,
	activeClass: 'active',
	activeSprites: false


	});
	  $('#viewBox').hide();

 // toggles the slickbox on clicking the noted link
  $('a#showViewBox').click(function() {
 $('#viewBox').slideToggle(400);
 return false;
  });
	$('.images').galleria();
	// hides the slickbox as soon as the DOM is ready
 // (a little sooner than page load)

//toggles the slickbox on clicking the noted link


//$('.midBox').hide();
 //var id = $(this).attr('id');
      // $('#midBox' + id).hide();
 // $('a.midBoxSlider').click(function() {
     //  $('#midBox' + id).toggle(500);
        // alert(id);
    //   return false;
     //  });


});



