﻿



$(function () {

    var collection = 1;

    $("#preNext-btnNext").click(function () {
        if (collection == 6) {
            collection = 0;
        }
        collection++;
        if (collection == 1) {
            $("#ContentPlaceHolder1_hdncollection").val("6");
        }
        if (collection == 2) {
            $("#ContentPlaceHolder1_hdncollection").val("5");
        }
        if (collection == 3) {
            $("#ContentPlaceHolder1_hdncollection").val("4");
        }
        if (collection == 4) {
            $("#ContentPlaceHolder1_hdncollection").val("1");
        }
        if (collection == 5) {
            $("#ContentPlaceHolder1_hdncollection").val("2");
        }
        if (collection == 6) {
            $("#ContentPlaceHolder1_hdncollection").val("3");
        }
    });

    $("#shippinglink").click(function () {
        $("#contact").hide();
        $("#returns").hide();
        $("#order").hide();
        $("#sales").hide();
        $("#product").hide();
        $("#shipping").show();
        $("#press_contact").hide();
        $("#terms").hide();
    });

    $("#termslink").click(function () {
        $("#contact").hide();
        $("#returns").hide();
        $("#order").hide();
        $("#sales").hide();
        $("#product").hide();
        $("#shipping").hide();
        $("#press_contact").hide();
        $("#terms").show();
    });

    $("#contactlink").click(function () {
        $("#shipping").hide();
        $("#returns").hide();
        $("#order").hide();
        $("#sales").hide();
        $("#product").hide();
        $("#contact").show();
        $("#press_contact").show();
        $("#terms").hide();

    });

    $("#returnlink").click(function () {
        $("#shipping").hide();
        $("#contact").hide();
        $("#orderhide").hide();
        $("#sales").hide();
        $("#product").hide();
        $("#returns").show();
        $("#press_contact").hide();
        $("#terms").hide();
    });

    $("#orderlink").click(function () {
        $("#shipping").hide();
        $("#contact").hide();
        $("#returns").hide();
        $("#sales").hide();
        $("#product").hide();
        $("#orderhide").show();
        $("#press_contact").hide();
        $("#terms").hide();
    });

    $("#saleslink").click(function () {
        $("#shipping").hide();
        $("#contact").hide();
        $("#returns").hide();
        $("#orderhide").hide();
        $("#product").hide();
        $("#sales").show();
        $("#press_contact").hide();
        $("#terms").hide();
    });

    $("#productlink").click(function () {
        $("#shipping").hide();
        $("#contact").hide();
        $("#returns").hide();
        $("#orderhide").hide();
        $("#sales").hide();
        $("#product").show();
        $("#press_contact").hide();
        $("#terms").hide();
    });

    $("#preNext-btnPrev").click(function () {
        if (collection == 1) {
            collection = 7;
        }
        collection = collection - 1;
        if (collection == 1) {
            $("#ContentPlaceHolder1_hdncollection").val("6");
        }
        if (collection == 2) {
            $("#ContentPlaceHolder1_hdncollection").val("5");
        }
        if (collection == 3) {
            $("#ContentPlaceHolder1_hdncollection").val("4");
        }
        if (collection == 4) {
            $("#ContentPlaceHolder1_hdncollection").val("1");
        }
        if (collection == 5) {
            $("#ContentPlaceHolder1_hdncollection").val("2");
        }
        if (collection == 6) {
            $("#ContentPlaceHolder1_hdncollection").val("3");
        }
    });



    // run the currently selected effect
    function runEffect() {
        // get effect type from 

        // most effect types need no options passed by default
        var options = {};
        // some effects have required parameters

        // run the effect
        $("#login_panel").toggle("slide", options, 100);
    };

    // set effect from select menu value
    $("#myaccount").click(function () {
        runEffect();
        return false;
    });

    function runEffect2() {
        // get effect type from 

        // most effect types need no options passed by default
        var options = {};
        // some effects have required parameters

        // run the effect
        $("#newsletterdiv").toggle("slide", options, 100);
    };

    // set effect from select menu value
    $("#btnsignup").click(function () {
        runEffect2();
        return false;
    });

    $("#bloglink").hover(function () {
        $("#collections").hide();
        $("#categories").hide();
        $('#paging').show();
        $("#product-paging").show();
    });

    function runEffect3() {
        // get effect type from 

        // most effect types need no options passed by default
        var options = {};
        // some effects have required parameters

        // run the effect
        $('#paging').hide();
        $("#product-paging").hide();
        $("#categories").hide();
        $("#collections").show();

        $("#collections").mouseleave(function () {
            $("#collections").hide();
            $('#paging').show();
            $("#product-paging").show();
        });
    };

    // set effect from select menu value
    $("#collectionshop").hover(function () {
        runEffect3();
        return false;
    });

    function runEffect4() {
        // get effect type from 

        // most effect types need no options passed by default
        var options = {};

        // some effects have required parameters

        // run the effect
        $('#paging').hide();
        $("#product-paging").hide();
        $("#collections").hide();
        $("#categories").show();

        $("#categories").mouseleave(function () {
            $("#categories").hide();
            $('#paging').show();
            $("#product-paging").show();
        });
    };

    // set effect from select menu value
    $("#categoryshop").hover(function () {
        runEffect4();
        return false;
    });

    $(".jFlowPrev").hide();
    $(".jFlowNext").hide();

    $("#prevNext").hover(function () {
        $(".jFlowPrev").show();
        $(".jFlowNext").show();
    });

    $("#form1").hover(function () {
        $(".jFlowPrev").hide();
        $(".jFlowNext").hide();
    });

    $("#header").hover(function () {
        $(".jFlowPrev").hide();
        $(".jFlowNext").hide();
    });

    $("#sandy").hover(function () {
        $(".jFlowPrev").hide();
        $(".jFlowNext").hide();
    });

    $("#press").hover(function () {
        $(".jFlowPrev").hide();
        $(".jFlowNext").hide();
    });

    $("#cusServ").hover(function () {
        $(".jFlowPrev").hide();
        $(".jFlowNext").hide();
    });

    $("#retail").hover(function () {
        $(".jFlowPrev").hide();
        $(".jFlowNext").hide();
    });

    $("#myaccountloggedin").hover(function () { //When trigger is clicked...

        //Following events are applied to the subnav itself (moving subnav up and down)
        $("#accOptions").show();

        $("#header").hover(function () {
        }, function () {
            $(this).parent().find("#accOptions").hide();
        });

        //Following events are applied to the trigger (Hover events for the trigger)
    });
});
