﻿// Gets a control based on part of its name (for ASP.Net)
function getControl(controlType, controlName)
{
    var controls = document.getElementsByTagName(controlType);
    for (var i = 0; i < controls.length; i++)
    {
        if (controls[i].id.indexOf(controlName) >= 0)
        {
            return controls[i];
        }
    }
}

// Verifies if a page is valid (for ASP.Net)
function IsPageValid()
{

    if (typeof(Page_ClientValidate) == 'function')
    { Page_ClientValidate(); }

    if (Page_IsValid)
    { return true; }
    
    return false;
}