function VotingMovie(movie_id, vote)
{
    if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
    } else {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4 && xmlhttp.status==200) {
        document.getElementById("vote_summary").innerHTML=xmlhttp.responseText;
		document.getElementById("vote_form").innerHTML = 'Dėkojame. Jūsų įvertinimas priimtas.<br /><br />';
      }
    }
    xmlhttp.open("GET","voting.php?movie_id="+movie_id+"&vote="+vote, true);
    xmlhttp.send();
}

function VotingTrailer(trailer_id, vote)
{
    if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
    } else {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4 && xmlhttp.status==200) {
        document.getElementById("vote_summary").innerHTML=xmlhttp.responseText;
		document.getElementById("vote_form").innerHTML = 'Dėkojame. Jūsų įvertinimas priimtas.<br /><br />';
      }
    }
    xmlhttp.open("GET","voting_trailer.php?trailer_id="+trailer_id+"&vote="+vote, true);
    xmlhttp.send();
}

function BestMovie(movie_id, user_id, status_id)
{
    if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
    } else {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4 && xmlhttp.status==200) {
        document.getElementById("movie_"+movie_id).innerHTML=xmlhttp.responseText;
      }
    }
    xmlhttp.open("GET","best_movie.php?movie_id="+movie_id+"&user_id"+user_id+"&status_id="+status_id, true);
    xmlhttp.send();
}

function CommentVote(comment_id, vote, old_vote)
{
    document.getElementById("votebuttons_"+comment_id).innerHTML='ačiū';
	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
    } else {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4 && xmlhttp.status==200) {
        document.getElementById("vote_"+comment_id).innerHTML=xmlhttp.responseText;
      }
    }
    xmlhttp.open("GET","comment_voting.php?comment="+comment_id+"&vote="+vote+"&old_vote="+old_vote, true);
    xmlhttp.send();
}

