function getObject(obj) {
  var theObj;
  if(document.all) {
    if(typeof obj=="string") {
      return document.all(obj);
    } else {
      return obj.style;
    }
  }
  if(document.getElementById) {
    if(typeof obj=="string") {
      return document.getElementById(obj);
    } else {
      return obj.style;
    }
  }
  return null;
}

//Contador de caracteres.
function Contar(entrada,salida,texto) 
{
	var entradaObj=getObject(entrada);
	var salidaObj=getObject(salida);
	var longitud=entradaObj.value.length;
  
	salidaObj.innerHTML = texto.replace("{$char}",longitud);
	if ( longitud < 100 )
		salidaObj.style.color = '#FF0000';
	else
		salidaObj.style.color = '#319F36';

	salidaObj.style.fontWeight = 'bold';

	salidaObj.style.padding = '5px';
}

