﻿
setAspnetTextFocus = function() {
    var classBlur = 'common-textbox';
    var classFocus = 'common-textbox-focus';
    var inputElements = document.getElementsByTagName('input');
    for (var i = 0; i < inputElements.length; i++) {
        inputElements[i].onfocus = function() {
            if (this.className == 'common-textbox') {
                this.className += ' ' + classFocus;
            }
        }
        inputElements[i].onblur = function() {
            this.className = this.className.replace(new RegExp(' ' + classFocus + '\\b'), '');
        }
    }
}
if (window.attachEvent) window.attachEvent('onload', setAspnetTextFocus);
