And what does this have to do with your original question?
Why do you have a document ready function inside another function?
Your last two posts appear to contradict each other.
You say that a particular line is not being executed but then the next post says the same line is the problem.
Stop changing the code and tell us:
1) The error you are seeing
2) On what line the error occurs (bearing in mind that if the line is not executed, it is not the problem.