String.prototype.isEmpty = function()
{
	return this.match(/^\s*$/);
}

String.prototype.isInteger = function()
{
	return this.match(/^[0-9]+$/);
}

String.prototype.isFloat = function()
{
	return this.match(/^([0-9]+|[0-9]+\.[0-9]+)$/);
}

String.prototype.isEmail = function()
{
	return this.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/);
}

String.prototype.isString = function()
{
	return this.match(/^[a-zA-Z._-]/);
}

function trim (str) 
{
    var str = str.replace(/^\s\s*/, ''),
              ws = /\s/,
              i = str.length;
    while (ws.test(str.charAt(--i)));
    return str.slice(0, i + 1);
}