added test for 'length' in repaint, when testing for array vs string.  also added getInstanceIndex debugging function.
replaced a semi colon with a comman - it was causing globally scoped vars. pesky javascript.
add filter by node type 8 as well as 3
removed a couple of unnecessary calls to getElementObject