Pad

/* Recursively pads a space to one side of the passed "s"
    "i" is the index - how many to add
    "d" is the direction - if d is missing or not right, assumes left padding
    could be redone to include being passed the padding character

    original method:
     function PadLeft(s,i){ return ( i>=1 ) ? (" "+s,i-1,d) :s; }

  */
<script type="text/javascript">
    function Pad(s,i,d){
        return ( i>=1 )
                  ? Pad(((d!=null && d.toLowerCase()=="r")?s+" ":" "+s),i-1,d)
                   :s;
    }
</script>