var xmlHttp

function showCities(str)
{
removeAllOptions(document.drop_list.q11);
addOption(document.drop_list.q11, "", "Select a city", "");
removeAllOptions(document.drop_list.q12);
addOption(document.drop_list.q12, "", "Select a store", "");
removeAllOptions(document.drop_list.q13);
addOption(document.drop_list.q13, "", "Select an appt. time", "");
removeAllOptions(document.drop_list.q15);
addOption(document.drop_list.q15, "", "Select a date", "");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Your browser does not support the XMLHttpRequest object.")
return
}
var url="getresults.asp?state=" + encodeURI(str)
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function showStores(str)
{
removeAllOptions(document.drop_list.q12);
addOption(document.drop_list.q12, "", "Select a store", "");
removeAllOptions(document.drop_list.q13);
addOption(document.drop_list.q13, "", "Select an appt. time", "");
removeAllOptions(document.drop_list.q15);
addOption(document.drop_list.q15, "", "Select a date", "");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Your browser does not support the XMLHttpRequest object.")
return
}
var url="getresults.asp?city=" + encodeURI(str)
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function showDates(str)
{
removeAllOptions(document.drop_list.q15);
addOption(document.drop_list.q15, "", "Select a date", "");
removeAllOptions(document.drop_list.q13);
addOption(document.drop_list.q13, "", "Select an appt. time", "");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Your browser does not support the XMLHttpRequest object.")
return
}
var url="getresults.asp?store=" + encodeURI(str)
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function showAppts(str, store)
{
removeAllOptions(document.drop_list.q13);
addOption(document.drop_list.q13, "", "Select an appt. time", "");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Your browser does not support the XMLHttpRequest object.")
return
}
var url="getresults.asp?date=" + encodeURI(str) + "&store=" + encodeURI(store)
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged()
{
  if (xmlHttp.readyState == 0)
  {} else if(xmlHttp.readyState == 1)
  {} else if(xmlHttp.readyState == 2)
  {} else if(xmlHttp.readyState == 3)
  {} else if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { eval(xmlHttp.responseText) }
}

function GetXmlHttpObject()
{
  var objXMLHttp=null
  
  try {
    objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); //later IE
  } catch (e) {
  try {
    objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); //earlier IE
  } catch (e) {
  objXMLHttp = null;
  }
  }
  
  if (objXMLHttp==null)
  {
    objXMLHttp=new XMLHttpRequest() //IE7, Firefox, Safari
  }
  return objXMLHttp
}