A *client-side* JavaScript function? You can't do that in a single load of
an ASP page. You would have to submit a form or redirect or something along
those lines. Here is the order of operations:
(a) browser requests ASP page
(b) server-side code runs
(c) client-side code runs (at this point, there is nothing left but HTML; no
server-side functions, no access to server-side databases, no ability to set
session variables, etc)
See
http://www.aspfaq.com/2281 for some workarounds (this revolves around
setting session variables, but you could use it to do any further
server-side processing). Note that anything you do on the server (e.g. set
a session variable) is not available until you request another ASP page,
because of the order of operations described above. The current ASP page
simply does not contain any ASP by the time an end user can interact with
the client-side script.