/**
*
* WMC Music
* Theme designed by Wiseguy Digital
*
*/
function gotoReview(form) {
    // Hide the current active panel
    $j('.product-collateral div.tab-box').each(function(){
        $j(this).hide();
    });
    // Show the new panel
    $j('#tab-reviews').show();
    // Change the tab active class
    $j('ul#tab-nav li.tab-active').removeClass('tab-active');
    if (!$j('#reviews-link').hasClass('tab-active')) {
        $j('#reviews-link').addClass('tab-active');
    }
    $j(this).click(function(e){
        if (form){
            $j.scrollTo('#review-form');
        }else {
            $j.scrollTo('#tab-reviews');
        }
    })
}

$j(document).ready(function(){
    // Run through each tab
    $j('#tab-nav li').each(function(){
        $j(this).click(function(e){
            var tabAnchor = $j(this).find('a').attr('href');
            var tabName = tabAnchor.substr(1,tabAnchor.length);
            // Hide the current active panel
            $j('.product-collateral div.tab-box').each(function(){
                $j(this).hide();
            });
            // Show the new panel
            $j('#'+tabName).show();
            // Change the tab active class
            $j('ul#tab-nav li.tab-active').removeClass('tab-active');
            if (!$j(this).hasClass('tab-active')) {
                $j(this).addClass('tab-active');
            }
						$(window).trigger('scroll');
         
            // Prevent loading in the address bar
            e.preventDefault();
        })
    });
});
