equal and indexof need to support comparing items of differnet types, ie string vs number. this is needed because numeric ids stored in val() are strings and need to be compared against data ids which are numbers. fixes #840