<?php
    
/**
    * o------------------------------------------------------------------------------o
    * | This package is dual licensed as GPL and a commercial license.               |
    * | If you use the code commercially (or if you don't want to be restricted by   |
    * | the GPL license), you will need the commercial license. It's only £49 (GBP - |
    * | roughly $98 depending on the exchange rate) and helps me out a lot. Thanks.  |
    * o------------------------------------------------------------------------------o
    *
    * © Copyright Richard Heyes
    */
    
    /**
    * Produces a tab strip
    *
    * NB: Don't forget the CSS styles
    *
    * @param array $tabs Multi dimensional array of tabs. First dimension is
    *                    numerically indexed, second has the following keys:
    *                     o link   -  The link used
    *                     o name   -  The text used inside the link which the user sees
    *                     o active -  Whether this tab is active or not. Naturally only
    *                                 one tab should have this set to true...
    */
    
function PrintTabStrip($tabs, $leader = null)
    {
        
?>
            <div class="tabstrip">
                &nbsp;
                <?foreach($tabs as $t):?>
                    <div class="tabstrip_tab <?=($t['active'] ? 'active' : '')?>" id="<?=$t['id']?>">
                        <?if(!$t['active']):?>
                            <img src="images/tab_tl.png" style="position: absolute; top: -1px; left: -1px" width="5" height="5" />
                            <img src="images/tab_tr.png" style="position: absolute; top: -1px; right: -1px" width="5" height="5" />
                        <?else:?>
                            <img src="images/tab_active_tl.png" style="position: absolute; top: -1px; left: -1px" width="5" height="5" />
                            <img src="images/tab_active_tr.png" style="position: absolute; top: -1px; right: -1px" width="5" height="5" />
                        <?endif?>
                        
                        <?if(!empty($t['link'])):?><a href="<?=$t['link']?>" <?if(!empty($t['mouseover'])):?>onmouseover="window.status = '<?=$t['mouseover']?>'; return true" onmouseout="window.status = ''"<?endif?>><?=$t['name']?></a><?else:?><?=$t['name']?><?endif?>
                    </div>
                <?endforeach?>
                &nbsp;
            </div>
        <?php
    
}
?>