function ValidateForm(intCurStep)
    {
        //var intCurPage = parseInt(document.getElementById('hidCurStep').value);
        
        var intCurPage = intCurStep;
        var blnResult = false;
        var ObjToCompare, strParamName, strMessage, MinVal, MaxVal, CurVal, MinValDisplay, MaxValDisplay;

        switch (intCurPage)
        {
           case 1:
                ObjToCompare = document.getElementById('txtPropVal');
                strParamName = 'PROPERTY VALUE';
                break;
           case 2:
                ObjToCompare = document.getElementById('txtBorrow');
                strParamName = 'INITIAL BORROWING AMOUNT';
                break;
           case 3:
                ObjToCompare = document.getElementById('txtTopUpReqExpAmnt');
                strParamName = 'TOP-UP EXPRESS FACILITY AMOUNT';
                break;
           case 4:
                ObjToCompare = document.getElementById('txtExtraLoanReq');
                strParamName = 'FURTHER ADVANCE FACILITY AMOUNT';
                break;
        }
        
        re = /[A-Za-z,]/g;
        MinVal = parseFloat(ObjToCompare.minval.replace(re,''));
        MaxVal = parseFloat(ObjToCompare.maxval.replace(re,''));
        MinValDisplay = ObjToCompare.minval;
        MaxValDisplay = ObjToCompare.maxval;

        CurVal = parseFloat(ObjToCompare.value.replace(re,''));

        if (isNaN(CurVal))
        {
            if (ObjToCompare.value.replace(' ','') != '')
            {
                ObjToCompare.value = '';
                return false;
            }
            return true;
        }

        if ((MinVal != -1) && (MaxVal != -1))
        {
            if ((CurVal >= MinVal) && (CurVal <= MaxVal))
            {
                blnResult = true;
            }
            else
            {
                strMessage = ' must be between R ' + MinValDisplay + ' and R ' + MaxValDisplay;
            }
        }
        else
        {
            if (MinVal == -1)
            {
                if (CurVal <= MaxVal)
                {
                    blnResult = true;
                }
                else
                {
                    strMessage = ' must be equal or less than R ' + MaxValDisplay;
                }
            }
            else
            {
                if (MaxVal == -1)
                {
                    if (CurVal >= MinVal)
                    {
                        blnResult = true;
                    }
                    else
                    {
                        strMessage = ' must be equal or greter than R ' + MinValDisplay;
                    }
                }
            }
        }
        
        if (! blnResult)
        {
            strMessage = strParamName + strMessage;
            alert(strMessage);
            ObjToCompare.value = '';
//            ObjToCompare.focus();
//            ObjToCompare.select();
        }
        //alert(MinVal + ' | ' + MaxVal + ' | ' + CurVal + ' | ' + blnResult);
        return blnResult;
}

function DefaultAge2()
{
    var objTextBox2 = document.getElementById('txtName_2');
    if (objTextBox2.value.replace(' ','') != '' && document.getElementById('cboAge_2').selectedIndex == 0)
    {
        alert("Please select a value for the Second Applicant age.");
        document.getElementById('cboAge_2').focus();
    }
}