var xmlHttp3 = getXmlHttpObject();

function controllaAvvio(){
/*var keyCode = event.keyCode ? event.keyCode : event.which ? event.which :
event.charCode;	
if(keyCode==13)*/
{
	document.ricerca.submit();
}
}

function accettaValutazione(x){
	
	if(confirm("Sicuro di voler accettare la valutazione?")){
	xmlHttp3.open('GET', 'accettaValutazione.php?cod='+x, true);
	xmlHttp3.onreadystatechange = stateChangedValutazione;
	xmlHttp3.send(null);}
}

function stateChangedValutazione() {
	if(xmlHttp3.readyState == 4) {
		//Stato OK
		if (xmlHttp3.status == 200) {
			var s=xmlHttp3.responseText;
			if(s=="Valutazione accettata correttamente"){
			alert(s);
			location.reload(true);
			}
			else
			alert("Errore");
			
		}
	}
}






function stateChanged() {
	if(xmlHttp3.readyState == 4) {
		//Stato OK
		if (xmlHttp3.status == 200) {
		}
	}
}


function getXmlHttpObject()
{
  var xmlHttp=null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}

