//XMLHttpRequest erzeugen:
var anfrage = null;
 try{
 anfrage = new XMLHttpRequest();
 }
 catch(e){
  try{
   anfrage = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e){
   try{
    anfrage = new ActiveXObject("Microsoft.XMLHTTP");
   }
   catch(e){
    anfrage = null;
   }
  }
 }

function vote(wahl, video_id) {
	if(anfrage != null)
         {
  		var url="?voting";
  		var parameter = "wahl="+encodeURI(wahl)+"&video_id="+encodeURI(video_id );
  		anfrage.open("POST", url, true);
                 anfrage.onreadystatechange=voting_ausgeben;
  		anfrage.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  		anfrage.send(parameter);
         }
         else
         {
          	alert("XMLHttpRequest-Objekt konnte nicht erstellt werden.");
         }
}

function voting_ausgeben() {
          if(anfrage.readyState==4)
          {
  	 	if(anfrage.status==200)
                 {
   			var rueckgabewert = anfrage.responseText;
   			document.getElementById("video_voting").innerHTML = rueckgabewert;

                         window.setTimeout('disappear_box("video_voting_notice")', 1000);
  		}
 	 }
}

/*<form name="voting">
 <li><input type="image" src="img/stern_over2.jpg" onclick="vote(1)" name="voting_1" id="voting_1" alt="Schlecht" onMouseOver="SternOver(1,5)" onMouseOut="SternOut(3,5)" /></li>
 <li><input type="image" src="img/stern_over2.jpg" onclick="vote(2)" name="voting_2" id="voting_2" alt="Schlecht" onMouseOver="SternOver(2,5)" onMouseOut="SternOut(3,5)" /></li>
 <li><input type="image" src="img/stern_over2.jpg" onclick="vote(3)" name="voting_3" id="voting_3" alt="Schlecht" onMouseOver="SternOver(3,5)" onMouseOut="SternOut(3,5)" /></li>
 <li><input type="image" src="img/stern_out2.jpg" onclick="vote(4)" name="voting_4" id="voting_4" alt="Schlecht" onMouseOver="SternOver(4,5)" onMouseOut="SternOut(3,5)" /></li>
 <li><input type="image" src="img/stern_out2.jpg" onclick="vote(5)" name="voting_5" id="voting_5" alt="Schlecht" onMouseOver="SternOver(5,5)" onMouseOut="SternOut(3,5)" /></li>
</form>*/