function makeItem(name, url)
{
    this.name = name;
    this.url = url;
}

function newItem(name, url)
{
    itemsIndex++;
    cats[catsIndex][itemsIndex] = new makeItem(name, url);
    cats[catsIndex].length++;
}

function makeCat(name)
{
    this.name = name;
    this.length = 0;
}

function newCat(name)
{
    catsIndex++;
    itemsIndex = -1;
    cats[catsIndex] = new makeCat(name);
}

function relateItems(cat)
{
    itemsIndex = 0;
    catsIndex = cat-1;
    with (document.quickfind.qf_item)
    {
        for (var i = options.length; i>0; i--)
            options[i] = null;
        if (cat == 0) return;
        for (var i = 0; i<cats[catsIndex].length; i++)
            {options[i+1] = new Option(cats[catsIndex][i].name);}
        options[0].selected = true;
    }

}

function gotoPage(item)
{
    var url = null;
    if (item > 0) url = cats[catsIndex][item - 1].url;
    if (url != null) window.location.href = url;
}

function addCategories()
{
    for (var i=0; i < cats.length; i++)
        document.write('<option>' + cats[i].name + '</option>');
}

function addItems()
{
    if (isNS3)
    {
        for (var i = 0; i < 10; i++)
            document.write('<option></option>');
    }
}
function init()
{
    if (isNS3)
    {
        for (var i = document.quickfind.qf_items.options.length; i > 0; i--)
            document.quickfind.qf_items.options[i] = null;
    }

    relateItems(document.quickfind.qf_category.selectedIndex);
}


var cats = new Array();
var catsIndex = -1;
var itemsIndex = -1;

var version = parseInt(navigator.appVersion);
var isNS3 = (navigator.appName == "Netscape" && version >= 3 && version < 5);

