function init(pErrorMsg) {
    if (pErrorMsg != "") {
        document.getElementById("formRecError").style.display = "block";
        document.getElementById("formRecError").innerHTML = pErrorMsg;
    } else {
        document.getElementById("formRecError").style.display = "none";
    }
}

    function checkParameters(pForm) {
        l_strWarning = ""

        if (pForm.pFromDate.value == "" &&  pForm.pToDate.value == "" &&
            pForm.txtKeywords.value == "" && pForm.chkPhoto.checked == false) {
                l_strWarning += "<li><strong>Search:</strong> Please select at least one item to search by.";
            }
    	var l_strCheckDate = isDate(pForm.pFromDate.value)
        if (l_strCheckDate != "") l_strWarning += "<li><strong>From Date:</strong>" + l_strCheckDate;
        l_strCheckDate = isDate(pForm.pToDate.value)
        if (l_strCheckDate != "") l_strWarning += "<li><strong>To Date:</strong>" + l_strCheckDate;
        if (pForm.pToDate.value != "" && isDate(pForm.pFromDate.value) == "" && isDate(pForm.pToDate.value) == "") {
            if (Date.parse(pForm.pFromDate.value) > Date.parse(pForm.pToDate.value))
                l_strWarning += "<li><strong>To Date:</strong> Cannot precede From Date";
        }
    
        if (l_strWarning != "") {
            document.getElementById("formRecError").style.display = "block";
            document.getElementById("formRecError").innerHTML= "<strong>The form cannot be submitted because\nthe following fields are invalid/incomplete:</strong><ul>" + l_strWarning + "</ul>";
            return false;
        } else {
            pForm.submit();
        }
    }