// JavaScript Document
var xmlHttp

function stateChangeddoc() 
{ 
if (xmlHttp.readyState==4)
{ 
	//document.getElementById("errormsg_email").innerHTML=xmlHttp.responseText;

	document.getElementById("doctornames").innerHTML=xmlHttp.responseText;
	
}
}
function stateChangedname() 
{ 
if (xmlHttp.readyState==4)
{ 
	//document.getElementById("errormsg_email").innerHTML=xmlHttp.responseText;

	document.getElementById("days_available").innerHTML=xmlHttp.responseText;
	if(xmlHttp.responseText=="Select Doctors"){
		//document.getElementById("timeDiv").style.display="none";
	document.getElementById("dateDiv").style.display="none";
			
		}
		else
		{
			document.getElementById("dateDiv").style.display="block";
			}
		
	
}
}
function stateChangedtime() 
{ 
if (xmlHttp.readyState==4)
{ 
	//document.getElementById("errormsg_email").innerHTML=xmlHttp.responseText;

	///document.getElementById("timeav").value=xmlHttp.responseText;
	document.getElementById("timeav").innerHTML=xmlHttp.responseText;
	//alert(innerHTML=xmlHttp.responseText;);
	//splitstr1(xmlHttp.responseText);
	//AddItem1(xmlHttp.responseText);
	//AddItemA(xmlHttp.responseText);
	
}
}
function stateChangedtime1() 
{ 
if (xmlHttp.readyState==4)
{ 
	//document.getElementById("errormsg_email").innerHTML=xmlHttp.responseText;

	document.getElementById("timeav1").innerHTML=xmlHttp.responseText;
	//splitstr2(xmlHttp.responseText);
	//AddItem2(xmlHttp.responseText);
    //AddItemB(xmlHttp.responseText);
	//alert("t");
	
}
}
function stateChangedtime2() 
{ 
if (xmlHttp.readyState==4)
{ 
	//document.getElementById("errormsg_email").innerHTML=xmlHttp.responseText;

	document.getElementById("timeav2").innerHTML=xmlHttp.responseText;
	//splitstr3(xmlHttp.responseText);
	//AddItem3(xmlHttp.responseText);
	//AddItemC(xmlHttp.responseText);
	//alert("t");
	
}
}

function showDoctors(str)
{

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="location.php";

url=url+"?location="+str;

xmlHttp.onreadystatechange=stateChangeddoc;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function showTime(str,str1,id)
{

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="time.php";

url=url+"?dayname="+str;

url=url+"&docname="+str1;

url=url+"&id="+id;
//timeav
xmlHttp.onreadystatechange=stateChangedtime;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function showTime1(str,str1,id)
{

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="time.php";

url=url+"?dayname="+str;

url=url+"&docname="+str1;

url=url+"&id="+id;
//timeav
xmlHttp.onreadystatechange=stateChangedtime1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function showTime2(str,str1,id)
{

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="time.php";

url=url+"?dayname="+str;

url=url+"&docname="+str1;

url=url+"&id="+id;
//timeav
xmlHttp.onreadystatechange=stateChangedtime2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function showDays(str)
{

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="dname.php";

url=url+"?dname="+str;

xmlHttp.onreadystatechange=stateChangedname;
xmlHttp.open("GET",url,true);
xmlHttp.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;
}

