﻿// JScript File

function RecursivelySetStyleWidth(node, styleClass,width)
{
    for(i in node.childNodes)
    {
        var n = node.childNodes[i];
        if (n.tagName)
        {
            
            if (n.tagName.toUpperCase() == "INPUT")
            {
                var type = n.getAttribute("type");
                if (type.toUpperCase() != "SUBMIT")
                //n.setAttribute("class",styleClass);
                    n.style.width = width;
            }
            RecursivelySetStyleWidth(n, styleClass, width);
        }
    }
}

    function $getY( oElement )
    {
        var iReturnValue = 0;
        while( oElement != null ) 
        {
            iReturnValue += oElement.offsetTop;
            oElement = oElement.offsetParent;
       }
        return iReturnValue;
    }
    function $getX( oElement )
    {
        var iReturnValue = 0;
        while( oElement != null ) 
        {
            iReturnValue += oElement.offsetLeft;
            oElement = oElement.offsetParent;
       }
        return iReturnValue;
    }

function LimitMaxLen( oElement, len, prompt)
{
    if (oElement.value.length >= len) 
    {
        if (prompt)
            alert("The maximum length of this field is " + len + " characters.");
        oElement.value=oElement.value.substring(0,len);
    }
}