$(document).ready(function() {
	// quick links animation
	$('#quicklinks a').hover(function() {
		$(this).animate({ backgroundPosition: '0px -20px' }, 50);
		$(this).animate({ paddingLeft: '25px' }, 150);
	}, function() {
		$(this).animate({ paddingLeft: '18px' }, 150);
		$(this).animate({ backgroundPosition: '-7px 6px' }, 30);     
	});
	// menu animation
	// close on load
	$('#menu1').slideToggle("slow");
	// toggle function
	$('#menu-title').click(function() {
		$('#menu1').slideToggle("slow");
		if($('#menu-title div').hasClass("up")  ){
			$('#menu-title div').removeClass("up").addClass("down");
		}else if($('#menu-title div').hasClass("down") ){
			$('#menu-title div').removeClass("down").addClass("up");
		};
	});
	// pledge box fade animation
	$("#pledge-box a").hover(function() {
		$(this).animate({backgroundColor: "#00c730;" }, 300);
	}, function() {
		$(this).animate({backgroundColor: "#00c3e0" }, 300);
	});
	$('.zebra tr:nth-child(even)').addClass('alt');
});

$(function() {
	$('.lightbox a').lightBox(); // Select all links in object with gallery ID
});

function subscribe(){
	var email = $('#email_field').val();
	if(checkEmail(email)){
		//submitLoginForm('lf');
		document.subscribe_form.submit();
	}else{
		alert("Please ensure that your e-mail is properly formatted. (eg. me@example.com)");
		$('email').focus();
	}
}
function checkEmail(strEmail) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strEmail)){
		return (true);
	}
	return (false);
}	


