How does one launch a Modal window which action is taken by Javascript
rather than the user clicking on a link?

To be exact we currently use Lightbox CSS to launch forms into Modal Windows, which you can see from this Web site:
realnewspost: A News site powered by the Social Network to get the TRUTH out
when you click on the Sign-in link at the top.

What I need to get done, is when for example the user enters a value in a form, via Javascript we check the value entered and then Pop a Modal Window or when user submits the form, the resulting page which is then generated by Php will cause a Modal window to pop.

Also please specify whether the content of the Modal window based on your suggested solution needs to be a separate Web page or whether it can be content (Text/Image link) from the page which launched the Modal window, which is preferred.