1function getAttributes ( node ) {
2 var i,
3 attributeNodes = node.attributes,
4 length = attributeNodes.length,
5 attrs = {};
6
7 for ( i = 0; i < length; i++ ) attrs[attributeNodes[i].name] = attributeNodes[i].value;
8 return attrs;
9}