sWZBaseFolder = "http://localhost/";                          
sWZ = window.location.href;                                     
iWZ = sWZ.indexOf(sWZBaseFolder) + sWZBaseFolder.length + 1;    
sWZBase = sWZ.substring(0,iWZ);                                 

var browser;
if(navigator.userAgent.indexOf('MSIE')!= -1) {browser=false;}
else {browser=true;}
// global request and XML document objects
var req;
var url;
var update = 5;

var msg;
var msgud;
var res;
//--------------------------------------------//
function loadXMLDoc() {
  
   		url = "include/indicadores.xml";
 
  if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
  // branch for native XMLHttpRequest object
  } else if(window.XMLHttpRequest) {
    req = new XMLHttpRequest();
  // retornar si no cumple con ningún caso
  } else {
    return 0;
  }
  actualizarXML();
}

//--------------------------------------------//
// handle onreadystatechange event of req object
function processReqChange() {
  // only if req shows "loaded"
  if (req.readyState == 4) {
    // only if "OK"
    if (req.status == 200) {
      fill_xml_fields();
    };
  };
};


//--------------------------------------------//
// Llena los labels con informacion sobre la
// cancion actual y la proxima
function fill_xml_fields() {
  var itemsc = req.responseXML.getElementsByTagName("uf")[0];
  if(itemsc) {
    
	if(itemsc.firstChild) {itemsc = itemsc.firstChild.nodeValue;} else {itemsc = "--";}
	
	document.all.uf.innerHTML = itemsc;
  }
  
  itemsc = req.responseXML.getElementsByTagName("dolar")[0];
  if(itemsc) {
    
	if(itemsc.firstChild) {itemsc = itemsc.firstChild.nodeValue;} else {itemsc = "--";}
	
	document.all.dolar.innerHTML = itemsc;
  }
}
function actualizarXML() {

  try {
    req.onreadystatechange = processReqChange;
    req.open("GET", url);
    req.setRequestHeader("Content-Type", "text/xml");
    // evita el cache en IE
    req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
    req.send(null);
  } catch(e) {
//    alert('catch... \n'+e);
  }

}