Maybe try putting your regex in a separate variable, like so:
//...
var re = /^\d{5}$/; // using Pointy's comment, which I think is well-advised
if (re.test(orgnValue)) { // This is the problem area
orgn.removeClass("invalid"); // The above line is '/\d{4}/g' for prog.
} else {
orgn.addClass("invalid");
}
//...
Robusto
2010-07-20 15:30:48