document.write replaced with jquery