/* Firefox */
function get_xml(pxml,pxsl,div,func,ini){
	var axml = creajax();
	tmp="&sid=" + Math.random();
	axml.open("GET", pxml+tmp);
	axml.onreadystatechange = function() { 
	if (axml.readyState == 4) { if (axml.status == 200) {
		xmlDoc = axml.responseXML;
		get_xsl(pxsl,div,func,ini);
	}else{ setTimeout("get_xml('"+pxml+"','"+pxsl+"','"+div+"',"+func+")",1000); }/*200*/
	}/*/4*/};/*/function*/
	axml.send("");
}

function get_xsl(pxsl,div,func,ini){
	var axsl = creajax();
	axsl.open("GET", pxsl);
	axsl.onreadystatechange = function() { 
	if (axsl.readyState == 4) { if (axsl.status == 200) {
		xslDoc = axsl.responseXML;	
		XMLXSL(div,func,ini)		
	}else{ setTimeout("get_xsl('"+pxsl+"','"+div+"',"+func+")",1000); }/*/200*/} /*/4*/};/*/function*/
	axsl.send("");
}

function XMLXSL(div,func,ini){
	if (esIE30()){
//		alert(xmlDoc.transformNode(xslDoc));
		ine(div,xmlDoc.transformNode(xslDoc));
		func;
	}else{
	var myDOM;
		var xsltProcessor = new XSLTProcessor();
		xsltProcessor.importStylesheet(xslDoc);
		xsltProcessor.setParameter(null, "iniitm", ini);
		var fragment = xsltProcessor.transformToFragment(xmlDoc, document);
		myDOM = fragment;
		document.getElementById(div).appendChild(fragment);
		func;
	}
}

function esIE30(){
	var browserType=navigator.userAgent;
	if (browserType.indexOf("MSIE")==-1){return false;}else{return true;}
	}


function IEXSL(div,func,ini,pxsl,star){
		var axsl = creajax(); 
	//axsl.open("POST", star+"xsl/xsl.php?xsl="+pxsl+"&iniitm="+ini);
	axsl.open("POST", star+"xsl.php?xsl="+pxsl+"&iniitm="+ini);
//	alert("xsl/xsl.php?xsl="+pxsl+"&iniitm="+ini);
	axsl.onreadystatechange = function() { 
	if (axsl.readyState == 4) { if (axsl.status == 200) {
		xslDoc = axsl.responseXML;	
//		alert(axsl.responseText);
	XMLXSL(div,func,ini);
}}};
axsl.send("");
	}

function XMLtoXSL(pxml,pxsl,div,func,ini,star){
	if (esIE30()){
	var axml = creajax(); 
//alert(pxsl);
	tmp="&sid=" + Math.random();
	axml.open("GET", pxml+tmp);
	axml.onreadystatechange = function() { 
	if (axml.readyState == 4) { if (axml.status == 200) {
	xmlDoc = axml.responseXML;	
//	alert(axml.responseText);
	IEXSL(div,func,ini,pxsl,star);}}};
	axml.send("");
	}else{ get_xml(pxml,pxsl,div,func,ini);}

}


function llamaHTML(div,url,func){
	var ahtm = creajax(); 
	ahtm.open("GET", url);
//alert(url);
	ahtm.onreadystatechange = function() { 
	if (ahtm.readyState == 4) { if (ahtm.status == 200) {
		ine(div,ahtm.responseText);
//			alert(ahtm.responseText);
		func;
}}};
ahtm.send("");
	
	}
	


   function EnvioMail(div, url, parameters, func) {    
	  aform = creajax();
      //alert(url);
	  if (!aform) {return false;}
      aform.onreadystatechange = function() {
		if (aform.readyState == 4) { if (aform.status == 200) {
		ine(div,aform.responseText);
//			alert(ahtm.responseText);
		func;
}}};;
      aform.open('POST', url, true);
      aform.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      aform.setRequestHeader("Content-length", parameters.length);
      aform.setRequestHeader("Connection", "close");
      aform.send(parameters);
   }
   
   
function CallAjax(div,url,func){
	var ahtm = creajax(); 
	ahtm.open("GET", url);
//alert(url);
	ahtm.onreadystatechange = function() { 
	if (ahtm.readyState == 4) { if (ahtm.status == 200) {
		ine(div,ahtm.responseText);
//			alert(ahtm.responseText);
		//setTimeout(' '+func+' ',500);
		return true;
}else{return false;}}};
ahtm.send("");
	
	}