function initPage() {
    clearFormFields({

        addClassFocus: "focus",
        controlid: "ctl00_wpSearch_ctl00_txtSearch"
    });
}
function clearFormFields(o) {



    var input = document.getElementById(o.controlid);

    if (!input)
        return;


    input.valueHtml = input.value;
    input.onfocus = function() {

        if (this.valueHtml == this.value) this.value = "";
        if (this.fake) {
            inputsSwap(this, this.previousSibling);
            this.previousSibling.focus();
        }
        if (o.addClassFocus && !this.fake) {
            this.className += " " + o.addClassFocus;
            this.parentNode.className += " parent-" + o.addClassFocus;
        }
    }
    input.onblur = function() {
        if (this.value == "") {
            this.value = this.valueHtml;

        }
        if (o.addClassFocus) {
            this.className = this.className.replace(o.addClassFocus, "");
            this.parentNode.className = this.parentNode.className.replace("parent-" + o.addClassFocus, "");
        }
    }





    function inputsSwap(el, el2) {
        if (el) el.style.display = "none";
        if (el2) el2.style.display = "inline";
    }
}
if (window.addEventListener)
    window.addEventListener("load", initPage, false);
else if (window.attachEvent)
    window.attachEvent("onload", initPage);
