<!-- TOPIC FAA Common -->
var szFaaWarningMsg = "You are about to exit FAA Access to CPS Online. Are you sure you want to exit?"

function ExitFaa()
{
   FAAExit(false);
}

function Menu()
{
    document.FAFSA.dowhat.value = "menu"
    document.FAFSA.submit()
}

function Display()
{
    document.FAFSA.dowhat.value = "display"
    document.FAFSA.submit()
}

function DisplayBatchList()
{
    document.FAFSA.dowhat.value = "viewbatchlist"
    document.FAFSA.submit()
}

function DisplayBatch()
{
    document.FAFSA.dowhat.value = "displaybatch"
    document.FAFSA.submit()
}

function NewSearch()
{
    document.FAFSA.dowhat.value = "newsearch"
    document.FAFSA.submit()
}

function NextBatch()
{
    document.FAFSA.dowhat.value = "nextbatch"
    document.FAFSA.submit()
}

function PrevBatch()
{
    document.FAFSA.dowhat.value = "prevbatch"
    document.FAFSA.submit()
}

function Delete()
{
    document.FAFSA.dowhat.value = "delete"
    document.FAFSA.submit()
}

function EnterMore()
{
    document.FAFSA.dowhat.value = "entermore"
    document.FAFSA.submit()
}

function setFocus(fieldName, error)
{
    if(fieldName)
    {
        var fieldType = fieldName.type;
        fieldName.focus();

		if (fieldType.indexOf("select") < 0) 
		{
			szField.select();
		}
    }
    else
    {
        with(document.FAFSA) 
        {
            for(var i = 0; i < length; i++) 
            {
                if(elements[i].type == "text"       || 
                    elements[i].type == "textarea"  ||
                    elements[i].type == "password"  || 
                    elements[i].type == "checkbox"  || 
                    elements[i].type == "file") 
                {
                    elements[i].focus();
                    elements[i].select();
                    break;
                } 
                else if(elements[i].type.indexOf("select") >= 0) 
                {
                    elements[i].focus();
                    break;
                }
            }
        }
    }
}

// Open FAA Access customer service help page
function FaaCustServ()
{
    window.open('/fotw0910/help/facs.htm', 'CustomerService', 'scrollbars=yes,width=400,height=375')
}

// Open a frequently asked question file
function FaaFaq(szFaq)
{
    if (szFaq)
    {
        szFile = szFaq          // open with the given file
    }
    else
    {
        szFile = "faafaq00.htm"   // by default, open the FAA table of contents
    }
    Faq(szFile)                 // call FAFSA Faq() method to open file
}
// Redirect to a FAA servlet with or without appending "expert"
function RedirectFAA(szFaaURL)
{
	var szURL = document.URL;
	if (document.URL.indexOf("/expert") >= 0) {
		szFaaURL = szFaaURL + "/expert";
	} 

	location.href = szFaaURL;
}
