tweaked logic for positionControlDiv, although it is very suspect.