
function xmlhttpPost(strURL) {
var xmlHttpReq = false;
var self = this;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 4) {
updatepage(self.xmlHttpReq.responseText);
}
}
self.xmlHttpReq.send();
}

function updatepage(str){
if (document.getElementById("numero_contagem")!=null)
document.getElementById("numero_contagem").innerHTML = str;
}

function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}

function ajaxonline2()
{

	var url = location.href;
	if(Left(location.href,11)=="http://www.")
	{
		JavaScript:xmlhttpPost("http://www.cursos24horas.com.br/js/resposta.asp")
	}
	else
	{
		JavaScript:xmlhttpPost("http://cursos24horas.com.br/js/resposta.asp")
	}
	
}
function ajaxonline()
{
	ajaxonline2()
	var t=setInterval("ajaxonline2()",5100);	
}
ajaxonline();
