I'm actually working on something that might help with this sort of thing (for easily solved instances of this sort of thing - the problem is more or less impossible to solve in general). Nothing definite, yet, though. If the javascript is simple enough, the post above might work.