$(document).ready(function(){		
	
	$('#select-testtype').live('change', function() {
		if($(this).val().length != 0) {
			testtype = $(this).val();
			$.getJSON('/fees/get_services_ajax',{idtest:testtype}, function(services) {
				if(services !== null) {
				  populateTestTServicesList(services);
				}
			});		
      }
    });
});

function populateTestTServicesList(services) {
	var options = '';
		options += '<option value="">..... Select one .....</option>'
	 
		$.each(services, function(index, service) {
			options += '<option value="' + index + '">' + service + '</option>';
		});
		
	$('#select-service').html(options);
}