Does jquery toggle keep in memory what position it's in or if class is present?

Here’s my basic toggle function


	$('a.recessed_button').toggle(function() {
		$(this).children('span').addClass('opened');
	}, function() {
		$(this).children('span').removeClass('opened');
	});		

Now there’s a form that gets submitted and after submission, there’s a remove class call to take the opened away (it closes the form div). And this works as expected. What’s not expected is when I click the open button again, it doesn’t add the class but still opens the div (separate function).

So, my question is…*what should I be doing on the page that closes everything after form submission? The way it’s acting, it seems as though I need to ‘toggle’ this function back to the state it starts in (“closed”), but not quite sure how to do that.

If i’m being unclear, let me know. Thanks for any help.