(a) (1) In any civil action in which the court having jurisdiction finds that there was a complete absence of a justiciable issue of either law or fact raised by the losing party or his attorney, the court shall award an attorney's fee in an amount not to exceed five thousand dollars ($5,000), or ten percent (10%) of the amount in controversy, whichever is less, to the prevailing party unless a voluntary dismissal is filed or the pleadings are amended as to any nonjusticiable issue within a reasonable