// tabs
jQuery(function($){
    var activeTab = 2;
    if (window.location.hash == '#customer-reviews') {
        activeTab = 1;
    }
    $('.tab-box').maketabs({
        active: activeTab
    });
}); 

//~ function bannerRotator(selector, options){
    //~ options = options || {};
    //~ var initCallback = function(carousel){
        //~ if (options.stopOnClick){
            //~ // Disable autoscrolling if the user clicks the prev or next button.
            //~ carousel.buttonNext.bind('click', function(){
                //~ carousel.startAuto(0);
            //~ });
            //~ carousel.buttonPrev.bind('click', function(){
                //~ carousel.startAuto(0);
            //~ });
        //~ }
//~ 
        //~ // Pause autoscrolling if the user moves with the cursor over the clip.
        //~ carousel.clip.hover(function(){
            //~ carousel.stopAuto();
        //~ }, function(){
            //~ carousel.startAuto();
        //~ });
//~ 
        //~ if (options.initCallback)
            //~ options.initCallback.apply(this, arguments);
    //~ };
//~ 
    //~ if (jQuery(selector + ' > li').size() > 1){
        //~ return jQuery(selector).jcarousel({
            //~ auto: options.auto || 5,
            //~ scroll: options.scroll || 1,
            //~ offset: 1,
            //~ start: 1,
            //~ wrap: options.wrap || 'circular',
            //~ buttonNextHTML: options.buttonNextHTML !== undefined ? options.buttonNextHTML : false,
            //~ buttonPrevHTML: options.buttonPrevHTML !== undefined ? options.buttonPrevHTML : false,
            //~ initCallback: initCallback,
            //~ itemVisibleInCallback:options.itemVisibleInCallback || null,
            //~ animation:options.animation || 'fast'
        //~ });
    //~ }
    //~ return null;
//~ }
//~ 
//~ jQuery(function($){
    //~ $('body').addClass('js');
    //~ $('.image-rotator li').preloadImages();
    //~ $('#main-banners li.no-display').removeClass('no-display');
//~ 
    //~ $("a.extrn, a[rel*=external]").attr({'target': "_blank"});
//~ 
    //~ // main banners
    //~ var main_banners = $('#main-banners'),
        //~ pager = main_banners.parent().find('.rotator-pagination'),
        //~ count = main_banners.children().size();
    //~ pager.children().first().addClass('current');
    //~ bannerRotator('#main-banners', {
        //~ wrap: 'both',
        //~ itemVisibleInCallback: {
            //~ onBeforeAnimation: function(carousel, element, idx){
                //~ pager.children('.current').removeClass('current');
                //~ pager.find('a[rel='+(Math.abs((idx-1)%count)+1)+']').parent().addClass('current');
            //~ }
        //~ }
    //~ });
    //~ pager.delegate('a', 'click', function(){
        //~ jQuery(main_banners).data('jcarousel').scroll(jQuery.jcarousel.intval($(this).attr('rel')));
        //~ return false;
    //~ });
//~ });

jQuery(function($){
    $('body').addClass('js');
    $('.image-rotator li').preloadImages();
    $('#main-banners li.no-display').removeClass('no-display');
    
    $('#main-banners').cycle({
        fx:     'fade',
        speed:  1000,
        timeout: 5000,
        pager:  '.rotator-pagination',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.rotator-pagination li:eq(' + (idx) + ') a';
        }
    });
});






