function textCounter(field, countfield, maxlimit)
{
    if (field.value.length > maxlimit) 
        field.value = field.value.substring(0, maxlimit);
    else 
        countfield.value = maxlimit - field.value.length;
} 

function faq(mypage, myname, w, h, scroll) 
{
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'

    win = window.open(mypage, myname, winprops)

    if (parseInt(navigator.appVersion) >= 4)
        win.window.focus();
}

function checkAllBoxes() 
{
    var t = document.form.elements.length;

    
        for (var i = 0; i < t; i++)
        {
            var thing = document.form.elements[i];

            if (thing.type == "checkbox")
            {
                thing.checked = true;
            }
        }

    
}

function unCheckAllBoxes()
{
    var t = document.form.elements.length;

    for (var i = 0; i < t; i++)
    {
        var thing = document.form.elements[i];

        if ((thing.type == "checkbox")  && (thing.checked == true))
        {
            thing.checked = false;
        }
    }
}

function doselectAll()
{
    document.form.selectall.value = 'true';
    document.form.submit();
}

function jumpTo (selectedTool) 
{
    if (selectedTool != null)
    {
        document.form.jumpto.value = selectedTool;
        document.form.submit();
    }
}

function addPrivacyBatch() 
{ 
    document.form.addPrivacyBatch.value = 'true';
    document.form.submit(); 
}

function setPageSize (setPageSizeInt) 
{
    if (setPageSizeInt > 0)
    {
        document.form.pageSize.value = setPageSizeInt;
        document.form.submit();
    }
}

function deselect(formName, id)
{
    document.formName.ds.value = id;
    document.formName.submit();
}

function xSelect(formName, id)
{
    document.formName.sel.value = id;
    document.formName.submit();
}