﻿// JScript File
//finds the first enabled form control and sets client-side focus
function AutoFocus()
{
    var fieldFound = false;

    try
    {
        for(x=0; x<document.forms.length; x++)
        {
            for(y=0; y<document.forms[x].length; y++)
            {   
                if(document.forms[x][y].type != "hidden")
                {
                    if(document.forms[x][y].disabled != true)
                    {
                        if(!String(document.forms[x][y].id).search("Search") == "-1")
                        {
                            
                            document.forms[x][y].focus();
                            fieldFound = true;
                        }
                        
                        alert(document.forms[x][y].id);
                    }
                }
                
                if(fieldFound)
                {
                    break;
                }
            }
            
            if(fieldFound)
            {
                break;
            }
        }
    }
    catch(e)
    {
    }//do nothing
} 

 function ShowCopyrightBox(docName)
{
    var scareMessage = "Warning: Only the person to whom this subscription belongs is authorized to view its content. It is a violation of copyright law to provide this information to anyone but the subscription holder. To agree to these terms, click the 'OK' button.";
    var newWin;
    var doc = "http://www.21stcenturyedge.com/admin/uploads/" + docName;        
    
    if(confirm(scareMessage))
    {
        newWin = window.open(doc);
    }
}


