function getSubCats(catid)
{
    if (document.getElementById('check'+catid).checked)
    {
        JsHttpRequest.query(
        '/ajax/getsubcats.php', // backend
        {
        'cat': catid
        },
        // Function is called when an answer arrives.
        function(result, errors) {
            // Write the answer.
            document.getElementById('cat'+catid).innerHTML = result['subcats'];
        },
        true  // do not disable caching
        );
    }
    else
    {
        document.getElementById('cat'+catid).innerHTML = '';
    }

};
