Many javascript test, creating generic function with jquery to manage dynamic contents