$(function() {
	$('.rtOpen').each(function() {
		var $s = false;
		var $c = $(this).parents('p').prev();
		var $h = $c.height();
		$(this).bind('click', function() {
			var $t = $(this);
			if($s == false) {
				if($c.height() > 0) {
					$c.css({ height: '0px' });
				}
				$c.animate({ height: $h+'px' }, { queue: false, duration: 500,
					complete: function() {
						$(this).css({ display: 'block' });
						$t.html('x Close');
					}
				});
				$s = true;
			} else {
				$c.animate({ height: '0px' }, { queue: false, duration: 500, 
					complete: function() {
						$(this).css({ display: 'none' });
						$t.html('&rarr; Read More');
					}
				});
				$s = false;
			}
			return false;
		});
	});
	$('.accordion h2').each(function() {
		var $s = false;
		var $c = $(this).next();
		var $h = $c.height();
		$(this).bind('click', function() {
			var $t = $(this);
			if($s == false) {
				if($c.height() > 0) {
					$c.css({ height: '0px' });
				}
				$t.addClass('current');
				$c.animate({ height: $h+'px' }, { queue: false, duration: 500,
					complete: function() {
						$(this).css({ display: 'block' });
					}
				});
				$s = true;
			} else {
				$t.removeClass('current');
				$c.animate({ height: '0px' }, { queue: false, duration: 500, 
					complete: function() {
						$(this).css({ display: 'none' });
					}
				});
				$s = false;
			}
			return false;
		});
	});
});
