<script type="text/javascript" src="<?php echo $this->websiteUrl; ?>system/js/jquery/plugins/core.js"></script>
<script type="text/javascript" src="<?php echo $this->websiteUrl; ?>system/js/jquery/plugins/accordion.js"></script>
<script type="text/javascript"> $(document).ready(function(){ $("#main_menu_accordion").accordion(); });</script>
<ul id="main_menu_accordion">
<?php foreach ($this->sitePages as $sitePage): ?>
<?php if($sitePage['h1'] == 'no category'): ?>
<li>
<ul class="nocategory">
    <?php foreach ($sitePage['pages'] as $subPage): ?>
        <li><a title="<?php echo $subPage['h1']; ?>" href="<?php echo ($subPage['url'] != 'index') ? $this->websiteUrl . $subPage['url'] . '.html' : $this->websiteUrl ; ?>" onclick="window.location.href=this.href;"><?php echo $subPage['navigationTitle']; ?></a></li>
    <?php endforeach; ?>
</ul>
</li>
<?php else: ?>        		
<li class="category"><a title="<?php echo $sitePage['h1']; ?>" href="<?php echo $this->websiteUrl . $sitePage['url'] . '.html'; ?>" ondblclick="window.location.href=this.href;"><?php echo $sitePage['navigationTitle']; ?></a>
<?php if(!empty($sitePage['pages']) && is_array($sitePage['pages'])): ?>
<ul class="pages">
    <?php foreach ($sitePage['pages'] as $subPage): ?>
        <li><a title="<?php echo $subPage['h1']; ?>" href="<?php echo ($subPage['url'] != 'index') ? $this->websiteUrl . $subPage['url'] . '.html' : $this->websiteUrl ; ?>"><?php echo $subPage['navigationTitle']; ?></a></li>
    <?php endforeach; ?>
</ul>
<?php endif; ?>
</li>
<?php endif; ?>    
<?php endforeach; ?>
</ul>