var ShowHtml = new Object();
ShowHtml.NAVIGATOR_FX = "FX" ;
ShowHtml.NAVIGATOR_IE = "IE" ;
ShowHtml.NAVIGATOR_TP = "";
ShowHtml.HOST = "http://" + window.location.host + "/finanzas"; 

var domain = window.location.host.substr(window.location.host.lastIndexOf(".", window.location.host.lastIndexOf(".")-1));
if ((domain == '.jif.es') || (domain == '.yacom.srv')){
	ShowHtml.HOST = "http://" + window.location.host + "/finanzas"; 
}else{
	ShowHtml.HOST = "http://" + window.location.host + "/common/html/finanzas"; 
}




if(document.implementation && document.implementation.createDocument){
	this.ShowHtml.NAVIGATOR_TP = "FX";
}else{
	this.ShowHtml.NAVIGATOR_TP = "IE";
}


ShowHtml.show = function (sXml, sXslt, sHtmlId){
	//alert(ShowHtml.HOST + "/"+sXml);
	//alert(ShowHtml.HOST + "/"+sXslt);

	if(ShowHtml.NAVIGATOR_TP == ShowHtml.NAVIGATOR_FX){
		// *** Mozilla
		var xsltProcessor = new XSLTProcessor();
		// *** load the XSL file
		var myXMLHTTPRequest = new XMLHttpRequest();
		myXMLHTTPRequest.open("GET", ShowHtml.HOST + '/' + sXslt, false);
		myXMLHTTPRequest.send(null);
		// *** get the XML document
		xslStylesheet = myXMLHTTPRequest.responseXML;
		xsltProcessor.importStylesheet(xslStylesheet);
		// *** load the xml file
		myXMLHTTPRequest = new XMLHttpRequest();
		myXMLHTTPRequest.open("GET", ShowHtml.HOST + '/' + sXml, false);
		myXMLHTTPRequest.send(null);
		var xmlSource = myXMLHTTPRequest.responseXML;
		// *** transform
		var resultDocument = xsltProcessor.transformToFragment(xmlSource, document);
		document.getElementById(sHtmlId).appendChild(resultDocument);
		
	}else if(window.ActiveXObject){
		// *** IE
		// *** Load XML
		xml = new ActiveXObject("MSXML2.DOMDocument");
		xml.async = false
		xml.load(ShowHtml.HOST + '/' + sXml)
		// *** Load XSL
		xsl = new ActiveXObject("MSXML2.DOMDocument");
		xsl.async = false
		xsl.load(ShowHtml.HOST + '/' + sXslt)
		// *** Transform
		document.getElementById(sHtmlId).innerHTML=xml.transformNode(xsl);
	}else{
		// *** Browser unknown
		alert("Browser unknown");
	}
} 
