How to launch Skype using Javascript automatically

I know to open skype using its special commands in html to chat, for example:

<a href="">Chat</a>

One can click on "Chat" and it will launch Skype if it is installed.

However, I want to check if a customer is login to OUR SITE before he is able to chat. Once the person is login, I would like to launch Skype with a Javascript function so that he does not have to click on the "Chat" link to start Skype. So basically launching automatically. It must be something simple, but I can't seem to find any answer. Thanks in advance.


ANSWERS:


Try 'redirecting' to the 'link':

window.location = '';

Edit: To use a variable in place of some_skype_user you need to concatenate it:

var skypename = 'skypeuser01';
window.location = 'skype:' + skypename + '?chat';


 MORE:


 ? giving error on using localhost on twitter application built with mvc
 ? will my app respond to a url scheme?
 ? Decoding &amp; in an appended javascript url
 ? Decoding &amp; in an appended javascript url
 ? Decoding &amp; in an appended javascript url
 ? Replace &amp; to &
 ? How to download a file generated with javascript, avoiding automatic opening of Chome?
 ? How to set request encoding in Tomcat?
 ? URL decoding resulting in question marks in tomcat
 ? URL decoding resulting in question marks in tomcat