

function deactivate() {
     var allDivs = document.getElementsByTagName("input");
        
        /* Alle divs auf der Seite durchlaufen */
        for(var i = 0; i != allDivs.length; i++)
        {
          if(allDivs[i].id.substr(0, 4) == "test") {
          allDivs[i].disabled=true;
          
          allDivs[i].className="INAKTIV";
          
          }
        }
        setTimeout("enabledivs()",5000);
}

function enabledivs() {
     var allDivs = document.getElementsByTagName("input");
        
        /* Alle divs auf der Seite durchlaufen */
        for(var i = 0; i != allDivs.length; i++)
        {
          if(allDivs[i].id.substr(0, 4) == "test") {
          allDivs[i].disabled=false;
           allDivs[i].className="AKTIV";
         
          //alert(1);
          }
        }
}


function updateall() {
	   var allDivs = document.getElementsByTagName("div");
        
        /* Alle divs auf der Seite durchlaufen */
        for(var i = 0; i != allDivs.length; i++)
        {
          if(allDivs[i].id.substr(0, 8) == "WERTUNG-") {
          	

          var divname=allDivs[i].id.substr(8, 20);
          vote('/uploads/tx_lumophpinclude/ajaxcalling2.php?Star=' + divname,divname);
          }
        }
     //vote('ajaxcalling2.php?Star=Klaudia','Gerold');
}

function updatehighscore() {
	       
          highscorelist('/uploads/tx_lumophpinclude/ajaxcalling3.php?paramId=1');
          }

function updatehighscoreall() {
	       
          highscorelistall('/uploads/tx_lumophpinclude/ajaxcalling4.php?paramId=1');
          }
        



function CreateXmlHttpObject() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();//creates a new ajax object
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");//this is for IE browser
			}
			catch(e){
				try{
				req = new ActiveXObject("Msxml2.XMLHTTP");//this is for IE browser
				}
				catch(e1){
					xmlhttp=false;//error creating object
				}
			}
		}
		 	
		return xmlhttp;
	}

  	
	
  function vote(strURL,elementid)
    {         
     var divid='WERTUNG-'+elementid;
     var oDate = new Date();
     //alert(strURL);
	 strURL=strURL+'&time='+ oDate.getMilliseconds();	
     
     var req = CreateXmlHttpObject(); // fuction to get xmlhttp object
     if (req)
     {
      req.onreadystatechange = function()
     {
      if (req.readyState == 4) { //data is retrieved from server
       if (req.status == 200) { // which reprents ok status                    
         document.getElementById(divid).innerHTML=req.responseText;//put the results of the requests in or element
      }
      else
      { 
         alert("There was a problem while using XMLHTTP:\n");
      }
      }            
      }        
    
    req.open("GET", strURL, true); //open url using get method
    req.send(null);//send the results
     }
    }
    
    function highscorelist(strURL)
    {         
     var divid='HIGHSCORE';
     var sDate = new Date();
     strURL=strURL+'&time='+ sDate.getMilliseconds();	
     var req = CreateXmlHttpObject(); // fuction to get xmlhttp object
     if (req)
     {
      req.onreadystatechange = function()
     {
      if (req.readyState == 4) { //data is retrieved from server
       if (req.status == 200) { // which reprents ok status                    
         document.getElementById(divid).innerHTML=req.responseText;//put the results of the requests in or element
      }
      else
      { 
         alert("There was a problem while using XMLHTTP:\n");
      }
      }            
      }        
    req.open("GET", strURL, true); //open url using get method
    req.send(null);//send the results
     }
    }

function highscorelistall(strURL)
    {         
     var divid='HIGHSCOREALL';
     var sDate = new Date();
     strURL=strURL+'&time='+ sDate.getMilliseconds();	
     var req = CreateXmlHttpObject(); // fuction to get xmlhttp object
     if (req)
     {
      req.onreadystatechange = function()
     {
      if (req.readyState == 4) { //data is retrieved from server
       if (req.status == 200) { // which reprents ok status                    
         document.getElementById(divid).innerHTML=req.responseText;//put the results of the requests in or element
      }
      else
      { 
         alert("There was a problem while using XMLHTTP:\n");
      }
      }            
      }        
    req.open("GET", strURL, true); //open url using get method
    req.send(null);//send the results
     }
    }
  