﻿/* Top Menu Slider */
$(document).ready(function () {


    $(".search label").inFieldLabels();

    $("header.banner nav ul li").not(".sub li").hover(function () {        
        $(this).children(".sub").removeClass("mouseleft");

        if ($(this).children(".sub").hasClass("opened") == false) {
            $(this).children("ul").slideDown({ duration: 1000, easing: 'easeOutBounce', complete: function () {
                $(this).delay(200).addClass("opened");
                if ($(this).hasClass("mouseleft")) {
                    $(this).fadeOut();
                    $(this).removeClass("opened");
                }
            }
            });
        }
    }, function () {

        $(this).children(".sub").addClass("mouseleft");

        if ($(this).children(".sub").hasClass("opened")) {
            $(this).children(".sub").slideUp({ duration: 1000, complete: function () {
                $(this).delay(200).removeClass("opened");
            }
            });
        }
    });

    //panels
    $("a.hiddenlink").parent().click(function () {
        window.location = $(this).find("a.hiddenlink").attr("href");
    });


});

//$(".search a").live("click", function () {
//    window.location = "/search-results";
//});
