Partially converted to jQuery mobile