﻿function clear_searchBox() {
    var box = $('#ctl00_ctl00_searchBox');
    if (box.val() === box.defaultValue) {
        box.value = "";
        box.css('color', "#000");
    }
}
function restore_searchBox() {
    var box = $('#ctl00_ctl00_searchBox');
    if (box.val() === undefined || box.val() == 0 || box.val() == "") {
        box.value = "";  //box.defaultValue;
        //    box.css('color', "#999");
    }
}
function hideLabel(obj, flag) {
    var lbl = obj.parentNode.getElementsByTagName('label')[0];
    if (flag) {
        lbl.style.textIndent = "-99999px";
    } else {
        if (obj.value === '')
            lbl.style.textIndent = "0px";
        else
            lbl.style.textIndent = "-99999px";
    }

}
function focusSearchField(obj) {
    var id, field;
    id = obj.getAttribute('for');
    if (id && (field = document.getElementById(id))) {
        field.focus();
    }

}

function escapeCharacters() {

    var endOfIdToMatch = 'txtSearchBox';
    $("[id$=" + endOfIdToMatch + "]").each(function() {
        this.value = this.value.replace(/</g, '&lt;').replace(/>/g, '&gt;');

    });

}
