﻿// Application common javascript functions

// Add click handler for non-IE browsers
function addClickHandler(id )
{
    var b = document.getElementById(id);
    if (b && typeof(b.click) == 'undefined') {
        b.click = function() { 
            var result = true;
            if (b.onclick) result = b.onclick();
            if (typeof(result) == 'undefined' || result) {
                eval(b.href);
            }
        }         
    }
}

// Validates user name for custom validator
function clientValidateUsername(source, clientside_arguments)
{               
    var re = new RegExp('(?=.*[a-zA-Z])');
    var m = re.exec(clientside_arguments.Value);
   
    if ( m == null ) 
    {
      clientside_arguments.IsValid=false;       
    }
    else
    {
      clientside_arguments.IsValid=true;       
    }                   
}
