From what you say, it sounds like your stored proceedure is a server side script that returns some stored information about a user's preferences when the user logs in. If this is so I would advise the following. Get the stored proceedure to serve a page with a script in it that sets a cookie:
<body>
<script type="text/javascript">document.cookie='user_info=my_style_sheet;
expires=Fri, 26 Jan 2007 21:08:00; path=http://your_domain.com';
setTimeout("set_link()", 2000)</script>
You can find info about how to correctly set a cookie here . So, the server side script generates the correct javascript code to set a cookie when that code is run on the client machine. Then, make your javascript app. read the cookie and set the link based on this:
<head>
<script type="text/javascript">
function set_link() {
var cookie = document.readCookie('user_info');
var crumbs = cookie.split(=);
var style = crumbs[1];
var file_name = style + ".css";
document.write("<a href=\"file_name\">Your style</a>");
}
</script>
A couple of things to note here:
1. This is a rough sketch of what you might need to do. I'm not an expert so there might be mistakes in there.
2. Remember that your server side script will need to generate the correct javascript code to set the cookie in the first place, or this won't work.
Hope this gives you some ideas.
Steven.