//*-----CUFON REPLACEMENT FUNCTIONS-----*//

Cufon.replace('.updates_extend .floatleft p',{hover: true, fontFamily: 'TradeGothic Bold'});
Cufon.replace('.header_nav li.upperlevel a',{fontFamily: 'TradeGothic Bold Condensed'});
Cufon.replace('.header_nav ul.lowerlevel li a',{hover: true, fontFamily: 'TradeGothic Medium'});
Cufon.replace('.home_message h2, .bottom_message h2, .bottom_message h3',{hover: true, fontFamily: 'TradeGothic Bold'});
Cufon.replace('h5',{hover: true, fontFamily: 'TradeGothic Medium'});

Cufon.replace('#Content h4.title',{hover: true, fontFamily: 'TradeGothic Bold Condensed'});
Cufon.replace('#Secondary h1, #MainCol h3',{hover: true, fontFamily: 'TradeGothic Bold'});
Cufon.replace('#RightCol h3',{hover: true, fontFamily: 'TradeGothic Bold'});
Cufon.replace('#RightCol li',{hover: true, fontFamily: 'TradeGothic Medium'});

Cufon.replace('#Secondary h3',{hover: true, fontFamily: 'TradeGothic Medium'});
Cufon.replace('.chapter_block .chapter_name, .dropdown-chapter_name',{hover: true, fontFamily: 'TradeGothic Bold'});
Cufon.replace('p.bigtext',{hover: true, fontFamily: 'TradeGothic Bold'});
Cufon.replace('#chaptertabs li p',{hover: true, fontFamily: 'TradeGothic Bold'});
Cufon.replace('.percentage, .moneyraised',{hover: true, fontFamily: 'TradeGothic Bold'});

Cufon.replace('a.viewmorechapterslink ',{hover: true, fontFamily: 'TradeGothic Bold'});

//*-----JQUERY FUNCTIONS-----*//

$(function(){

$("#10662407045").validate();

$('.viewmorechapterslink').click(function(){
		$('.morechapters_box').slideToggle('fast');		
		$('.viewmorechapterslink').toggleClass('selected');
});
});

$(document).ready(function(){
						   
	//*-----SIGN-UP FUNCTION-----*//
	
	var signUp = null;
	
	$('.signup_tab').click(function(){
			$('.updates_extend').slideToggle('fast');
		if(signUp == null){
			signUp = $('#Frame').animate({ top: 0 }, 'fast');
		}else{
			$('#Frame').animate({ top: 0 }, 'fast');
			signUp = null;
		}	
	});
	$('.updates_hide').click(function(){
			$('.updates_extend').slideToggle('fast');
	});
	
	//*-----CYCLE PLUGIN-----*//
	
	$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) {
    	$(pager).find('li').removeClass('activeLI').filter('li:eq('+currSlideIndex+')').addClass('activeLI');
	}
	
	$('#HomeSlideshow').cycle({ 
		fx: 'fade',
		speed: 1000,
		timeout: 6000,
		pager: '#SliderNav',
		pagerAnchorBuilder: function(){ return '<li><span class="empty"></span></li>'; }
	});
	
	$('#FeaturedSlideshow').cycle({ 
		fx: 'fade',
	    speed: 1000,
		timeout: 8000,
		pager: '#FeaturedSliderNav',
		pagerAnchorBuilder: function() { return '<li><span class="empty"></span></li>'; }
	});

	$('#NewsSlideshow').cycle({ 
		fx: 'fade',
	    speed: 1000,
		timeout: 8000,
		pager: '#NewsSliderNav',
		pagerAnchorBuilder: function() { return '<li><span class="empty"></span></li>'; }
	});
	
	$('.chaptersslideshow').cycle({ 
		fx: 'fade',
	    speed: 1000,
		timeout: 8000,
		next: $('.next'),
		prev: $('.prev')
	});
	
});


$(document).ready(function() {

	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul#chaptertabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	$("ul#chaptertabs li").addClass("box");
	
	//On Click Event
	$("ul#chaptertabs li").click(function() {

		$("ul#chaptertabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
	
});



function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

$(document).ready(function() {
	equalHeight($("#TopFullCol .equalheight"));
	equalHeight($(".fullcolwrapper div"));
	//$("#chaptertabs li:nth-child(3) a").css({"border-right" : "solid 2px #FFF"});
});






