I really never thought about animation, but this is what i just think of:
I don't know if this'll help any but that the simplest way to do it (i think)
if(runAnimate >=2) //how many image in the animated picture
runAnimate = 0; //reset the animation
if(runAnimate == 0)
if(runAnimate == 1)
//and so on with the third, fourth, ....
//Draw the box with glTexCoord2d();