
function fillCategory(){ 
 // this function is used to fill the category list on load

	addOption(document.form1.course, "Not Specified", "Click to Select", "");
	addOption(document.form1.course, "TF40 Level I Familiarization", "TF40 Level I Familiarization", "");
	addOption(document.form1.course, "VPS4 Maintenance", "VPS4 Maintenance", "");
	addOption(document.form1.course, "TF40 Level I Maintenance", "TF40 Level I Maintenance", "");
	addOption(document.form1.course, "ETF40B Level IV Maintenance", "ETF40B Level IV Maintenance", "");
	addOption(document.form1.course, "ETF40B Level VI Maintenance", "ETF40B Level VI Maintenance", "");
	addOption(document.form1.course, "TF50 Level I Maintenance", "TF50 Level I Maintenance", "");

}

function SelectSubCat(){
	// ON selection of category this function will work
	
	removeAllOptions(document.form1.dates);
	
	if(document.form1.course.value == 'TF40 Level I Familiarization'){
		addOption(document.form1.dates,"July 7, 2009 - July 9, 2009", "July 7, 2009 - July 9, 2009");
	}

	if(document.form1.course.value == 'VPS4 Maintenance'){
		addOption(document.form1.dates,"August 17, 2009 - August 21, 2009", "August 17, 2009 - August 21, 2009");
	}

	if(document.form1.course.value == 'TF40 Level I Maintenance'){
		addOption(document.form1.dates,"October 12, 2009 - October 16, 2009", "October 12, 2009 - October 16, 2009");
	}

	if(document.form1.course.value == 'ETF40B Level IV Maintenance'){
		addOption(document.form1.dates,"November 2, 2009 - November 6, 2009", "November 2, 2009 - November 6, 2009");
	}
	
	if(document.form1.course.value == 'ETF40B Level VI Maintenance'){
		addOption(document.form1.dates,"November 9, 2009 - November 13, 2009", "November 9, 2009 - November 13, 2009");
	
	}
	
	if(document.form1.course.value == 'TF50 Level I Maintenance'){
		addOption(document.form1.dates,"December 7, 2009 - December 11, 2009", "December 7, 2009 - December 11, 2009");	
	}

}
////////////////// 

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);
}
