// TMC Dynamic Select Script...
// Set 1: Select Specialities
// modified by Dean Loh
// Modification started: Jan 04 2001
// Last modified:- Jan 16 2001

// For Specialities List Menu
ObstetricsGynaecology = new Array(28);
Paediatric = new Array(4);
BehaviouralMedicine = new Array(5);
MedicalHScreening = new Array(2);
Aesthetics = new Array(2);
Fertility = new Array(4);
ChineseMedicine = new Array(2);



// Doctor by Specialities
ObstetricsGynaecology[0] = new Array("-------------------","");
ObstetricsGynaecology[1] = new Array("Dr Cheng Wei Chen","Dr_Cheng_Wei_Chen");
ObstetricsGynaecology[2] = new Array("Dr Cheng Li Chang","Dr_Cheng_Li_Chang");
ObstetricsGynaecology[3] = new Array("Dr Tan Wee Khin","Dr_Tan_Wee_Khin");
ObstetricsGynaecology[4] = new Array("Dr Madeleine Tan","Dr_Madeleine_Tan");
ObstetricsGynaecology[5] = new Array("Dr Chang Tou Choong","Dr_Chang_Tou_Choong");
ObstetricsGynaecology[6] = new Array("Dr Paul Tseng","Dr_Paul_Tseng");
ObstetricsGynaecology[7] = new Array("Dr Phyllis Liauw","Dr_Phyllis_Liauw");
ObstetricsGynaecology[8] = new Array("Dr Eunice Chua","Dr_Eunice_Chua");
ObstetricsGynaecology[9] = new Array("Dr Adrian Tan Chek Jin","Dr_Adrian_Tan_Chek_Jin");
ObstetricsGynaecology[10] = new Array("Dr Caroline Khi Yu May","Dr_Caroline_Khi_Yu_May");
ObstetricsGynaecology[11] = new Array("Dr Joycelyn Wong Sook Miin","Dr_Joycelyn_Wong_Sook_Miin");
ObstetricsGynaecology[12] = new Array("Dr Sim Lee Ngor","Dr_Sim Lee_Ngor");
ObstetricsGynaecology[13] = new Array("Dr Kee Wei Heong","Dr_Kee_Wei_Heong");
ObstetricsGynaecology[14] = new Array("Dr Yvonne Soong","Dr_Yvonne_Soong");
ObstetricsGynaecology[15] = new Array("Dr Beh Suan Tiong","Dr_Beh_Suan_Tiong");
ObstetricsGynaecology[16] = new Array("Dr Yeo Ker Chiang","Dr_Yeo_Ker_Chiang");
ObstetricsGynaecology[17] = new Array("Dr Lim Ah Leng","Dr_Lim_Ah_Leng");
ObstetricsGynaecology[18] = new Array("Dr Noel Leong","Dr_Noel_Leong");
ObstetricsGynaecology[19] = new Array("Dr Lawrence Ang","Dr_Lawrence_Ang");
ObstetricsGynaecology[20] = new Array("Dr Adrian Woodworth","Dr_Adrian_Woodworth");
ObstetricsGynaecology[21] = new Array("Dr Woo Bit Hwa","Dr_Woo_Bit_Hwa");
ObstetricsGynaecology[22] = new Array("Dr Wong Mun Tat","Dr_Wong_Mun_Tat");
ObstetricsGynaecology[23] = new Array("Dr Geraldine Tan","Dr_Geraldine_Tan");
ObstetricsGynaecology[24] = new Array("Dr Adelina Wong","Dr_Adelina_Wong");
ObstetricsGynaecology[25] = new Array("Dr Judy Wong Pui Ling ","Dr Judy Wong Pui Ling ");
ObstetricsGynaecology[26] = new Array("Dr Michele Lee Sook Ling","Dr Michele Lee Sook Ling");
ObstetricsGynaecology[27] = new Array("Dr Jeanette Chen","Dr Jeanette Chen");
ObstetricsGynaecology[28] = new Array("Dr Yeap Min Li","Dr Yeap Min Li");
ObstetricsGynaecology[29] = new Array("Dr Benjamin Tham","Dr Benjamin Tham");

Paediatric[0] = new Array("-------------------","");
Paediatric[1] = new Array("Dr Ang Ai Tin","Dr_Ang_Ai_Tin");
Paediatric[2] = new Array("Dr Ang Poon Liat","Dr_Ang_Poon_Liat");
//Paediatric[3] = new Array("Dr Keoy Soo Shin","Dr_Keoy_Soo_Shin");
//Paediatric[4] = new Array("Dr Edmund Koh","Dr_Edmund_Koh");
//Paediatric[3] = new Array("Dr Tan Lay Tze","Dr_Tan_Lay_Tze");
//Paediatric[3] = new Array("Dr Ong Eng Keow","Dr_Ong_Eng_Keow");
//Paediatric[5] = new Array("Dr Sharon Lim","Dr_Sharon_Lim");
//Paediatric[6] = new Array("Dr Low Kar Tzay","Dr_Low_Kar_Tzay");


BehaviouralMedicine[0] = new Array("-------------------","");
BehaviouralMedicine[1] = new Array("Dr Ng Koon Hock","Dr_Ng_Koon_Hock");
BehaviouralMedicine[2] = new Array("Dr Clare Ong Kwee Hiong","Dr_Clare_Ong_Kwee_Hiong");
BehaviouralMedicine[3] = new Array("Ms Alice Wong Tak Ying","Ms_Alice_Wong_Tak_Ying");
BehaviouralMedicine[4] = new Array("Ms Sandra Siow","Ms_Sandra_Siow");

MedicalHScreening[0] = new Array("-------------------","");
MedicalHScreening[1] = new Array("Resident Doctor","Resident_Doctor");

Aesthetics[0] = new Array("-------------------","");
Aesthetics[1] = new Array("Dr Loo Han Woen","Dr_Loo_Han_Woen");

Fertility[0] = new Array("-------------------","");
Fertility[1] = new Array("Dr Cheng Li Chang","Dr_Cheng_Li_Chang");
Fertility[2] = new Array("Dr Michele Lee Sook Ling","Dr_Michele_Lee");
Fertility[3] = new Array("Dr Noel Leong","Dr_Noel_Leong");

ChineseMedicine[0] = new Array("-------------------","");
ChineseMedicine[1] = new Array("Resident Physician","Resident_Physician");
/*Fertility[3] = new Array("Dr Yeong Cheng Toh","Dr_Yeong_Cheng_Toh");

/*
PaediatricMedicine = new Array(0);
ObstetricsGynaecology = new Array(0);
MedicalHScreening = new Array(0);
PsychiatryMentalHealth = new Array(0);

// Doctor by Specialities
PaediatricMedicine[0] = new Array("-------------------","");
PaediatricMedicine[1] = new Array("Dr Ang Poon Liat","Dr_Ang_Poon_Liat");
PaediatricMedicine[2] = new Array("Dr Ang Ai Tin","Dr_Ang_Ai_Tin");
PaediatricMedicine[3] = new Array("Prof Wong Hock Boon","Prof_Wong_Hock_Boon");
PaediatricMedicine[4] = new Array("Dr Keoy Soo Shin","Dr_Keoy_Soo_Shin");

ObstetricsGynaecology[0] = new Array("-------------------","");
ObstetricsGynaecology[1] = new Array("Dr Phyllis Liauw","Dr_Phyllis_Liauw");
ObstetricsGynaecology[2] = new Array("Dr Paul Tseng","Dr_Paul_Tseng");
ObstetricsGynaecology[3] = new Array("Dr Eunice Chua","Dr_Eunice_Chua");
ObstetricsGynaecology[4] = new Array("Dr Kee Wei Heong","Dr_Kee_Wei_Heong");
ObstetricsGynaecology[5] = new Array("Dr Yvonne Chan","Dr_Yvonne_Chan"); by dean 28/3
ObstetricsGynaecology[5] = new Array("Dr Cheng Li Chang","Dr_Cheng_Li_Chang");
ObstetricsGynaecology[6] = new Array("Dr Chang Tou Choong","Dr_Chang_Tou_Choong");

MedicalHScreening[0] = new Array("-------------------","");
MedicalHScreening[1] = new Array("Resident Doctor","Resident_Doctor");

PsychiatryMentalHealth[0] = new Array("-------------------","");
PsychiatryMentalHealth[1] = new Array("Dr Ng Koon Hock","Dr_Ng_Koon_Hock");
*/


text_select_ObstetricsGynaecology="Please Select Doctor";
text_select_Paediatric="Please Select Doctor";
text_select_BehaviouralMedicine="Please Select Doctor";
text_select_MedicalHScreening="Please Select Doctor";
text_select_Aesthetics="Please Select Doctor";
text_select_Fertility="Please Select Doctor";
text_select_ChineseMedicine="Please Select Doctor";

function specialities(specialitiesType) {
pForm=document.TheForm;
clrdoctorType();
if (pForm.specialitiesType.selectedIndex<2)
{
	alert("Please Select specialities before you proceed")
	pForm.specialitiesType.selectedIndex=0
	clrdoctorType();
	clrtopic();
}
//else if (pForm.specialitiesType.selectedIndex=1){
else if (pForm.specialitiesType.options[pForm.specialitiesType.selectedIndex].value=="ObstetricsGynaecology"){

	pForm.doctorType.options[0].text=text_select_ObstetricsGynaecology;

	if (ObstetricsGynaecology.length > pForm.doctorType.length-2)
		temp_max=ObstetricsGynaecology.length
	else
		temp_max=pForm.doctorType.length-2
	
	for (i=0 ; i < temp_max ; i++)
	{

		if ( ( i+2<pForm.doctorType.length ) && ( i < ObstetricsGynaecology.length )  )
		{
			pForm.doctorType.options[i+1].value=ObstetricsGynaecology[i][1];
			pForm.doctorType.options[i+1].text=ObstetricsGynaecology[i][0];
		}
		else if ( ( i+2<pForm.doctorType.length ) && (i>=ObstetricsGynaecology.length) )
		{
			pForm.doctorType.options[i+1].value="";
			pForm.doctorType.options[i+1].text="";
		}
		else
		{
			pForm.doctorType.options[i+1] = new Option("", "", false, false)
			pForm.doctorType.options[i+1].value = ObstetricsGynaecology[i][1];
			pForm.doctorType.options[i+1].text = ObstetricsGynaecology[i][0];
		}



	}
	pForm.doctorType.selectedIndex=0;
	clrtopic();
 }
 
else if (pForm.specialitiesType.options[pForm.specialitiesType.selectedIndex].value=="Paediatric"){

	pForm.doctorType.options[0].text=text_select_Paediatric;

	if (Paediatric.length > pForm.doctorType.length-2) 
		temp_max=Paediatric.length;
	else
		temp_max=pForm.doctorType.length-2;
	
	for (i=0 ; i < temp_max ; i++)
	{

		if ( ( i+2<pForm.doctorType.length ) && ( i < Paediatric.length )  )
		{
			pForm.doctorType.options[i+1].value=Paediatric[i][1];
			pForm.doctorType.options[i+1].text=Paediatric[i][0];
		}
		else if ( ( i+2<pForm.doctorType.length ) && (i>=Paediatric.length) )
		{
			pForm.doctorType.options[i+1].value="";
			pForm.doctorType.options[i+1].text="";
		}
		else
		{
			pForm.doctorType.options[i+1] = new Option("", "", false, false)
			pForm.doctorType.options[i+1].value = Paediatric[i][1];
			pForm.doctorType.options[i+1].text = Paediatric[i][0];
		}



	}
	pForm.doctorType.selectedIndex=0;
	clrtopic();
 }
 
else if (pForm.specialitiesType.options[pForm.specialitiesType.selectedIndex].value=="BehaviouralMedicine"){

	pForm.doctorType.options[0].text=text_select_BehaviouralMedicine;

	if (BehaviouralMedicine.length > pForm.doctorType.length-2)
		temp_max=Paediatric.length
	else
		temp_max=pForm.doctorType.length-2
	
	for (i=0 ; i < temp_max ; i++)
	{

		if ( ( i+2<pForm.doctorType.length ) && ( i < BehaviouralMedicine.length )  )
		{
			pForm.doctorType.options[i+1].value=BehaviouralMedicine[i][1];
			pForm.doctorType.options[i+1].text=BehaviouralMedicine[i][0];
		}
		else if ( ( i+2<pForm.doctorType.length ) && (i>=BehaviouralMedicine.length) )
		{
			pForm.doctorType.options[i+1].value="";
			pForm.doctorType.options[i+1].text="";
		}
		else
		{
			pForm.doctorType.options[i+1] = new Option("", "", false, false)
			pForm.doctorType.options[i+1].value = BehaviouralMedicine[i][1];
			pForm.doctorType.options[i+1].text = BehaviouralMedicine[i][0];
		}



	}
	pForm.doctorType.selectedIndex=0;
	clrtopic();
 }
else if (pForm.specialitiesType.options[pForm.specialitiesType.selectedIndex].value=="MedicalHScreening"){

	pForm.doctorType.options[0].text=text_select_MedicalHScreening;

	if (MedicalHScreening.length > pForm.doctorType.length-2)
		temp_max=MedicalHScreening.length
	else
		temp_max=pForm.doctorType.length-2
	
	for (i=0 ; i < temp_max ; i++)
	{

		if ( ( i+2<pForm.doctorType.length ) && ( i < MedicalHScreening.length )  )
		{
			pForm.doctorType.options[i+1].value=MedicalHScreening[i][1];
			pForm.doctorType.options[i+1].text=MedicalHScreening[i][0];
		}
		else if ( ( i+2<pForm.doctorType.length ) && (i>=MedicalHScreening.length) )
		{
			pForm.doctorType.options[i+1].value="";
			pForm.doctorType.options[i+1].text="";
		}
		else
		{
			pForm.doctorType.options[i+1] = new Option("", "", false, false)
			pForm.doctorType.options[i+1].value = MedicalHScreening[i][1];
			pForm.doctorType.options[i+1].text = MedicalHScreening[i][0];
		}



	}
	pForm.doctorType.selectedIndex=0;
	clrtopic();
 }
else if (pForm.specialitiesType.options[pForm.specialitiesType.selectedIndex].value=="Aesthetics"){

	pForm.doctorType.options[0].text=text_select_Aesthetics;

	if (Aesthetics.length > pForm.doctorType.length-2)
		temp_max=Aesthetics.length
	else
		temp_max=pForm.doctorType.length-2
	
	for (i=0 ; i < temp_max ; i++)
	{

		if ( ( i+2<pForm.doctorType.length ) && ( i < Aesthetics.length )  )
		{
			pForm.doctorType.options[i+1].value=Aesthetics[i][1];
			pForm.doctorType.options[i+1].text=Aesthetics[i][0];
		}
		else if ( ( i+2<pForm.doctorType.length ) && (i>=Aesthetics.length) )
		{
			pForm.doctorType.options[i+1].value="";
			pForm.doctorType.options[i+1].text="";
		}
		else
		{
			pForm.doctorType.options[i+1] = new Option("", "", false, false)
			pForm.doctorType.options[i+1].value = Aesthetics[i][1];
			pForm.doctorType.options[i+1].text = Aesthetics[i][0];
		}



	}
	pForm.doctorType.selectedIndex=0;
	clrtopic();
 }
  else if (pForm.specialitiesType.options[pForm.specialitiesType.selectedIndex].value=="Fertility"){
 
 	pForm.doctorType.options[0].text=text_select_Fertility;
 
 	if (Fertility.length > pForm.doctorType.length-2)
 		temp_max=Fertility.length
 	else
 		temp_max=pForm.doctorType.length-2
 	
 	for (i=0 ; i < temp_max ; i++)
 	{
 
 		if ( ( i+2<pForm.doctorType.length ) && ( i < Fertility.length )  )
 		{
 			pForm.doctorType.options[i+1].value=Fertility[i][1];
 			pForm.doctorType.options[i+1].text=Fertility[i][0];
 		}
 		else if ( ( i+2<pForm.doctorType.length ) && (i>=CosmeticSurgery.length) )
 		{
 			pForm.doctorType.options[i+1].value="";
 			pForm.doctorType.options[i+1].text="";
 		}
 		else
 		{
 			pForm.doctorType.options[i+1] = new Option("", "", false, false)
 			pForm.doctorType.options[i+1].value = Fertility[i][1];
 			pForm.doctorType.options[i+1].text = Fertility[i][0];
 		}
 
 
 
 	}
 	pForm.doctorType.selectedIndex=0;
 	clrtopic();
  }
else if (pForm.specialitiesType.options[pForm.specialitiesType.selectedIndex].value=="ChineseMedicine"){

	pForm.doctorType.options[0].text=text_select_ChineseMedicine;
	
	if (ChineseMedicine.length > pForm.doctorType.length-2)
		temp_max=ChineseMedicine.length
	else
		temp_max=pForm.doctorType.length-2
	
	for (i=0 ; i < temp_max ; i++)
	{
	
		if ( ( i+2<pForm.doctorType.length ) && ( i < ChineseMedicine.length )  )
		{
			pForm.doctorType.options[i+1].value=ChineseMedicine[i][1];
			pForm.doctorType.options[i+1].text=ChineseMedicine[i][0];
		}
		else if ( ( i+2<pForm.doctorType.length ) && (i>=ChineseMedicine.length) )
		{
			pForm.doctorType.options[i+1].value="";
			pForm.doctorType.options[i+1].text="";
		}
		else
		{
			pForm.doctorType.options[i+1] = new Option("", "", false, false)
			pForm.doctorType.options[i+1].value = ChineseMedicine[i][1];
			pForm.doctorType.options[i+1].text = ChineseMedicine[i][0];
		}
	
	
	
	}
	pForm.doctorType.selectedIndex=0;
	clrtopic();
 }

}

function combotopic()
{
	pForm=document.specialitiesType;
	if (pForm.topic.selectedIndex<2 || pForm.topic.options[pForm.topic.selectedIndex].value=="")
	{
		pForm.topic.selectedIndex=0;
	}
}


	// convert all characters to lowercase to simplify testing 
    var agt=navigator.userAgent.toLowerCase(); 

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection. 
    // If you want to allow spoofing, take out the tests for opera and webtv. 
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
                && (agt.indexOf('webtv')==-1)); 



function clrdoctorType()
{
	pform=document.TheForm;
	pform.doctorType.options[0].text="[--------------]";

	for (i=0 ; i<pform.doctorType.length-2 ;i++)
	{
		pform.doctorType.options[i+2].text="";
		pform.doctorType.options[i+2].value="";
		pform.doctorType.selectedIndex=0;
	}
}
function clrtopic()
{
	pform=document.TheForm;
}