var count_box;

count_box = 1;

try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}

function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}


function carrega(n,p,w){
	var contentar=document.getElementById(n);
    contentar.innerHTML='<div id="loader"><img src="../gif/loader.gif" style="border:none;" /> Loading...</div>'

    xmlhttp.open("GET", p+w,true);

    //Executada quando o navegador obtiver o código
    xmlhttp.onreadystatechange=function() {

        if (xmlhttp.readyState==4){

            //Lę o texto
            var texto=xmlhttp.responseText

            //Desfaz o urlencode
            texto=texto.replace(/\+/g," ")
            texto=unescape(texto)

			var contentar=document.getElementById(n)
            contentar.innerHTML=texto
        }
    }
    xmlhttp.send(null)
}

