﻿// JScript File
// Resets Navigation Height to full 100%;
function resetHgt()
{
   H = document.body.scrollHeight - 190;
   document.getElementById('Navigation').style.height=H+'px';
}

function modalClose(id){

     $find(id).hide();

}

function changeUnPwData(unSet)
{
    if ( unSet == 1 )
    {
        document.getElementById('txtUsername').value = document.getElementById('txtUsername1').value;
        document.getElementById('txtPassword').value = document.getElementById('txtPassword1').value;
    }
    else if ( unSet == 2 )
    {
        document.getElementById('txtUsername').value = document.getElementById('txtUsername2').value;
        document.getElementById('txtPassword').value = document.getElementById('txtPassword2').value;
    }
}

function postTo(url)
{
    /// Login from outer master page
    if ( document.getElementById('form1'))
    {
        document.getElementById('form1').action = url;
        document.getElementById('form1').method = 'post';
        document.getElementById('form1').submit();
    } 
    /// Login from inner master page  
    else if ( document.getElementById('aspnetForm'))
    {
        document.getElementById('aspnetForm').action = url;
        document.getElementById('aspnetForm').method = 'post';
        document.getElementById('aspnetForm').submit();
    }
}

function checkPostTo(url)
{
    if ( event.keyCode == 13 )
    {
      postTo(url);      
    }
}

function ssnHop(id, id_next, pos)
{
    var sLength     = document.getElementById(id).value;
    if ( pos == 1 )
    {
        if (parseInt(sLength.length) == 3 )
        {
            document.getElementById(id_next).focus();
        }
    }
    if ( pos == 2 )
    {
        if (parseInt(sLength.length) == 2 )
        {
            document.getElementById(id_next).focus();
        }
    }
    if ( pos == 3 )
    {
        if (parseInt(sLength.length) == 4 )
        {
            document.getElementById(id_next).focus();
        }
    }
}