function add_to_onload(func) 
{
    var r=window.addEventListener?window:document.addEventListener?document:null;
    if(r)
    {
        r.addEventListener("load", func, false);
    }
    else if(window.attachEvent)
    {
        window.attachEvent("onload", func);
    }
}

function ge(d)
{
    if (document.getElementById)
    {
        // this is the way the standards work
        return document.getElementById(d);
    }
    else if (document.all)
    {
        // this is the way old msie versions work
        return document.all[d];
    }
    else if (document.layers)
    {
        // this is the way nn4 works
        return document.layers[d];
    }
    return null;
}


function show_hide(d,hide)
{
    var e = ge(d);
    if(e)
    {
        if(hide)
        {
            e.style.display = 'none';
        }
        else
        {
            e.style.display = '';
        }
    }
/*
    else
    {
        alert('Cant get ' + d);
    }
*/
}

function goToPage(page) 
{
    document.bigform.page.value=page;
    
    var prev = document.bigform.preview;
    if(prev)
        document.bigform.preview.value=0;
    
    document.bigform.target = "_top";
    document.bigform.submit();
}

// focus on a field... like when there's an error in the text entered
function doSelection(fld)
{
    fld.focus();
    fld.select();
}

