title: Log in/out of Gmail chat programmatically, clicking Gmail's span "links"
body: <p>At work, I use Gmail's chat, since it's encrypted and logs chats without installing or saving anything to the hard drive.  At home, I use Pidgin.  When I log into GMail at home, I have to log out of chat, or messages will end up in the wrong place.  When I log into GMail at work, I have to log back in to chat.</p>
  
  <p>In other words, when I start Firefox at home, I want Gmail's chat disabled automatically.  When I start Firefox at work, I want Gmail's chat enabled automatically.</p>
  
  <p>Is there a way to use a Greasemonkey script or similar to force logging in and logging out on specific machines?  It would seem simple enough; just follow a URL or simulate clicking a link.  Unfortunately, Gmail doesn't use actual links.</p>
  
  <p>While logged out:</p>
  
  <pre><code>&lt;span tabindex="0" role="link" action="si" class="az9OKd"&gt;Sign into chat&lt;/span&gt;
  </code></pre>
  
  <p>While logged in, in drop-down menu:</p>
  
  <pre><code>&lt;div tabindex="-1" id=":1mj" role="menuitem" class="oA" value="si"&gt;&lt;div class="uQ c6"/&gt;Sign into chat&lt;/div&gt;
  
  &lt;div tabindex="-1" id=":8f" role="menuitem" class="oA" value="sia"&gt;&lt;div class="uQ c5"/&gt;Sign into AIM®&lt;/div&gt;
  
  &lt;div tabindex="-1" id=":8e" role="menuitem" class="oA" value="so"&gt;&lt;div class="uQ df"/&gt;Sign out of chat&lt;/div&gt;
  </code></pre>
  
  <p>At bottom of page:</p>
  
  <pre><code>&lt;span id=":im" class="l8 ou" tabindex="0" role="link"&gt;turn off chat&lt;/span&gt;
  
  &lt;span id=":im" class="l8 ou" tabindex="0" role="link"&gt;turn on chat&lt;/span&gt;
  </code></pre>
  
  <p>Anyone know how to "click" these non-links with JavaScript or access their functions?  I would imagine that "so" means "sign out", "si" means "sign in", and "sia" means "sign in AIM".  Can I somehow call these actions directly?</p>
  
  <p>Is there some other alternative for disabling chat?</p>