function growUp() 
{
    try
    {
        if (self.location.href != top.window.location.href)
        {
            top.window.location.href = self.location.href; 
        }
    }
    catch(e)
    {
    }
}

function setFocus() 
{
    if (document.getElementById("TxtLogin") != null && !document.getElementById("TxtLogin").disabled) 
    { 
        document.getElementById("TxtLogin").focus();
    } 
}

function getInternetExplorerVersion()
{
    var rv = -1; // Return value assumes failure.

    if (navigator.appName == 'Microsoft Internet Explorer')
    {
        var ua = navigator.userAgent; 
        var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
        rv = parseFloat( RegExp.$1 );
    }
    return rv;
}

function checkVersion()
{
    var msg = "";
    var ver = getInternetExplorerVersion();

    if ( ver > -1 )
    {
        if ( ver == 6.0 || ver == 5.5 ) {
            msg = "Você está utilizando o navegador Microsoft Internet Explorer versão 6.\nÉ necessário utilizar a versão 7.0 para acessar o sistema."
            //document.getElementById("BtnLogin").disabled = "disabled";
            //alert(msg);
        }
    }
}

function iPhoneScroll() 
{
    addEventListener("load", function() 
                                    { 
                                        setTimeout(function () 
                                                    { 
                                                        if (window.innerHeight < 300) 
                                                        { 
                                                            window.scrollTo(0,1); 
                                                        } 
                                                    }, 0); 
                                    }, false);
    
}

function loginLoad() 
{
    if (navigator.userAgent.toLowerCase().search("iphone") != -1) 
    {
        //iPhoneScroll();
    } else {
        checkVersion();
        setFocus();
    }
    return;
}
