function processSubmitActionForm(formid, formaction)
{    
    var theform = document.getElementById(formid);
    theform.formaction.value = formaction;
    theform.submit();
}

function processSubmitForm(formid)
{
    var theform = document.getElementById(formid);
    theform.submit();
}

var needsSaving = false;

function updateNeedsSaving(divid)
{
    var saveDivElement = document.getElementById(divid);
    saveDivElement.style.visibility = "visible";
}

function updateNeedsSaving(divid, elementid)
{
    var saveDivElement = document.getElementById(divid);
    saveDivElement.style.visibility = "visible";

//    IE hack.  IE can't differentiate between the 2 updateNeedsSaving methods
    if(elementid != undefined)
    {
        var needsSaving = document.getElementById(elementid);
        needsSaving.value = 'true';
    }

    needsSaving = true;
}

function processSubmitSortForm(formid, sortaction, direction)
{
    var theform = document.getElementById(formid);
    if(direction == null)
    {
        theform.sortdirection.value = "asc";
    }
   else
   {
       if(direction == "asc")
       {
           theform.sortdirection.value = "desc";
       }
       else
       {
           theform.sortdirection.value = "asc";
       }
   }
   theform.formaction.value = 'sort';
   theform.sortattribute.value = sortaction;
   theform.submit();
}