// JavaScript Document
function openAjax() {
var Ajax;
try {Ajax = new XMLHttpRequest();
}catch(ee) {
try {Ajax = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e) {
try {Ajax = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e) {Ajax = false;
}
}
}
return Ajax;
}

function OpenMat(codmat) {
window.scrollTo(0,0);
getRefToDiv("topread").innerHTML = '<img src="/images/area/'+codmat.substring(0,2)+'.jpg" width="744" height="102" />'
if(document.getElementById) {
var exibeResultado = document.getElementById("contenido");
var Ajax = openAjax();
Ajax.open("GET", "/read.ipl/read.asp?"+codmat, true);
Ajax.onreadystatechange = function()
{
if(Ajax.readyState == 1) {
exibeResultado.innerHTML = "<img src='/images/loading.gif' width='16' height='16' hspace='10' align='absmiddle'> Cargando...";
}
if(Ajax.readyState == 4) {
if(Ajax.status == 200) {
var resultado = Ajax.responseText;
resultado = resultado.replace(/\+/g," ");
resultado = unescape(resultado); // Resolve o problema dos acentos
exibeResultado.innerHTML = resultado;
} else {
exibeResultado.innerHTML = "&nbsp;&nbsp;&nbsp;<strong>Erro: [BAD CONNECTION]</strong>";
}
}
}
Ajax.send(null); // submete
}
}