﻿
        $(document).ready(function() { 

        $('#productFinder .input div.roundedInput input').live("keypress", function (e) {
            if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
                $(this).parents(".input").find(".button input").click();
                return false;
            } else {
                return true;
            }
        });
        /* --------------------End Search ------------------- */

    });


    /* ------------------- Search -------------------- */
    $("#productFinder .button input").live("click", function () {

        var term = $.URLEncode($(this).parents(".input").find('div.roundedInput input[type="text"]').val());
        if (term == "" || term == "Search") {
            return false;
        }
        else {

            var type;
            if ($(this).parents(".code").length > 0) {
                type = "code";
            }
            else {
                type = "keyword";
            }


            window.location.href = "/product-search-results?search=" + term + "&type=" + type;
            return false;
        }
    });

    
    
        function showForgotten(){
            document.getElementById("divForgottenPassword").style.display = 'block';
            document.getElementById("divRegisterPassword").style.display = 'none';            
        }
        
        function hideForgotten(){
            document.getElementById("divForgottenPassword").style.display = 'none';
            document.getElementById("divRegisterPassword").style.display = 'block';            
            return false;
        }
        function showStatus()
        {
            document.getElementById("ctl00_mainContent_ucStatus_but_hid_modalStatus_trigger").click();
            document.getElementById("divStatusComplete").style.display = "none";
            document.getElementById("divStatusLoading").style.display = "block";
        }

        $(".enter-submit").live("keypress", function (e) {
            if ($(this).parents(".enter-form").find(".submit-button").length <= 0) return true;

            if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {

                $(this).parents(".enter-form").find(".submit-button").click();
                return false;
            } else {
                return true;
            }
        });

