var xmlHttp

function importa()
{
var url="/torneo/calendario/recupera-idgiocatore.asp?page="+document.getElementById("pg").value;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Il tuo browser non supporta questa funzione AJAX!");
  return;
  }
url=url+"&sq="+document.getElementById("SquadraPerID").options(document.getElementById("SquadraPerID").selectedIndex).text
xmlHttp.onreadystatechange=RecuperaIDGiocatore;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function RecuperaIDGiocatore() 
{
	if (xmlHttp.readyState==4)
	{
	document.body.style.cursor="auto";
	document.getElementById("txt").innerHTML=xmlHttp.responseText;
	CaricaIDG();
	}
	else
	{
	document.body.style.cursor="wait";
	}  
}

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;
}

function CaricaIDG()
{
	document.getElementById("Autore").value=document.getElementById("IDGioc").options(document.getElementById("IDGioc").selectedIndex).value;
	if (document.getElementById("IDGioc").selectedIndex==0)
		{
		document.getElementById("Autore").style.background="#FFFFFF";
		}
	else
		{
		document.getElementById("Autore").style.background="#D5FFD5";
		document.getElementById("Password").focus();
		}
}IDGioc
