
var botaoClicado;

function OnSubmitForm()
{
  if(document.pressed == 'Buscar')
  {
        document.myform.action ="insert.html";
  }
  else
  if(   document.pressed == 'Update')
  {
        document.myform.action ="update.html";
  }
  return true;
}

function reportProblem(tipo, noticia)
{
    document.report_problem.tipo_problema.value = tipo.value;
    document.report_problem.noticia.value = noticia;
    if(document.report_problem.tipo_problema.value != 1) // 'Problema'
    {
        document.report_problem.submit() ;
    }
}

function reportProblemComentario(tipo, comentario)
{
    document.report_problemcomentario.tipo_problema.value = tipo.value;
    document.report_problemcomentario.comentario.value = comentario;
    if(document.report_problemcomentario.tipo_problema.value != 1) // 'Problema'
    {
        document.report_problemcomentario.submit() ;
    }
}

function textareaSize(campo, contador, max)
{
    if (campo.value.length > max)
    {
        campo.value = campo.value.substring(0, max);
    }
    else
    {
        contador.value = max - campo.value.length;
    }
}

