
function IsValidSearch(txtBoxID,noInputMessage,InputInvalid) 
{
    var txtBoxValue = document.getElementById(txtBoxID).value;
    var regExpBeginning = /^\s+/;
    var regExpEnd       = /\s+$/;
    var filter  = /^[^<>]+$/;
    
    txtBoxValue = txtBoxValue.replace(regExpBeginning,'').replace(regExpEnd,'');

    
    if (!filter.test(txtBoxValue) && txtBoxValue.length>0)
    {
        alert(InputInvalid);
        return false;
    }
    if (txtBoxValue.length>0 && txtBoxValue.indexOf('?')==-1) 
    {
        return true;
    }
    else 
    {
        alert(noInputMessage);
        return false;
    }
}