function getXmlHttpRequestObject(){
//reusable generic function
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

// Trae el texto de un documento XML, buscando atributos
function getElementTextNSAttrib(prefix, local, parentElem, index) {
	result = parentElem.getAttribute(local);
	if (result) {
		return result;    		
	} else {
        return "n/a";
	}
}

// Trae el texto de un documento XML usando namespaces
function getElementTextNS(prefix, local, parentElem, index) {
    var result = "";
    if (prefix && window.ActiveXObject) {
        // IE/Windows way of handling namespaces
        result = parentElem.getElementsByTagName(prefix + ":" + local)[index];
    } else {
        // the namespace versions of this method 
        // (getElementsByTagNameNS()) operate
        // differently in Safari and Mozilla, but both
        // return value with just local name, provided 
        // there aren't conflicts with non-namespace element
        // names
        result = parentElem.getElementsByTagName(local)[index];
    }
    if (result) {
        // get text, accounting for possible
        // whitespace (carriage return) text nodes 
        if (result.childNodes.length > 1) {
            return result.childNodes[1].nodeValue;
        } else {
            return result.firstChild.nodeValue;    		
        }
    } else {
        return "n/a";
    }
}

function getElementbyClass(classname) {
    var inc=0;
    var customcollection=new Array();
    var alltags=document.all? document.all : document.getElementsByTagName("*");
    for (i=0; i<alltags.length; i++){
    if (alltags[i].className==classname)
        customcollection[inc++]=alltags[i];
    }
    return customcollection;
}