
function fillCategory(){ 
 // this function is used to fill the clinic list on load
addOption(document.frm1.clinic, "Broadway", "Broadway", "");
addOption(document.frm1.clinic, "Mainstreet", "Mainstreet", "");
addOption(document.frm1.clinic, "Westbrook", "Westbrook", "");
}
function Selectphysician(){
// ON selection of clinic this function will work
removeAllOptions(document.frm1.physician);
addOption(document.frm1.physician, "", "physician", "");
if(document.frm1.clinic.value == 'Broadway'){
addOption(document.frm1.physician,"Any Physician", "Any Physician");
addOption(document.frm1.physician,"Any Pediatrician", "Any Pediatrician");
addOption(document.frm1.physician,"Any Female Physician", "Any Female Physician");
addOption(document.frm1.physician,"Any Male Physician", "Any Male Physician");
addOption(document.frm1.physician,"AAA", "AAA");
addOption(document.frm1.physician,"AAA", "AAA");
addOption(document.frm1.physician,"AAA", "AAA");
}
if(document.frm1.clinic.value == 'Mainstreet'){
addOption(document.frm1.physician,"Any Physician", "Any Physician");
addOption(document.frm1.physician,"Any Pediatrician", "Any Pediatrician");
addOption(document.frm1.physician,"Any Female Physician", "Any Female Physician");
addOption(document.frm1.physician,"Any Male Physician", "Any Male Physician");
addOption(document.frm1.physician,"BBB", "BBB");
addOption(document.frm1.physician,"BBB", "BBB");
addOption(document.frm1.physician,"BBB", "BBB", "");
}
if(document.frm1.clinic.value == 'Westbrook'){
addOption(document.frm1.physician,"Any Physician", "Any Physician");
addOption(document.frm1.physician,"Any Pediatrician", "Any Pediatrician");
addOption(document.frm1.physician,"Any Female Physician", "Any Female Physician");
addOption(document.frm1.physician,"Any Male Physician", "Any Male Physician"); 
addOption(document.frm1.physician,"CCC", "CCC");
addOption(document.frm1.physician,"CCC", "CCC");
addOption(document.frm1.physician,"CCC", "CCC");
}

}
////////////////// 

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}
