﻿function searchclear() {
    document.forms["pcw_core_nav_form"].elements["quick_search"].value = "";
}
function searchpopulate() {
    var ourfield = document.forms["pcw_core_nav_form"].elements["quick_search"];
    if (ourfield.value == "") ourfield.value = "Keyword/Product code";
}
function isblank(s) {
    for (var i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if (c != " ") {
            if (c == "'" || c == "#")
                return true;
            else return false;
        }
    }
    return true;
}
function doSimpleSearch() {
    var chosen = 0;

    var sCriterion = document.pcw_core_nav_form.quick_search.value;
    if (isblank(sCriterion))
        alert("Please enter a valid search term");
    else {
        var url = "/catalog/search.asp?search=" + escape(sCriterion);
        window.location = url;
    }
}
function CheckSearch() {
    var ourfield = document.forms["pcw_core_nav_form"].elements["quick_search"];
    if (ourfield.value == "Keyword/Product code" || ourfield.value == "Enter Keyword/Product Code") {
        alert("Please enter a valid search term");
    } else {
        doSimpleSearch()
    }
}
<!--
    function menuOn(x) {
        var obj = document.getElementById(x);
        obj.style.backgroundColor = '#F5E0F5';
    }

    function menuOff(x) {
        var obj = document.getElementById(x);
        obj.style.backgroundColor = '#ffffff';
    }
//-->

<!--
    function MM_callJS(jsStr) { //v2.0
        return eval(jsStr)
    }


    function hideMe(x) {
        var obj = document.getElementById(x);

        if (obj.style.display == "block") { obj.style.display = "none"; return; }
        else obj.style.display = "block";
    }

    function showLayer(x) {
        var obj = document.getElementById(x);
        document.getElementById(x).style.display = "block";
        document.getElementById('why-choose-pcw').style.display = "none";

    }
    function hideLayer(x) {
        var obj = document.getElementById(x);
        document.getElementById(x).style.display = "none";
        document.getElementById('why-choose-pcw').style.display = "block";
    }


//-->
    function MM_findObj(n, d) { //v4.01
        var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
            d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
        }
        if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
        for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
        if (!x && d.getElementById) x = d.getElementById(n); return x;
    }

    function MM_showHideLayers() { //v6.0
        var i, p, v, obj, args = MM_showHideLayers.arguments;
        for (i = 0; i < (args.length - 2); i += 3) if ((obj = MM_findObj(args[i])) != null) {
            v = args[i + 2];
            if (obj.style) { obj = obj.style; v = (v == 'show') ? 'visible' : (v == 'hide') ? 'hidden' : v; }
            obj.visibility = v;
        }
    }