function htmlEncode(p_str) { 
	if (p_str) { 
		return p_str.replace("&","&amp;").replace("<","&lt;").replace(">","&gt;").replace("\"","&quot;");
	} else { 
		return ""; 
	}
}
function getAttributeValue(node, attributeName) {
		if (document.implementation && document.implementation.createDocument) {
			//Mozilla
			return node.attributes[attributeName].value;
		} else if (window.ActiveXObject) {
			//IE
			for(i=0;i<node.attributes.length;i++) {
				if(node.attributes[i].name==attributeName) {
					return node.attributes[i].value;
				}
			}
			return null;
		}
}