﻿$(document).ready(function () {
    //Cufon.replace('h1, h2, .accordion h3, a.button, ul#menu li a strong, .costs, .amount, .period, .tabs li a, #additionalvideo h3', { fontFamily: 'Myriad Pro' });
    //Cufon.replace('.module.news h2, .module.about h2', { fontFamily: 'ITC Stone Serif Std' });

    $('.faq h4').click(function () {
        $(this).next().toggle();
        return false;
    }).next().hide();

    //var $last;
    $accordion = $('.accordion');
    $('h3', $accordion).click(function () {
        // turn off active
        $('.active', $accordion)
            .toggleClass("active")
            .find("ul")
            .height(0);
        // turn on new active
        $(this).next().height("126px");
        $(this).parent().toggleClass("active");
        $last = $(this);
        return false;
    }).next().height("0px");
    $('.accordion li.active').find("ul").height("126px");
    last = $('.accordion li.active h3');

    $('input.go').click(function (e) {
        window.location = "/net/search.aspx?query=" + $('input.text').val();
        e.preventDefault();
    })


    /* identity theft insurance  */

    $(".tabs").tabs({

        fx: { opacity: 'toggle', duration: 250 }
    });

    $('.start .button').click(function (e) {
        e.preventDefault();
        $('.initial').removeClass('initial');
        $(this).parent().parent().addClass('active');
    })

    $('.slide h4').click(function (e) {
        e.preventDefault();
        //$('.slide.active .tabs').animate({ width: "0px" }, 505);

        $('.slide.active').addClass('last').animate({ width: "57px" }, 505);
        $(this).parent().addClass('next').show().animate({ width: "615px" }, 500, onHide);
        $(this).parent().find('.tabs').show(); //.animate({ width: "597px" }, 505);
        $(this).hide();
    });

    function onHide() {
        $('.slide.last h4').removeAttr('style');
        $('.slide.last').removeAttr('style').removeClass('active');
        $('.slide.next').removeClass('next').addClass('active');
        $('.slide .tabs').removeAttr('style');
    }

});

    /* Funeral Plan Microsite */  
