﻿// Global Javascript

$(document).ready(function () {

  //CUFON FONT REPLACEMENT
  Cufon('.mega-drop-down-section-title', {
    hover: { color: '#bf1c22' }
  });

  Cufon.replace('h1, h2, h3, .block .title, .cat-title, .cufon, legend, .mega-drop-down-menu-text, .mega-drop-down-menu-subtext, .mega-drop-down-section-title '); // Works without a selector engine  

  Cufon.replace('.cufon-shadow', {
    textShadow: '#950204 1px 0px'
  });

  //LAST CHILD
  $(".filter-wrapper:last-child, .master-wrapper-content .item:last-child, .ins-type-item:last-child," +
      " .related-item:last-child, .item-box:last-child, .fm-req:last-child," +
      " .article-intro:last-child, .product-nav .btn-input:last-child, .header-links li:last-child," +
      " .block li:last-child, .product-list1 .item-box:last-child, .mega-drop-down-list:last-child," +
      " .product-list1 .item-box:last-child, .productspec-box tr:last-child, .exercise-list li:last-child," +
      ".mega-drop-down-list:last-child ul, .item-group .scrollable-product:last-child, .partner-logo:last-child").addClass("last-child");

  //FIRST CHILD 
  $(".productspec-box tr:first-child, .compare-products-table tr td:first-child").addClass("first-child");

  // TEXT AREA AUTOGROW
  //$('.autogrow').autogrow();

  //INTRO BANNER NEW
  $(".slidetabs").tabs(".banner > div", {

    // enable "cross-fading" effect
    effect: 'fade',
    fadeOutSpeed: '1000',

    // start from the beginning after the last tab
    rotate: true

    //use the slideshow plugin. It accepts its own configuration
  }).slideshow({
    autoplay: true,
    autopause: true,
    interval: 4000
  });

  $(".banner-link").click(function () {
    $('.slidetabs').data('slideshow').stop();
    $('.slide-1, .slide-2, .slide-3').unbind('click');
  });

  // initialize scrollable
  $(".scrollable, ").scrollable();

});

