function ratingPostDown(postID, id_out){
    ajax = new AJAX('rating.php', 'postID='+postID+'&inc=down');
    ajax.onRecieve = function(){
        data = ajax.getData();
        if(data.substr(0, 9) == '%MESSAGE%'){
            alert(data.substr(9));
        } else{
            document.getElementById(id_out).innerHTML = data;
        }
        //alert(data);
    }
    ajax.onError = function(){
        alert('ERROR');
    }
    ajax.load();
}

function ratingPostUp(postID, id_out){
    ajax = new AJAX('rating.php', 'postID='+postID+'&inc=up');
    ajax.onRecieve = function(){
        data = ajax.getData();
        if(data.substr(0, 9) == '%MESSAGE%'){
            alert(data.substr(9));
        } else{
            document.getElementById(id_out).innerHTML = data;
        }
        //alert(data);
    }
    ajax.onError = function(){
        alert('ERROR');
    }
    ajax.load();
}

