//
// These functions are still in use...
//
function SelectAll(arg_form, arg_element)
{
    for(var f=0; f < document.forms.length; f++)
    {
        if(document.forms[f].name == arg_form)
        {
        	for (var i=0; i < document.forms[f].elements.length; i++)
            {
        	    var e = document.forms[f].elements[i];
                if (e.name == arg_element) { e.checked = true; }
        	}
        }
	}
}

function DeselectAll(arg_form, arg_element)
{
    for(var f=0; f < document.forms.length; f++)
    {
        if(document.forms[f].name == arg_form)
        {
        	for (var i=0; i < document.forms[f].elements.length; i++)
            {
        	    var e = document.forms[f].elements[i];
                if (e.name == arg_element) { e.checked = false; }
        	}
        }
	}
}

function SetFocus(arg_focus) { document.getElementById(arg_focus).focus(); }

function ViewImage(arg_document, arg_image)
{
    // Pop up another window
    window.open(arg_image, arg_document, 'scrollbars=yes,resizable=yes,width=800,height=600');
}

function ShowHelp(arg_url, arg_title)
{
	ajax_loadContent('help',arg_url,arg_title);
}

//
// These functions are deprecated, or will be soon.
//
function ChangeTab(tab_name)
{
    document.criteria.tab.value = tab_name;
    document.criteria.submit();
}

function PrintStatement(arg_parcel, arg_statement_url)
{
    // Pop up another window
//    lw_parcel = window.open(arg_statement_url, arg_parcel, 'scrollbars=yes,resizable=yes,width=800,height=600');
    lw_parcel = window.open(arg_statement_url, "Printing", 'scrollbars=yes,resizable=yes,width=800,height=600');
    // Print the contents of the new window
    lw_parcel.print();
}

function OpenHelp(arg_url)
{
    lw_help = window.open(arg_url, "thewindow", "width=500,height=500,left=100,top=100,status=no,toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no,resizable=no");
    lw_help.focus();
}

function ChangeTaxSale(arg_sale_id)
{
    document.criteria.sale_id.value = arg_sale_id;
    document.criteria.tab.value = "Redemption";
    document.criteria.submit();
}

function highlight(row,newclass) {
    row.className = newclass;
}
