use instanceof to determine active element type to make it work for both chrome and IE
Merge branch 'master' of https://github.com/piecework/pieceweb