imgid = 0;

function voteCard(imageID,rating){
 //Anzeige

 var url = "./vote.php?imageID="+imageID+"&rating="+rating;

 //XML Objekt initialisieren
 if(window.ActiveXObject) {
   try{
     xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (e) {
     try{
       xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
     } catch (e){
     }
  }
 } else if (window.XMLHttpRequest) {
   try {
     xmlHttp = new XMLHttpRequest();
   } catch (e) {
   }
 }
 if(xmlHttp){
   xmlHttp.open('GET', url, true);
   imgid = imageID;
   xmlHttp.onreadystatechange = getReturnMSG;
   xmlHttp.send(null);
 }
}

function getReturnMSG(url){

  if (xmlHttp.readyState == 4){
    result = xmlHttp.responseText;
    if(result != ""){
       document.getElementById("voteMSG").innerHTML = result;
       document.getElementById("voteMSG").style.display = 'block';

       document.getElementById("votefield"+imgid).innerHTML = 'Danke!';
    }
  }
}