function bindSubType() {
	//disable child select list
	$("#type_id").attr("disabled", true);
	//clear child select list's options
	$("#type_id").html('');
 
	//querystring value is selected value of parent drop down list
	var qs = $("#class_id").val();
	//if user selected a separator, show error
	if(qs == '') {
		alert('You cannot select this option. Please make a different selection.');
	}
	else {
		//show message indicating we're getting new values
		$("#type_id").append(new Option('Getting SubType list ...'));
		//declare options array and populate
		var typeOptions = new Array();
		$.get("subtypejquery.php?class_id=" + qs, function(data) {
				eval(data);
				if(typeOptions.length > 0) {
					addOptions(typeOptions);
				}
			}
		);
	}
}

function addOptions(tl) {
	//enable child select and clear current child options
	$("#type_id").removeAttr("disabled");
	$("#type_id").html('');
	//repopulate child list with array from helper page
	var type_id = document.getElementById('type_id');
	for(var i = 0; i < tl.length; i++) {
		type_id.options[i] = new Option(tl[i].text, tl[i].value);
	}
}
