That is the tough part. Your best bet is to eliminate all the code (save a backup) and start from square one. Start placing blocks of code back until the error displays again. This will allow you to narrow it down to a specific snippet of code and we will better be able to support you.
Currently I don't have the time (or the knowledge) to sift through all your code and give you better guidance.
Good luck, hope to see a response