Hi I have an accordion menu, all working fine except if a section has no subcategory I need the link to go to the page rather than try to open a submenu that's not there.

How do I implement this into this code?

```
$.noConflict();
$(document).ready(function() {

        // Store variables

        var accordion_head = $('ul.accordion > li > a.item'),
            accordion_body = $('ul.accordion li > ul.sub-menu');

        // Click function

        accordion_head.on('click', function(event) {

            // Disable header links

            event.preventDefault();

            // Show and hide the tabs on click

            if ($(this).attr('class') != 'active'){
                accordion_body.slideUp('normal');
                $(this).next().stop(true,true).slideToggle('normal');
                accordion_head.removeClass('active');
                $(this).addClass('active');
            }

        });

    });

```

HTML....

```
  <div class="Block CategoryList Moveable" id="SideCategoryList">

   <div class="BlockContent" id="dropDowns">
    <ul class="accordion">
    <li><a href="http://site-link.co.uk" >Main Category 1</a>
    <ul class="sub-menu">   <li><a href="http://site-link.co.uk" class="item">item 1</a>

    </li>   <li ><a href="http://site-link.co.uk" class="item">item 2</a>

    </li>   <li ><a href="http://site-link.co.uk" class="item" >item 3</a>

   </li>    <li ><a href="http://site-link.co.uk" class="item">item 4</a>

    </li></ul>

</li>   <li ><a href="http://site-link.co.uk" class="item">Main Category 2</a>

</li>   <li ><a href="http://site-link.co.uk" class="item">Main Category 3</a>

</li>
    </ul> 

```