/*-----------------------------------------------------------------------------
	Luis Miguel Santiago Piņeiro - v2.0 - Julio 2002
-----------------------------------------------------------------------------*/

String.prototype.trim = function ()
{
	return this.lTrim().rTrim();
}

String.prototype.lTrim = function ()
{
	return this.replace(/(^\s+)/g, '');
}


String.prototype.rTrim = function ()
{
	return this.replace(/(\s+$)/g, '');
}

String.prototype.left = function (n)
{
	return this.substr(0, n);
}

String.prototype.right = function (n)
{
	return this.substr(this.length-n, n);
}

function errorSiVacio(campo, nombre)
{
	if (campo.value.trim() == '')
	{
		alert('El campo "' + nombre + '" no puede estar vacio. ');
		campo.focus();
		return false;
	}
	return true;
}