String.prototype.isEmail = function()
{
  return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(this);
}


String.prototype.LengthW = function()
{
 return this.replace(/[^\x00-\xff]/g,"**").length;
}


String.prototype.isNumChr = function()
{
	return !/[^0-9a-zA-Z]/g.test(this);
}


String.prototype.isNum = function()
{
	return !/[^0-9]/g.test(this);
}

String.prototype.isTel = function()
{
	return !/[^0-9\(\)\.\-]/g.test(this);
}


String.prototype.LenthByByte = function()
{
	var len;
	var i;
	len = 0;
	for (i=0;i<this.length;i++)
	{
		if (this.charCodeAt(i)>255) len+=2; else len++;
	}
	return len;
}

String.prototype.Trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/g, "");
}

String.prototype.isDate = function()
{
	return /^\d{4}\-\d{2}\-\d{2}$/g.test(this);
}
