Added jQuery support and replace all document.getElementxxx  with jquery