

var xmlDoc22;
var xmlObj22;
var IdiomaGeneral

function loadXML22(xmlFile)
{
	//load xml file
	// code for IE
	
	if (window.ActiveXObject)
	{
		xmlDoc22 = new ActiveXObject("Microsoft.XMLDOM");
		//xmlDoc22.async = false;
		xmlDoc22.load(xmlFile);		
		//xmlObj22 = xmlDoc22.documentElement; 
		//ProcessXML();
		xmlDoc22.onreadystatechange = function(){if (xmlDoc22.readyState == 4){ProcessXML();} }	
	}
	// code for Mozilla, Firefox, Opera, etc.
	else if (document.implementation && document.implementation.createDocument)
	{
		
		xmlDoc22 = document.implementation.createDocument("ns","root",null);
		var isLoaded = xmlDoc22.load(xmlFile);			
		xmlDoc22.onload = ProcessXML;//setTimeout("ProcessXML();",0100);				
	}
	
}
function ProcessXML()
{
	
	xmlObj22 = xmlDoc22.getElementsByTagName('root')[0];
	var apto = xmlObj22;		
	while(xmlObj22.childNodes.length > 0)
	{
		
				
		if(document.all)
		{
			var nomTag = xmlObj22.firstChild.tagName ;
			var valorTag = xmlObj22.firstChild.getAttribute(IdiomaGeneral);
			apto.removeChild(xmlObj22.firstChild);
		}
		else
		{
			var nomTag = xmlObj22.firstChild.nextSibling.tagName ;
			var valorTag = xmlObj22.firstChild.nextSibling.getAttribute(IdiomaGeneral);
			apto.removeChild(xmlObj22.firstChild);
			apto.removeChild(xmlObj22.firstChild);
			if(xmlObj22.childNodes.length == 1)
			{
				apto.removeChild(xmlObj22.firstChild);
			}			
		}
		//alert(nomTag);
		if(document.getElementById(nomTag))
		{
			document.getElementById(nomTag).innerHTML = valorTag;//.Replace('&lt;','<').Replace('&gt;','>').Replace('&quot;','"');
			
		}	
		
		
	}	
}
function posarTextos(xmlFile,idioma)
{
	IdiomaGeneral = idioma;
	loadXML22(xmlFile);	
	if(document.getElementById('formulariNoFlotant'))
	{
		document.getElementById('formulariNoFlotant').style.visibility = "visible";
	}
	
}
