String.prototype.trim=function()
{
  return this.replace(/^\s+|\s+$g/,"");
}

function numFormat(n, d, s) 
{
        if (arguments.length == 2) { s = "'"; }
        if (arguments.length == 1) { s = "'"; d = "."; }
        n = n.toString();
        a = n.split(d);
        x = a[0];
        y = 0;//a[1];
        z = "";
        if (typeof(x) != "undefined") {
        for (i=x.length-1;i>=0;i--)
                z += x.charAt(i);
        z = z.replace(/(\d{3})/g, "$1" + s);
        if (z.slice(-s.length) == s)
                z = z.slice(0, -s.length);
        x = "";
        for (i=z.length-1;i>=0;i--)
                x += z.charAt(i);
        if (typeof(y) != "undefined" && y.length > 0)
                x += d + y;
        }
        return x;
}


$(document).ready(function($)
{
            $("input[type=file]").filestyle({ 
                 image: "./i/browse.gif",
                 imageheight : 23,
                 imagewidth : 71,
                 width : 250
            });

            $.fn.cluetip.defaults.width=500;
            $.fn.cluetip.defaults.clueZindex=2000;
            $.fn.cluetip.defaults.splitTitle='|';

});

function cd(v){ if(v>31 || v<1) return false; else return true; }
function cm(v){ if(v>12 || v<1) return false; else return true; }
function cy(v){ if(v>2012 || v<1900) return false; else return true; }

