function getSubCategory(obj, extraOption)
{
    var selectedId = obj.options[obj.options.selectedIndex].value;
    new Ajax.Request('/ajax_server.php?action=getSubcategories&parentId=' + selectedId,
    {
        method:'get',
        onSuccess: function(transport){
            var response = transport.responseText || "no response text";
            $A($('subCatSelect').options).each(function(el) {
				el.parentNode.removeChild(el);
			});
            if (response.length < 3) { /* empty */
                var option = document.createElement('option');
                    option.value = '';
                    option.appendChild(document.createTextNode('Er zijn geen subrubrieken gevonden'));
                $('subCatSelect').appendChild(option);
            } else {
                var responseObj = eval('(' + response + ')');
                if(extraOption) {
					var option = document.createElement('option');
                        option.value = '';
                        option.appendChild(document.createTextNode(''));
                    $('subCatSelect').appendChild(option);
				}
                responseObj.each(function(element) {
                     var option = document.createElement('option');
                        option.value = element.id;
                        option.appendChild(document.createTextNode(element.name));
                    $('subCatSelect').appendChild(option);
                });
            }
        },
        onFailure: function(){ }
      });
}