use jQuery for this whole block.