$(document).ready(function() {
	
	// navigation
	$(function(){
		$('.nav>.bdyWidth>ul.cf>li').bind('hover',function(){
			$(this).children('ul.children').slideDown('slow');}
			)
			.bind('hoverend',function(){
		$(this).children('ul.children').slideUp();}
		);
	});
	
	// fonts
	Cufon.replace('.nav>.bdyWidth>ul.cf>li>a', { 
		fontFamily: 'Cuprum', 
		hover:true, 
		textShadow: '1px 1px 1px #000'
	});

	Cufon.replace('#sidebar .widget h2, .theComments h2', { 
		fontFamily: 'Forque', 
		textShadow: '1px 1px 1px #f46f20'
	});
	
	// make the damn google calendar sidebar widge title link to the page
	$('#gce_widget-4 h2').wrapInner('<a href="http://545velo.com/races-events" />');
	
	// roster info
	$('p.more').toggle(function() {
		$(this).html('- Less');
		$(this).parent('td').parent('tr.basPro').next('tr.morPro').slideDown();
			},
			function(){
		$(this).html('+ More');
		$(this).parent('td').parent('tr.basPro').next('tr.morPro').slideUp();
	});
	// sponsors
	$('.sponsors .post:odd').css({'float':'right'});

	// tweets
	$('#twitter_update_list').cycle({
			fx: 'scrollUp' ,
			timeout: 5000,		
			cleartypeNoBg: true		
		});	
	
	//member resources
	$('.resources li>a').toggle(function() {
		$(this).addClass('close');
		$(this).next('.hidden').slideDown();
			},
			function(){
		$(this).removeClass('close');
		$(this).next('.hidden').slideUp();
	});

	// tab widget
	$("ul.tabs li").click(function() {
		$("ul.tabs 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
		Cufon.refresh();
		return false;
	});

});
