/**
 *	@purpose:   handles the creation of tabs
 *	@author:    robert.leurs@cooloxygen.com
 *	@version:   1.1
 */

$(function () {
    
    // catch and set the div on whitch we want to create the tabs
    var tabContainers = $('div.tabs > div');
    
    // always show the first tab by default
    tabContainers.hide().filter(':first').show();
    
    // catch the clicking of a tab
    $('a.tabnav').click(function () {
        // hide all tabs
        tabContainers.hide();
        // now show the one we want
        tabContainers.filter(this.hash).show();
        
        // get and set the title
        var tabTitle = $(this).html();
        $('p.tab_title').html('<h1>' + tabTitle + '</h1>');
        
        //sIFR.replaceElement("p.tab_title h1", named({sFlashSrc: "/sifr/worldsuperyachts.com/dejavucondensedsansbold.swf", sColor: "#EBEBEB", sWmode: "transparent"}));
        
        // set classes
        $('a.tabnav').removeClass('selected');
        $(this).addClass('selected');

        return false;
    }).filter(':first').click();
});