This should be moved to the jquery plugin (if it's not there already)