function rateImg(rating,imgId)
{
    remotos = new datosServidor;
    resposta = remotos.enviar('/Rating/update.aspx?rating='+rating+'&idfoto='+imgId);
    resposta = resposta.split("|");
    
    if(resposta[0] == "ok")
    {
        var tamanhoImagem = resposta[3];
        /*
        document.getElementById('current-rating').style.width = tamanhoImagem + 'px';
        document.getElementById('ratingInfo').innerHTML = "Rating: " + resposta[1] + " of 5 stars - " + resposta[2] + " votes";
        document.getElementById('rating-msg').innerHTML= "<BR>Thank you for your vote!";
        */
        alert("Thank you for your vote!")

        window.location.reload()        
    }
    else if(resposta[0] == "err")
    {
        //document.getElementById('rating-msg').innerHTML= "<BR>" + resposta[1];
        
        alert(resposta[1])
    }
    
}