// JavaScript Document
var xmlHttp

function doPopups() {
if (!document.getElementsByTagName) return false;
 var links = document.getElementsByTagName("a");
 for (var i=0; i < links.length; i++) {
  if (links[i].className.match("popup")) {
   links[i].onclick = function() {
   showCT(this.name);
   return false;
  }
 }
}
}
window.onload = doPopups;

function showCT(str)
{ 
document.getElementById("loading").style.visibility="visible";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url=str+".html"
url=url+"?sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged1
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged1() 
{ 
 if (xmlHttp.readyState==1)
 { 
 document.getElementById("sourceCode").innerHTML=""
 }
 if (xmlHttp.readyState==4){
 document.getElementById("sourceCode").innerHTML="Imposs&iacute;vel conex&atilde;o com o servidor. Tente novamente mais tarde."
 		if (xmlHttp.status==200) { 
 document.getElementById("sourceCode").innerHTML=xmlHttp.responseText
 document.getElementById("loading").style.visibility="hidden"
		}
 }
}

function GetXmlHttpObject()
{
var xmlHttp=null;

try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
