var xmlDoc;

function getTimes(thisDate, thisTimeZone, thisOption)
{
	xmlDoc = GetXmlHttpObject();
	xmlDoc.onreadystatechange=stateChanged;
	xmlDoc.open("GET", "/getTimes.php?TZ=" + thisTimeZone + "&Date="+thisDate, true);
	xmlDoc.send(null);
}

function delThumb(fs, tn)
{
	xmlDoc = GetXmlHttpObject();
	xmlDoc.open("GET", "/delThumb.php?fs=" + fs+ "&tn="+tn, true);
	xmlDoc.send(null);
}

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 stateChanged()
  {
  if(xmlDoc.readyState==4)
    {
    	var times = xmlDoc.responseText;
		var slots = times.split("|");
		
		var thisOption = document.forms.theForm.contactTime;
		
		thisOption.options.length=0;
		thisOption.options[0] = new Option('[Select a Time]', "");
		for(var i=0; i < slots.length-1; i++) { 
			var thisTime = slots[i].split(",");
			thisOption.options[i+1]= new Option(thisTime[0], thisTime[1]);
	    }
  }
}
