function createRequestObject()
{	
	var request_o; 
	var browser = navigator.appName; 
	if(browser == "Microsoft Internet Explorer")
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	else		
		request_o = new XMLHttpRequest();	
	return request_o; 
	
}
/******************** BEGIN : EXAMPLE Dont Edit ******************************************

/******************** END : EXAMPLE Dont Edit ******************************************/
var http = createRequestObject(); 
//************************ BEGIN : StateOptions *********************************
function getDoctor(depId,site)//verify function name used in onchange event of select tag
{	
 var rand_no = Math.random();

	http.open('get',site+'/php/ajaxCommon.php?action=getDoctor&depId='+depId+"&str="+rand_no);
	http.onreadystatechange = handleGetDoctor;// it is function name,defined below 
	http.send(null);
}
function handleGetDoctor()
{	
	if(http.readyState == 4)
	{	
		var response = http.responseText;	
		document.getElementById('doctor').innerHTML = response;//verify div tag id
		
	}
}

function getfaq(link_id,divid)//verify function name used in onchange event of select tag
{	

	id="letter_id_"+divid;
	
	if(document.getElementById(id).style.display=='block')
			document.getElementById(id).style.display='none';
	else
	document.getElementById(id).style.display='block';
			
	http.open('get','ajaxCommon.php?action=show_faq&faq_id='+link_id+'&divid='+divid);//verify form name & field name
	http.onreadystatechange = handlegetshowfaq;// it is function name,defined below 
	http.send(null);
}

function handlegetshowfaq()
{	
	if(http.readyState == 4)
	{	var response = http.responseText;	
	
	
		str=response.split('|||');
		divid1="letter_id_"+parseInt(str[1]);
		
		
		
		//document.getElementById("letter_id_0").innerHTML = str[0];//verify div tag id
		document.getElementById(divid1).innerHTML = str[0];//verify div tag id
	}
}

function  searchDoctor()
{
	
dept	=	document.form1.department_id.value;

doctor1	=	document.form1.medical_team_id.value;

//alert(doctor1);


if(dept=="" && doctor1=="" )
{
alert("Please select any search criteria");
document.form1.department_id.focus();

}
else
document.location.href="php/list_medicalteam.php?team_id="+doctor1+"&dept_id="+dept+"&linkid=3&type=M";
}

function  searchDoctorinner()
{
hospital_id	=	document.form1.hospital_id.value;
department_id	=	document.form1.department_id.value;

doctor_name	=	document.form1.doctor_name.value;

//alert(doctor_name);

if(hospital_id=="" && department_id=="" && doctor_name=="Name of Doctor" )
{
alert("Please select any search criteria");
document.form1.hospital_id.focus();

}
else{
document.location.href="php/list_medicalteam.php?hid="+hospital_id+"&did="+department_id+"&doctor_name="+doctor_name+"&linkid=3&type=M";
//document.form1.submit;
//
}}
function loadSubDoctorDepart(hospital_id,site)
{
	
	http.open('get', site+'/php/ajaxCommon.php?action=getSubDoctorDepartment&hospital_id='+hospital_id+'&sid='+Math.random()+'');
	http.onreadystatechange = handleSubDoctotorDeptResult;
	http.send(null);
		
}
function handleSubDoctotorDeptResult()
{
	if(http.readyState == 4)
	{
		var response = http.responseText;
		//alert(response);				
		//document.getElementById('doctordeptDiv').innerHTML = response;
		
	}
}
function loadDoctorDep(department_id)
{	
	hospital_id=document.form1.hospital_id.value;
	http.open('get', 'http://suthospital.com/php/ajaxCommon.php?action=getDoctorDepartment&hospital_id='+hospital_id+'&department_id='+department_id+'&sid='+Math.random()+'');
	http.onreadystatechange = handleDoctorResult;
	http.send(null);
		
}
function handleDoctorResult()
{
	if(http.readyState == 4)
	{
		var response = http.responseText;			
		document.getElementById('doctorFindDiv').innerHTML = response;
		
	}
}






