// JavaScript Document
function validarComentario(form) 
{
	var error=new Array();
	// Limpiar datos
	$('usuario').value=$$('usuario').trim();
	$('comentario').value=$$('comentario').trim();
		
	// Validar Campos
	
	if ($('usuario').value=="")
	{
		error.push("Ingrese su nombre");
	}
	
	if ($('comentario').value=="")
	{
		error.push("Ingrese un comentario");
	}
	
	// Imprimir errores sólo si hay, sino enviar formulario
	if (error.length) 
	{
		alert(error.join("\n"));
		//$('errores').innerHTML=error.join("<br />");
		return false;
	} 
	else 
	{
		
		return true;
	}
}


function contarLetras(texto,maximo) 
{
	if(texto.length > maximo)
	{
		alert('Maximo '+maximo+' caracteres');
		return false;
	}
	else
	{
		return true;	
	}

}


function loadPage(page,usediv) {
		try {xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {}
		xmlhttp.onreadystatechange = function() {
			if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
				document.getElementById(usediv).innerHTML = xmlhttp.responseText;
			}
		}
		xmlhttp.open("GET", page);
		xmlhttp.send(null);
		return false;
	}