var xmlHttp

function changeDates(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 
	{
	 alert ("Your browser does not support HTTP requests, try upgrading at www.getfirefox.com")
	 return
	}
 
	var url="inc/changeDates.php"
	url=url+"?id="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged() 
{ 
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") 
  { 
   document.getElementById("dates").innerHTML=xmlHttp.responseText 
  } else {
   document.getElementById("dates").innerHTML='<select><option value="" disabled="disabled" selected="selected">Loading dates...</option></select>'
  }
}

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;
}
