
String.prototype.padLeft=function()
{if(arguments.length==0){return this;}
if(arguments.length>=1&&isNaN(arguments[0])){return this;}
if(arguments[0]<0){return this;}
var strThis=this,intLength=parseInt(arguments[0],10),strChar=String.fromCharCode(32);if(arguments.length==2){strChar=''+arguments[1];}
while(strThis.length<intLength){strThis=strChar+strThis;}
return strThis;}
String.prototype.padRight=function()
{if(arguments.length==0){return this;}
if(arguments.length>=1&&isNaN(arguments[0])){return this;}
if(arguments[0]<0){return this;}
var strThis=this,intLength=parseInt(arguments[0],10),strChar=String.fromCharCode(32);if(arguments.length==2){strChar=''+arguments[1];}
while(strThis.length<intLength){strThis=strThis+strChar;}
return strThis;}