[jQuery] Prev / Next - one works, the other doesn't!?

[jQuery] Prev / Next - one works, the other doesn't!?

<HTML >
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
</HEAD>
<BODY >
<DIV STYLE="margin:0 0 20px 0;">
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=344340311-10102007>Hi
all,</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN
class=344340311-10102007></SPAN></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=344340311-10102007>I have a
simple calendar that I'm building, where I need to swap between the months (yes
I know there are calendar applications, but I need something simple and
lightweight), where my HTML looks like this:</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN
class=344340311-10102007></SPAN></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN
class=344340311-10102007>---</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=344340311-10102007><div
id="calendar"></SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN
class=344340311-10102007></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=344340311-10102007>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=344340311-10102007><a
name="month-oct"></a><BR><table
id="month-oct"><BR><tr><BR><th></th><BR><th
colspan="5">October</th><BR><th><a href="#month-nov"
class="next-month">Next</a></th><BR></tr><BR></table></SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN
class=344340311-10102007></SPAN></FONT> </DIV>
<DIV><SPAN class=344340311-10102007>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=344340311-10102007><a
name="month-nov"></a><BR><table
id="month-nov"><BR><tr><BR><th><a href="#month-oct"
class="prev-month">Prev</a></th><BR><th
colspan="5">November</th><BR><th><a href="#month-dec"
class="next-month">Next</a></th><BR></tr><BR></table></SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT> </DIV>
<DIV><SPAN class=344340311-10102007><FONT face="Trebuchet MS"
size=2></div></FONT></SPAN></DIV>
<DIV></SPAN></SPAN></FONT><FONT face="Trebuchet MS" size=2><SPAN
class=344340311-10102007>---</SPAN></FONT></DIV></DIV></DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN
class=344340311-10102007></SPAN></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=344340311-10102007>and my
jQuery script looks like this:</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN
class=344340311-10102007></SPAN></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN
class=344340311-10102007>---</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=344340311-10102007>//hide the
calendar tables, then show first<BR>$("#calendar table").hide();<BR>$("#calendar
#month-oct").show();<BR> <BR>$("#calendar th a").click(function(){<BR>//
show next table based on anchor<BR>$(this.href.substring(this.href.indexOf("#"),
this.href.length)).show();</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=344340311-10102007>// hide
current table<BR>$(this).parent().parent().parent().hide();</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=344340311-10102007>//don't
click through<BR>return false;<BR>});</SPAN></FONT></DIV>
<DIV><SPAN class=344340311-10102007><FONT face="Trebuchet MS"
size=2>---</FONT></SPAN></DIV>
<DIV><SPAN class=344340311-10102007><FONT face="Trebuchet MS"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=344340311-10102007><FONT face="Trebuchet MS" size=2>Here's the
problem - when I click on "Next" in the first table, the second table is
displayed, and the first dissapears, but when I click on "Prev" in the
second table, it dissapears, but the first one doesn't re-appear! Why would that
happen? The function to show the next table is the same as the previous, so i
can't see what would cause it to not show? Does hide() now remove the HTML from
the code or something?  I can accurately target the previous table - if I
replace hide() with a css() rule, it works OK.</FONT></SPAN></DIV>
<DIV><SPAN class=344340311-10102007><FONT face="Trebuchet MS"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=344340311-10102007><FONT face="Trebuchet MS" size=2>Any
ideas?</FONT></SPAN></DIV>
<DIV><SPAN class=344340311-10102007><FONT face="Trebuchet MS"
size=2></FONT></SPAN> </DIV><FONT face="Trebuchet MS" size=2>
<P align=left><B>Lu</B><B>c Pestille</B><BR>Web Designer</P></FONT>
<DIV> </DIV>
</DIV>
<DIV STYLE="FONT: 10px/1.4 verdana,arial; COLOR: #aaaaaa"><IMG STYLE="MARGIN: 10px 0px" HEIGHT="100" ALT="in2 is part of the BWP Group" SRC="cid:f8b7f965be@decd4328-e0b1" WIDTH="600" BORDER="0">
<P>in2, Thames House, Mere Park, Dedmere Road, Marlow, Bucks, SL7 1PB<BR>tel: +44 (1628) 899700 | fax: +44 (1628) 899701 | email: <A HREF="mailto:sales@in2.co.uk">sales@in2.co.uk</A> | web: <A HREF="http://www.in2.co.uk/">www.in2.co.uk</A></P>
<P>This message (and any associated files) is intended only for the use of jquery-en@googlegroups.com and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not jquery-en@googlegroups.com you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author jquery-en@googlegroups.com and do not necessarily represent those of the company. </P>
</DIV>
</BODY>
</HTML>