Animate callback function

sorry for re posting but i dont want people to tldr, the code has changed drastically anyways. i will include all necessarily information here as concisely as possible
i believe we are very close to solving the problem
i am trying to use the animate callback function to properly queue the opening of a new tab after the closing of another
the error is denoted by //error here
http://patrickallard.net63.net/