function votarNoticia(numeroFormulario, idNoticia)
{
      var f = document.forms[numeroFormulario];
      var segundoParametro = "pestanaVotos"+numeroFormulario;
      
      getData(idNoticia, "pestanaVotos"+numeroFormulario);
      //f.submit();
}

function getHTTPObject() {
  var xmlhttp;
  
  /*@cc_on
  
  @if (@_jscript_version >= 5)
  
    try  {
    
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    
    }
  
    catch (e) {
  
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
  
      catch (E) {
        xmlhttp = false;
      }
  
    }
  
  @else xmlhttp = false;
  
  @end @*/
  
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
  
    try {
      xmlhttp = new XMLHttpRequest();
    }
  
    catch (e)  {
      xmlhttp = false;
    }
  
  }
  
  return xmlhttp;
}

function getData(id, elemento) {

  //Muestra un mensaje en el elemento correspondiente
  document.getElementById(elemento).innerHTML = 'votando...';
  //Llamamos a la función que crea el objeto
  var http = getHTTPObject();

  //Especificamos la URL a hacer el pedido, usando el id ingresado en el form
  url = 'votarNoticia.php';
  http.open('POST', url, true);
  http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  http.send("idNoticiaVotar="+id);
 
  //Asignamos la función que se activará automaticamente cuando cambie el estado del objeto
  http.onreadystatechange = function() {
    
    if(http.status == 200) {

    
      //Mostrar los datos una vez obtenida la respuesta del servidor
      if (http.readyState == 4) {
         document.getElementById(elemento).innerHTML = http.responseText;
      }  

    } else {
      //Mostrar mensaje de error
      alert('Error al enviar pedido. Error '+ http.status+': ', http.statusText);  
    }

  }
  
  //Enviar pedido  
  
  return false;
}
