[UI Accordion] 2nd click on the head opens a new site?

[UI Accordion] 2nd click on the head opens a new site?

hey,
i'm new in this forum!

i'm using the accordion function (jquery-ui-1.8rc3). This works fine. But now i want something special :-)

When i click on hthe header for the first time, the header gets the class "ui-state-active" and the content slides down. Now when i click the header for the second time, it should open a new site.

my current approach







  1. $('.menu li a').click( function() {
  2.    if($(this).hasClass('ui-state-active')){
  3.       alert("do something!");
  4.    } });
but this opens the alert window everytime i click on a header.

here is a test case link: *link removed*

THANKS! snuwie