Renamed variables
Div changes

Clear id field on tab switch, removed toLowerCase in database search,
set minimum frame size
Improved code

Merged two loops into one without adding complexity.
Improved resizing

Changed minimum size to prefered size.