little refactor to reuce loading time

jquery page search was used twice on the whole page which doubled the
loading time. I narrowed it by using the element found in the page and
then quering its sub elements.