﻿$(document).ready(function () {

    //Rollover effect on links
    $("a.simplehover img, img.simplehover").mouseover(function () {
        $(this).attr("src", $(this).attr("src").replace("-off.", "-on."));
    }).mouseout(function () {
        $(this).attr("src", $(this).attr("src").replace("-on.", "-off."));
    });

    $('input[title!=""]').hint();

    $('ul.sf-menu').superfish({
        delay: 200,                            // one second delay on mouseout 
        animation: { opacity: 'show', height: 'show' },  // fade-in and slide-down animation 
        speed: 'fast',                         // faster animation speed 
        autoArrows: false,                     // disable generation of arrow mark-up 
        dropShadows: true                     // disable drop shadows 
    });

    //$('#mycarousel').jcarousel({ size: 4, auto: 2, scroll: 1 });
    $(".FeaturedProducts").hide();

    // FAQ Effect
    $("a[name^='faq-']").each(function () {
        $(this).click(function () {
            if ($("dd[name^='" + this.name + "']").is(':hidden')) {
                $("dd[name^='" + this.name + "']").slideDown('fast');
                $(this).parent().addClass('open');

            } else {
                $("dd[name^='" + this.name + "']").slideUp('fast');
                $(this).parent().removeClass('open');
            }
            return false;
        });
    });

    // Contact form validation
    $("form").validity(function () {
        $(".txtname").require();
        $(".txttopic").require();
        $(".txtemail").require().match("email");
        $(".txttelephone").require().match("phone");
    });

    //Add effect when you just sent an form request. 
    $(".form-confirmation").effect("pulsate", { times: 3 }, 1000);

    //Make some input controls pretty. All those with the class .uniform
    $(".uniform").uniform();


});
