var allText;
var act=0;
function loadtestimonial(q) {
	var txtFile = new XMLHttpRequest();
	var date=new Date();
	txtFile.open("GET", "post/testimonios.php?q="+q+"&act="+act+"&t="+date.getTime(), true);
	txtFile.onreadystatechange = function() {
		if (txtFile.readyState === 4) {  // Makes sure the document is ready to parse.
    		if (txtFile.status === 200) {  // Makes sure it's found the file.
	    		allText = txtFile.responseText;
				act=parseInt(trim(allText.substr(0,11)));
				allText=allText.substr(11);
				
    			//lines = txtFile.responseText.split("\n"); // Will separate each line into an array
				fade("testimonialscnt",1,0,0.2,"testext()");
			}
		}
	}
	txtFile.send(null);
	return;
}
function testext() {
	document.getElementById("testimonialscnt").innerHTML=allText;
	fade("testimonialscnt",0,1,0.2);
}
function trim(cadena)
{
	for(i=0; i<cadena.length; )
	{
		if(cadena.charAt(i)=="0")
			cadena=cadena.substring(i+1, cadena.length);
		else
			break;
	}

	/*for(i=cadena.length-1; i>=0; i=cadena.length-1)
	{
		if(cadena.charAt(i)=="0")
			cadena=cadena.substring(0,i);
		else
			break;
	}*/
	
	return cadena;
}