﻿//Check Maximum Length of a TextArea
function fValidateTextLength(oSrc, args) {
    if (args.Value.length < 3 || args.Value.length > 15)
        args.IsValid = false;
    else
        args.IsValid = true;
}

function fValidateTextLengthUserName(oSrc, args) {
    if (args.Value.length < 3 || args.Value.length > 15)
        args.IsValid = false;
    else
        args.IsValid = true;
}

function clickButton(e, buttonid) {
    //debugger;
    var bt = document.getElementById(buttonid);
    if (typeof (bt) == 'object') {
        if (navigator.appName.indexOf("Netscape") > -1) {
            if (e.keyCode == 13) {
                if (bt && typeof (bt.click) == 'undefined') {
                    bt.click = addClickFunction1(bt);
                }
            }
        }
        if (navigator.appName.indexOf("Microsoft Internet Explorer") > -1) {
            if (event.keyCode == 13) {
                bt.click();
                return false;
            }
        }
    }
}

function addClickFunction1(bt) {
    //debugger;
    var result = true;
    if (bt.onclick) result = bt.onclick();
    if (typeof (result) == 'undefined' || result) {
        eval(bt.href);
    }
}
