Please read this before posting:
If you have a question about some specific piece of code, post the code! It'll make it much easier for people to help you.
When you post code, make it readable. You can use this tool to do exactly that.
Use the <lj-cut> tag if you need to post something that's either very long (vertically) or very wide (horizontally). Be considerate of others' Friends pages.
If you cross-post, please mention where else you posted -- not just the fact that it is cross-posted -- so that people know where they can find further discussion.