/** * Return true if the argument is a valid user name */ var MIN_LEN = 4; var MAX_LEN = 20; function is_valid_user_name(n) { if ( n == null ) return false; if ( n.length < MIN_LEN || n.length > MAX_LEN ) return false; var reg = /[^A-Za-z0-9_]/; if ( reg.exec(n) ) return false; return true; } /** * Return true if the argument is a valid password */ function is_valid_password(p) { return is_valid_user_name(p); } //From http://developer.irt.org/script/241.htm function stripSpaces(x) { while (x.substring(0,1) == ' ') x = x.substring(1); while (x.substring(x.length-1,x.length) == ' ') x = x.substring(0,x.length-1); return x; } //Return a DOM ref to an object function get_obj_ref ( obj_name ) { if ( document.all ) obj_ref = document.all(obj_name); else obj_ref = document.getElementById(obj_name); return obj_ref; }