﻿function slideSwitch() {
    // Create Lander Slider
    var $active = $('#splash a.active');

    if ($active.length == 0) $active = $('#splash a:last');

    var $next = $active.next().length ? $active.next()
        : $('#splash a:first');


    $active.addClass('last-active');

    $next.css({ opacity: 0.0 })
        .addClass('active')
        .animate({ opacity: 1.0 }, 1000, function() {
            $active.removeClass('active last-active');
        });
    }

$(document).ready(function() {
    //  Create Product Tabs
    var tabContainers = $('div.tabs div.tabcontainer > div');

    $('div.tabs ul.tabNavigation a').click(function() {
        tabContainers.hide().filter(this.hash).show();

        $('div.tabs ul.tabNavigation a').removeClass('selected');
        $(this).addClass('selected');

        return false;
    }).filter(':first').click();

    // Cluetip
    $('a.clueTip').cluetip({ showTitle: false });

    // Drop down
    function addMega() {
        $(this).addClass("hovering");
    }
    function removeMega() {
        $(this).removeClass("hovering");
    }
    var megaConfig = {
        interval: 50,
        sensitivity: 3,
        over: addMega,
        timeout: 50,
        out: removeMega
    };

    $("li.mega").hoverIntent(megaConfig)
});

function showRelatedProducts() {
    parent.$.fancybox.close();
    $('.relatedproducts').click()
}
