added "middle" as a position value

I've had to use PHP calculations for this as I do not want to import
jQuery