
function ShowHideSection(clickedControlID, hideSection)
{
    var section = document.getElementById(hideSection);
    if ((clickedControlID != null) && (section != null))
    {
        if (getCheckedRadio(clickedControlID) == "1")
        {    
            section.style.display = "";
        }
        else
        {
            section.style.display = "none";   
        } 
    }
}

function getCheckedRadio(clickedControlID) 
{
    var radioButtonList = document.getElementById(clickedControlID);
    for (var x = 0; x < radioButtonList.cells.length; x ++) 
    {
        var radioButton = document.getElementById(clickedControlID + "_" + x);
        if (radioButton.checked) 
        {
            return radioButton.value;
        }
    }
}

function sessionWarning() 
{
   alert('You have 5 minutes remaining to complete this form.');
}

//These functions are used because we want our required field validation to work, so
// we must clear out the mask if a value hasn't been entered.  "ClearMaskOnLostFocus"
// won't work because we want the mask to stay in the field so it looks good.
function ClearMask_Onblur(field)
{
    if ((field.value == "(___) ___-____") ||
        (field.value == "__.___") ||
        (field.value == "___,___.00") ||
        (field.value == "__,___.00"))
    {
        field.value = "";
    }
}



function ScrollView(clientID)
{
    var el = document.getElementById(clientID)
    if (el != null)
    {        
        el.scrollIntoView();
        el.focus();
    }
}

//After postback and partial rendering the page looses the focus status and it resets to 
//the beginning of the page. This means it is not possible for the page to maintain the 
//control focus or set the focus to another control by Focus method in Updatepanel 
//post back event.  Notice that we had to call this with a setTimeout, so that we 
//can wait to get control of our page back.
//function GiveFocus(clientID)
//{
//    var el = document.getElementById(clientID)
//    if (el != null)
//    {         
//        el.focus();
//    }
//}