
function fillCategory(){ 
 // this function is used to fill the survey list on load
addOption(document.myform.survey, "By Mail", "By Mail", "");
addOption(document.myform.survey, "Web Search", "Web Search", "");
addOption(document.myform.survey, "Other", "Other", "");
}

function SelectSubCat(){
// ON selection of survey this function will work

removeAllOptions(document.myform.response);
addOption(document.myform.response, "", "Please Select Option", "");

if(document.myform.survey.value == 'By Mail'){
addOption(document.myform.response,"Not Applicable", "Not Applicable");
//addOption(document.myform.response,"Banana", "Banana");
//addOption(document.myform.response,"Orange", "Orange");
}
if(document.myform.survey.value == 'Web Search'){
addOption(document.myform.response,"Google", "Google");
addOption(document.myform.response,"Yahoo", "Yahoo");
addOption(document.myform.response,"MSN", "MSN");
addOption(document.myform.response,"Ask.com", "Ask.com");
addOption(document.myform.response,"Other", "Other");
}
if(document.myform.survey.value == 'Other'){
addOption(document.myform.response,"Not Applicable", "Not Applicable");
//addOption(document.myform.response,"ASP", "ASP");
//addOption(document.myform.response,"Perl", "Perl");
}

}
////////////////// 

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);
}
