$(document).ready(function() {
	$('.nav-link').hover(
		function() {
			if(!$(this).attr('class').match(/nav-on/)) {
				$(this).toggleClass('nav-over');
			}
		},
		function() {
			if(!$(this).attr('class').match(/nav-on/)) {
				$(this).toggleClass('nav-over');
			}
		}
	);
	var lmts = ['aradia', 'elizabeth', 'hazel'];
	var bio_height = []
	for (i = 0; i < lmts.length; i++) {
		setUpBios(lmts[i]);
	}

});

function setUpBios( lmt ) {
		var bio_height;
		if($('#' + lmt + '-sidebar').length != 0) {
			$('#' + lmt + '-sidebar-placeholder')
				.height($('#' + lmt + '-sidebar').outerHeight())
				.width($('#' + lmt + '-sidebar').outerWidth())
				.css({
					'margin-right':$('#' + lmt + '-sidebar').css('marginRight'),
					'float':'left'
				});
			bio_height = $('#' + lmt + '-bio').height();
			$('#' + lmt + '-bio').height($('#' + lmt + '-sidebar').outerHeight());
			$('#' + lmt + '-bio').css('overflow','hidden');
			$('#' + lmt + '-more').click(function() {
				$('#' + lmt + '-bio').width(493);
				$('#' + lmt + '-bio').animate({
					height: bio_height
				}, function() {
					$(this).css('overflow','visible');
				});
				$('#' + lmt + '-more').hide();
				$('#' + lmt + '-less').show();
				return false;
			});
			$('#' + lmt + '-less').click(function() {
				$('#' + lmt + '-bio').css('overflow','hidden').animate({
					height: $('#' + lmt + '-sidebar').outerHeight()
				}, function() {
					$('#' + lmt + '-more').show();
					$('#' + lmt + '-less').hide();
				});
				return false;
			});
		}	
}
