﻿
$(function() {
    $("#gosearchbt").click(function() {
        var titt = $("#ts").val();
        if (titt != "" && titt != "Product Search") {

            window.location.href = 'products.aspx?search=' + titt;
            return false;
        }
        else {
            alert("Please enter a keyword");
        }
    });
    $("#ts").focus(function() {
        //  $(this).val("");
        $("#ts").val("");
    });

    $("#ts").val("Product Search");

    $("#ts").blur(function() {
        setTimeout(function() {
            $("#searchtext").hide();
        }, 500);
    });
    $("#ts").keyup(function(event) {
        var dd = $(this).val();
        event.stopPropagation();

        if ($.browser.msie) {
            var keyStr = event.keyCode;
        }
        else { var keyStr = event.which; }
        if (keyStr == 13) {
            var titt = $("#ts").val();
            if (titt != "") {
                window.location.href = 'products.aspx?search=' + titt;
                return false;
            }
            else {
                alert("Please enter a keyword");
            }
        }

    });
});
