var llamar='no';
var alertas;
var novedades_mz='';
var req;
var xml;

function doInit_e()
{
	fecha();
	rotafolio.loadXML(ConvToASCII(String(rotafolio.xml)));
	var numero=setTimeout("Ini();",400);
	//formu.action='http://www.anmat.gov.ar/enviar.asp?dir=' + document.URL;
	formu.url_actual.value = document.URL;
}


function ir_a()
{
	if (document.getElementById("cbo_ir_a").value!="nada")
	{
		if (document.getElementById("cbo_ir_a").value.split("target=nueva")[1])
		{
			window.open(document.getElementById("cbo_ir_a").value.split("target=nueva")[0]);
		}
		else
		{
			if(document.location)
			{
				document.location = document.getElementById("cbo_ir_a").value;
			}
		}
		document.getElementById("cbo_ir_a").value="nada";
	}
}

function enviar(){
	var prof = '';
	args = new Array(self.location);
	ruta = String(self.location).split('/');
	for(var i = 1; i < ruta.length-3; i++)
	{
		prof = prof + '../';
	}
	vinculo = prof + 'dlg_envio_link.asp';
	var d = showModalDialog(vinculo,args,"font-size:10px;dialogWidth: 720px;dialogHeight:450px;status: 0;edge: Raised;unadorned: yes;help: 0;scroll: 0");
}

function ConvToASCII(str)
{
  var arrCode = str.split('#');
  var string = arrCode[0];
  for(var i = 1; i < arrCode.length; i++)
  {

    var f = (arrCode[i].charAt(0) == '0')?1:0;
    var charASCII = String.fromCharCode(parseInt(arrCode[i].substring(f,3)));
    string += String(charASCII) + String(arrCode[i].substring(3));
  }

  return string;
}

function fecha()
{
	return (dosDigitos(date)+"/"+dosDigitos(parseInt(mes))+"/"+aniocorto);
}

function ver_video(v,t)
{
	TheForm.evideo.value=v;
	TheForm.etitulo_v.value=t;
	TheForm.eaction='ver_video.asp';
	TheForm.submit();
}


// code for IE
if (window.ActiveXObject)
{
	var alertas = new ActiveXObject("Microsoft.XMLDOM");
	alertas.async = false;
	alertas.load("http://www.anmat.gov.ar/xmlsadmins/alertas.xml");

	var novedades = new ActiveXObject("Microsoft.XMLDOM");
	novedades.async = false;
	novedades.load("http://www.anmat.gov.ar/xmlsadmins/novedades.xml");

	var rotafolio = new ActiveXObject("Microsoft.XMLDOM");
	rotafolio.async = false;
	rotafolio.load("http://www.anmat.gov.ar/rotafolio.xml");
}
else (document.implementation && document.implementation.createDocument)
{
	//loadXMLDoc('./xmlsadmins/novedades.xml');
	//alert("sdfsdf");
	//novedades_mz = (req.responseText);
	//alert(novedades_mz);
}



function loadXMLDoc(url)
{
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        isIE = true;
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send();
        }
    }
}


function processReqChange() 
{
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200)
        {
           //alert(req.responseText);
           //var serializer = new XMLSerializer();
	   //xml = serializer.serializeToString(req.responseText);
	   //alert(xml);
	   //lalala = document.implementation.createDocument("", "doc", xml);
	   //alert(lalala.xml);
        }
        else
        {
           alert("There was a problem retrieving the XML data:\n" +
           req.statusText);
        }
    }
}










