        $(document).ready(
            function () {
                $(".search-input").each(function () { textReplacement($(this)); })
                $(".search-input").css("color", "#9a9a9a");
                $(".login-input").each(function () { textReplacement($(this)); })
                $(".login-input").css("color", "#9a9a9a");
            }
        );

        function on_menuitem_over(s) {
            if ($("#drop" + s).children().children().html() == null) {
                $("#i" + s).children("div").css("background-color", "#145c75"); 
            }
            else {
                width = 0;
                drop_width = 0;
                height = 0;
                $("#i" + s).css("display", "none");
                $("#a" + s).css("display", "block");
                width = $("#a" + s).width() - 9;
                position = $("#td" + s).position();
                $(".backmenu").css("left", position.left);
                $(".backmenu").css("visibility", "visible");
                $("#c").width(width);
                drop_width = $("#drop" + s).width() + 25;
                height = $("#drop" + s).height() - 40;
                if (height < 0)
                    height = 1;
                $("#e").height(height);
                $("#f").height(height);
                $("#g").height(height);
                if(drop_width - width > 0)
                    $("#d").width(drop_width - width);
                else
                    $("#d").width(1);
            }
        }
        function on_menuitem_out(s) {
            if ($("#drop" + s).children().children().html() == null) {
                $("#i" + s).children("div").css("background-color", "transparent");
            }
            else {
                $("#a" + s).css("display", "none");
                $("#i" + s).css("display", "block");
                $(".backmenu").css("visibility", "hidden");
            }
        }

        function textReplacement(input) {
            var originalvalue = input.val();
            input.focus(function () {
                if ($.trim(input.val()) == originalvalue) { input.val(''); input.css("color", "black"); }
            });
            input.blur(function () {
                if ($.trim(input.val()) == '') { input.val(originalvalue); input.css("color", "#9a9a9a"); }
            });
        }
