
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "Fruits", "Fruits", "");
addOption(document.drop_list.Category, "Games", "Games", "");
addOption(document.drop_list.Category, "Scripts", "Scripts", "");
}
//speciality
function filldoctor(){
// ON selection of category this function will work

removeAllOptions(document.getElementById("doctor"));
addOption(document.getElementById("doctor"), "", "Doctor name", "");
all_value2=document.form1.all_value.value.split("<<++>>")
//document.write(all_value2 + "<br />")
for (i = 0; i <= all_value2.length; i++)
{
speciality_id=all_value2[i].split("=|=")
if(document.form1.speciality.value == speciality_id[0]){
speciality_doctors=speciality_id[1].split("+||+")
	for (i1 = 0; i1 <= speciality_doctors.length; i1++)
	{
		speciality_doctorid_name=speciality_doctors[i1].split("=<>=")
		addOption(document.getElementById("doctor"),speciality_doctorid_name[0], speciality_doctorid_name[1]+" "+speciality_doctorid_name[2]);	
	}
}

/*document.write(speciality_id[0]+"<br />")
document.write("<br />")
document.write(i+"aaa<br />")
//document.write("The number is " + all_value2[i])*/

}
}
////////////////// 

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);
}

