function validateForm()

{

    var test;
    if (document.forms[0].lp.value != "") {
        test=parseInt(document.forms[0].lp.value)
        if (isNaN(test)) {
            alert("Lower price range must be a number");
            document.forms[0].lp.focus();
            return false;
        }
    }
    if (document.forms[0].up.value != "") {
        test=parseInt(document.forms[0].up.value)
        if (isNaN(test)) {
            alert("Upper price must be a number");
            document.forms[0].up.focus();
            return false;
        }
    }
    if (document.forms[0].up.value == "" && document.forms[0].lp.value == "") {
        document.forms[0].lp.value = "0";
        document.forms[0].up.value = "9999";
    }
    if (document.forms[0].up.value != "" && document.forms[0].lp.value == "") {
        document.forms[0].lp.value = "0";
    }
    if (document.forms[0].lp.value != "" && document.forms[0].up.value == "") {
        document.forms[0].up.value = "9999";
    }
    if (parseInt(document.forms[0].up.value) < parseInt(document.forms[0].lp.value)) {
        alert("Upper price must not be lower than lower price");
        document.forms[0].lp.focus();
        return false;
    }


    return true;

}