JQuery horizontal accordion close on click - help me fix this bug!

Demo: http://vincent-massaro.com/map/

This map/accordion combo works by either clicking a marker on the map or a slice of the accordion. I just noticed one slight issue. When clicking on an image slice, and then clicking to close it, it is not possible to click and open the same slice without clicking and opening a different slice first. Any help is much appreciated!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi again!

I have changed the haccordion.js. Please find the attached file.

Now you dont need to use isMarker = true;
            GEvent.addListener(marker, 'click', function(){
                  haccordion.expandli('slices', 0);

            GEvent.addListener(marker2, 'click', function(){
                        haccordion.expandli('slices', 1);

Best Regards.

      if($($target).attr("isOpen") == 1)
            $(this).stop().animate({width:config.paneldimensions.peekw}, config.speed) //contract previous content
            $($target).attr("isOpen", "0");
            haccordion.expandli(config.accordionid, this);
      expandli:function(accordionid, targetli){
            var config=haccordion.accordioninfo[accordionid]
            var $targetli=(typeof targetli=="number")? config.$targetlis.eq(targetli) : (typeof targetli=="string")? jQuery('#'+targetli) : jQuery(targetli)
            if (typeof config.$lastexpanded!="undefined") //targetli may be an index, ID string, or DOM reference to LI
                  config.$lastexpanded.stop().animate({width:config.paneldimensions.peekw}, config.speed) //contract last opened content
            $targetli.stop().animate({width:$targetli.data('hpaneloffsetw')}, config.speed) //expand current content
            $($targetli).attr("isOpen", "1");

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Please test the above file and get back to me on this.

Best Regard.

vmassaroAuthor Commented:
It works perfectly now! Thank you again!
vmassaroAuthor Commented:
Superb job!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.