function getObject(obj) {
 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;
}
function count(e,entrada,salida,texto,caracteres) {
 var entradaObj=getObject(entrada);
 var salidaObj=getObject(salida);
 
 var keynum;
 if(window.event)
  {
   keynum = e.keyCode;
  }
  else if(e.which)
  {
   keynum = e.which;
  }
 
 var longitud;
 
 if (keynum != 8)
  longitud=caracteres - (entradaObj.value.length + 1);
 else
  longitud=caracteres - (entradaObj.value.length - 1);

 salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
 if (longitud < 0)
     salidaObj.style.color = "red";
 else if (longitud < 10)
     salidaObj.style.color = "firebrick";
 else
      salidaObj.style.color = "";
 
}
function set_personal(usrname)
{
    if (document.getElementById('post_post_text'))
    {
      window.scrollTo(0,0);
      document.getElementById('post_post_text').value='@' + usrname + ' ';
      $('#post_post_text').show();
      $('#post_post_textClone').hide();
      $('#post_post_text').focus();
    }
}