var intPeople = Math.floor(Math.random()*9);

function ymca(){
	$("#twitter").getTwitter({
					userName: "@waterburyymca",
					numTweets: 5,
					loaderText: "Loading tweets...",
					slideIn: true,
					slideDuration: 750,
					showHeading: true,
					headingText: "Latest Tweets",
					showProfileLink: true,
					showTimestamp: true
				});
    
	$("div.nav ul li").after("<li class='divider'></li>");
	$("div.nav ul li.divider:last").remove();
	$("div.nav ul li").hover(
		function () {$(this).addClass("active"); }, 
		function () { $(this).removeClass("active"); }
    );
	
	$("div.wrapper").prepend("<div class='bg-left'></div>");
	$("div.wrapper").prepend("<div class='bg-right'></div>");
	$("div.nav ul li:first").hover(
		function () {$(this).addClass("active-left"); }, 
		function () { $(this).removeClass("active-left"); }
    );
	$("div.nav ul li:last").hover(
		function () {$(this).addClass("active-right"); }, 
		function () { $(this).removeClass("active-right"); }
    );
	
	// set column heights
	var columnHeight = 	$("div.content").height();
	$("div.sub-nav").css({height:columnHeight});
	$("div.internal-column-1").css({height:columnHeight});
	
	// more - less buttons
 $("div.more-hidden").hide();
	$("a.more").addClass("show");
	$("a.show").click(function(){
		$(this).toggleClass("show");
		$(this).toggleClass("hide");
		$("a.show").text("More");
		$("a.hide").text("Less");
		$(this).siblings("div.more-hidden").slideToggle();
	});
	
	// donation form
	$("input#donation-1").click(function(){
		if ( $(this).attr("checked") == true ){
			$(this).siblings("div").slideDown();
		}
	});
	$("input#donation-2").click(function(){
		if ( $(this).attr("checked") == true ){
			$(this).siblings("div").slideDown();
		}
	});
	
	// new styling
	$("div.sub-nav").prepend("<div style='position:absolute; top:-165px; left:15px;'><a href='/'><img src='/images/logo-ymca-03.png' alt='' class='random-logo' /></a></div>");
	$("div.internal-column-1").prepend("<div style='position:absolute; top:-165px; left:15px;'><a href='/'><img src='/images/logo-ymca-05.png' alt='' /></a></div>");
	$("p.img-bg").prepend("<img src='/images/people-0"+(intPeople+1)+".jpg' />");
	
}

function innerfade(){
	$("div.slideshow").innerfade({ 
		animationtype: 'fade', 
		speed: 750, 
		timeout: 4000,
		type: 'sequence', 	
		containerheight: '390px'
	 }); 
	$("div.logos").innerfade({ 
		animationtype: 'fade', 
		speed: 750, 
		timeout: 4000,
		type: 'sequence', 	
		containerheight: '139px'
	 }); 
}

function innerfade_int(){
	$("div.slideshow_int").innerfade({ 
		animationtype: 'fade', 
		speed: 750, 
		timeout: 4000,
		type: 'random', 	
		containerheight: '188px'
	 }); 
}

