function get_category(type, nocnt)
{
    if (type) {
        var cat = $F('scat');
        var scat = 'sscat';
    } else {
        var cat = $F('cat');
        var scat = 'subcat';
    }
    var url = 'index.php';

    var pars = 
    {
        mode : 'get_subcat',
        cat : cat,
        type : type,
        nocount : nocnt
    };
    new Ajax.Request(url, {
        method:'post', 
        parameters: $H(pars).toQueryString(),
        onComplete: function(msg) {
            if (document.all) {
                $(scat).outerHTML = '<select name="' + scat + '" id="' + scat + '">'+msg.responseText+'</select>';
            } else {
                $(scat).innerHTML = msg.responseText;
            }
        }
    });
}
