Several improvements, adding jquery plugin